 Timestamp:
 12/09/18 15:30:08 (15 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

wiki/eggref/5/digraph
r36980 r36981 31 31 32 32 33 The returned [[yasos]] object can take one of the following messages:33 The returned [[yasos]] object supports the following operations: 34 34 35 35 ; {{name}} : returns the graph name (string or symbol) 36 36 ; {{info}} : returns the graph metadata (arbitrary type) 37 37 ; {{newid!}} : returns a procedure with no arguments, which returns the lowest available node number 38 ; {{addnode!}} : returns aprocedure {{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 metadata39 ; {{addedge!}} : returns aprocedure {{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 type40 ; {{removenode!}} : returns aprocedure {{LAMBDA N}} which removes node {{N}} and all its edges from the graph41 ; {{nodes}} : returns a procedure with no arguments, which returns alist with the nodes of the graph and their metadata42 ; {{edges}} : returns a procedure with no arguments, which returns alist with the edges of the graph and their metadata43 ; {{roots}} : returns a procedure with no arguments, which returns alist with all nodes in the graph that do not have an predecessor44 ; {{terminals}} : returns a procedure with no arguments,which returns a list with all nodes in the graph that do not have a successor45 ; {{order}} : returns a procedure with no arguments, which returnsthe number of nodes in the graph46 ; {{size}} : returns a procedure with no arguments, which returnsthe number of edges in the graph47 ; {{capacity}} : returns a procedure with no arguments, which returnsthe size of the underlying dynamic vector48 ; {{succ}} : returns aprocedure {{LAMBDA N}} which returns a list with the successor nodes of node {{N}}49 ; {{pred}} : returns aprocedure {{LAMBDA N}} which returns a list with the predecessor nodes of node {{N}}50 ; {{succlist}} : returns a procedure with no arguments which returns alist containing the successor nodes for each node.51 ; {{predlist}} : returns a procedure with no arguments which returns alist containing the predecessor nodes for each node.52 ; {{outedges}} : returns aprocedure {{LAMBDA N}} which returns a list with the outgoing edges of node {{N}}53 ; {{inedges}} : returns aprocedure {{LAMBDA N}} which returns a list with the incoming edges of node {{N}}54 ; {{hasedge}} : returns aprocedure {{LAMBDA I J}} which returns true if edge {{I > J}} exists in the graph and false otherwise55 ; {{hasnode}} : returns aprocedure {{LAMBDA N}} which returns true if node {{N}} exists in the graph and false otherwise56 ; {{nodeinfo}} : returns aprocedure {{LAMBDA N}} which returns the metadata for node {{N}}57 ; {{nodeinfoset!}} : returns aprocedure {{LAMBDA N V}} which sets the metadata for node {{N}}58 ; {{foreachnode}} : returns an iteratorprocedure {{LAMBDA F}} which iterates over the nodes in the graph by invoking function {{F}} on the node number and metadata of each node59 ; {{foreachedge}} : returns an iteratorprocedure {{LAMBDA F}} which iterates over the edges in the graph by invoking function {{F}} on each edge38 ; {{addnode!}} : 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 ; {{addedge!}} : 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 ; {{removenode!}} : 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 ; {{succlist}} : returns a list containing the successor nodes for each node. 51 ; {{predlist}} : returns a list containing the predecessor nodes for each node. 52 ; {{outedges}} : procedure {{LAMBDA N}} which returns a list with the outgoing edges of node {{N}} 53 ; {{inedges}} : procedure {{LAMBDA N}} which returns a list with the incoming edges of node {{N}} 54 ; {{hasedge}} : procedure {{LAMBDA I J}} which returns true if edge {{I > J}} exists in the graph and false otherwise 55 ; {{hasnode}} : procedure {{LAMBDA N}} which returns true if node {{N}} exists in the graph and false otherwise 56 ; {{nodeinfo}} : procedure {{LAMBDA N}} which returns the metadata for node {{N}} 57 ; {{nodeinfoset!}} : procedure {{LAMBDA N V}} which sets the metadata for node {{N}} 58 ; {{foreachnode}} : 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 ; {{foreachedge}} : procedure {{LAMBDA F}} which iterates over the edges in the graph by invoking function {{F}} on each edge 60 60 61 61
Note: See TracChangeset
for help on using the changeset viewer.