Changeset 36981 in project for wiki


Ignore:
Timestamp:
12/09/18 15:30:08 (9 months ago)
Author:
Ivan Raikov
Message:

updated digraph api info

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/digraph

    r36980 r36981  
    3131
    3232
    33 The returned [[yasos]] object can take one of the following messages:
     33The returned [[yasos]] object supports the following operations:
    3434
    3535; {{name}} : returns the graph name (string or symbol)
    3636; {{info}} : returns the graph metadata (arbitrary type)
    3737; {{new-id!}} : returns a procedure with no arguments, which returns the lowest available node number
    38 ; {{add-node!}} : returns a procedure {{LAMBDA N INFO}} which inserts in the graph node with number {{N}} and metadata {{INFO}}; if the node already exists in the graph, it will be overwritten with the new metadata
    39 ; {{add-edge!}} : returns a procedure {{LAMBDA EDGE}} which inserts in the graph the specifed edge; the edge is given by a list of the form {{(I J INFO)}}, where {{I}} and {{J}} are source and destination nodes, respectively, and {{INFO}} is edge metadata of arbitrary type
    40 ; {{remove-node!}} : returns a procedure {{LAMBDA N}} which removes node {{N}} and all its edges from the graph
    41 ; {{nodes}} : returns a procedure with no arguments, which returns a list with the nodes of the graph and their metadata
    42 ; {{edges}} : returns a procedure with no arguments, which returns a list with the edges of the graph and their metadata
    43 ; {{roots}} : returns a procedure with no arguments, which returns a list with all nodes in the graph that do not have an predecessor
    44 ; {{terminals}} : returns a procedure with no arguments, which returns a list with all nodes in the graph that do not have a successor
    45 ; {{order}} : returns a procedure with no arguments, which returns the number of nodes in the graph
    46 ; {{size}} : returns a procedure with no arguments, which returns the number of edges in the graph
    47 ; {{capacity}} : returns a procedure with no arguments, which returns the size of the underlying dynamic vector
    48 ; {{succ}} : returns a procedure {{LAMBDA N}} which returns a list with the successor nodes of node {{N}}
    49 ; {{pred}} : returns a procedure {{LAMBDA N}} which returns a list with the predecessor nodes of node {{N}}
    50 ; {{succ-list}} : returns a procedure with no arguments  which returns a list containing the successor nodes for each node.
    51 ; {{pred-list}} : returns a procedure with no arguments  which returns a list containing the predecessor nodes for each node.
    52 ; {{out-edges}} : returns a procedure {{LAMBDA N}} which returns a list with the outgoing edges of node {{N}}
    53 ; {{in-edges}} : returns a procedure {{LAMBDA N}} which returns a list with the incoming edges of node {{N}}
    54 ; {{has-edge}} : returns a procedure {{LAMBDA I J}} which returns true if edge {{I -> J}} exists in the graph and false otherwise
    55 ; {{has-node}} : returns a procedure {{LAMBDA N}} which returns true if node {{N}} exists in the graph and false otherwise
    56 ; {{node-info}} : returns a procedure {{LAMBDA N}} which returns the metadata for node {{N}}
    57 ; {{node-info-set!}} : returns a procedure {{LAMBDA N V}} which sets the metadata for node {{N}}
    58 ; {{foreach-node}} : returns an iterator procedure {{LAMBDA F}} which iterates over the nodes in the graph by invoking function {{F}} on the node number and metadata of each node
    59 ; {{foreach-edge}} : returns an iterator procedure {{LAMBDA F}} which iterates over the edges in the graph by invoking function {{F}} on each edge
     38; {{add-node!}} : procedure {{LAMBDA N INFO}} which inserts in the graph node with number {{N}} and metadata {{INFO}}; if the node already exists in the graph, it will be overwritten with the new metadata
     39; {{add-edge!}} : procedure {{LAMBDA EDGE}} which inserts in the graph the specifed edge; the edge is given by a list of the form {{(I J INFO)}}, where {{I}} and {{J}} are source and destination nodes, respectively, and {{INFO}} is edge metadata of arbitrary type
     40; {{remove-node!}} : procedure {{LAMBDA N}} which removes node {{N}} and all its edges from the graph
     41; {{nodes}} : returns a list with the nodes of the graph and their metadata
     42; {{edges}} : returns a list with the edges of the graph and their metadata
     43; {{roots}} : returns a list with all nodes in the graph that do not have an predecessor
     44; {{terminals}} : which returns a list with all nodes in the graph that do not have a successor
     45; {{order}} : returns the number of nodes in the graph
     46; {{size}} : returns the number of edges in the graph
     47; {{capacity}} : returns the size of the underlying dynamic vector
     48; {{succ}} : procedure {{LAMBDA N}} which returns a list with the successor nodes of node {{N}}
     49; {{pred}} : procedure {{LAMBDA N}} which returns a list with the predecessor nodes of node {{N}}
     50; {{succ-list}} : returns a list containing the successor nodes for each node.
     51; {{pred-list}} : returns a list containing the predecessor nodes for each node.
     52; {{out-edges}} : procedure {{LAMBDA N}} which returns a list with the outgoing edges of node {{N}}
     53; {{in-edges}} : procedure {{LAMBDA N}} which returns a list with the incoming edges of node {{N}}
     54; {{has-edge}} : procedure {{LAMBDA I J}} which returns true if edge {{I -> J}} exists in the graph and false otherwise
     55; {{has-node}} : procedure {{LAMBDA N}} which returns true if node {{N}} exists in the graph and false otherwise
     56; {{node-info}} : procedure {{LAMBDA N}} which returns the metadata for node {{N}}
     57; {{node-info-set!}} : procedure {{LAMBDA N V}} which sets the metadata for node {{N}}
     58; {{foreach-node}} : procedure {{LAMBDA F}} which iterates over the nodes in the graph by invoking function {{F}} on the node number and metadata of each node
     59; {{foreach-edge}} : procedure {{LAMBDA F}} which iterates over the edges in the graph by invoking function {{F}} on each edge
    6060
    6161
Note: See TracChangeset for help on using the changeset viewer.