(index ("make-digraph" 0))
(def (sig (procedure "make-digraph:: NAME INFO [NODE-LIST [SUCC-LIST [PRED-LIST]]] -> SELECTOR" (id make-digraph))) (p "where:") (ul (li (tt "NAME") " is the graph name (string or symbol)") (li (tt "INFO") " is an optional metadata object of an arbitrary type or " (tt "#f")) (li (tt "NODE-LIST") " is an optional list of nodes to be inserted in the graph; each element of the list must be of the form " (tt "(N INFO)") " where " (tt "N") " is a unique node number (integer), and " (tt "INFO") " is an optional metadata object describing the node. ") (li (tt "SUCC-LIST") " and " (tt "PRED-LIST") " can be used to define the graph edges upon graph creation. If supplied, these arguments must be lists in which every element is of the form " (tt "(I J INFO)") ", where " (tt "I") " and " (tt "J") " are node numbers, and " (tt "INFO") " is an optional metadata object.")) (p "The returned selector procedure can take one of the following arguments:") (dl (dt (tt "'name")) (dd "returns the graph name (string or symbol)") (dt (tt "'info")) (dd "returns the graph metadata (arbitrary type)") (dt (tt "'new-id!")) (dd "returns a procedure with no arguments, which returns the lowest available node number") (dt (tt "'add-node!")) (dd "returns a procedure " (tt "LAMBDA N INFO") " which inserts in the graph node with number " (tt "N") " and metadata " (tt "INFO") "; if the node already exists in the graph, it will be overwritten with the new metadata") (dt (tt "'add-edge!")) (dd "returns a procedure " (tt "LAMBDA EDGE") " which inserts in the graph the specifed edge; the edge is given by a list of the form " (tt "(I J INFO)") ", where " (tt "I") " and " (tt "J") " are source and destination nodes, respectively, and " (tt "INFO") " is edge metadata of arbitrary type") (dt (tt "'remove-node!")) (dd "returns a procedure " (tt "LAMBDA N") " which removes node " (tt "N") " and all its edges from the graph") (dt (tt "'nodes")) (dd "returns a procedure with no arguments, which returns a list with the nodes of the graph and their metadata") (dt (tt "'edges")) (dd "returns a procedure with no arguments, which returns a list with the edges of the graph and their metadata") (dt (tt "'roots")) (dd "returns a procedure with no arguments, which returns a list with all nodes in the graph that do not have an predecessor") (dt (tt "'terminals")) (dd "returns a procedure with no arguments, which returns a list with all nodes in the graph that do not have a successor") (dt (tt "'order")) (dd "returns a procedure with no arguments, which returns the number of nodes in the graph") (dt (tt "'size")) (dd "returns a procedure with no arguments, which returns the number of edges in the graph") (dt (tt "'capacity")) (dd "returns a procedure with no arguments, which returns the size of the underlying dynamic vector") (dt (tt "'succ")) (dd "returns a procedure " (tt "LAMBDA N") " which returns a list with the successor nodes of node " (tt "N")) (dt (tt "'pred")) (dd "returns a procedure " (tt "LAMBDA N") " which returns a list with the predecessor nodes of node " (tt "N")) (dt (tt "'succ-list")) (dd "returns a procedure with no arguments  which returns a list containing the successor nodes for each node.") (dt (tt "'pred-list")) (dd "returns a procedure with no arguments  which returns a list containing the predecessor nodes for each node.") (dt (tt "'out-edges")) (dd "returns a procedure " (tt "LAMBDA N") " which returns a list with the outgoing edges of node " (tt "N")) (dt (tt "'in-edges")) (dd "returns a procedure " (tt "LAMBDA N") " which returns a list with the incoming edges of node " (tt "N")) (dt (tt "'has-edge")) (dd "returns a procedure " (tt "LAMBDA I J") " which returns true if edge " (tt "I -> J") " exists in the graph and false otherwise") (dt (tt "'has-node")) (dd "returns a procedure " (tt "LAMBDA N") " which returns true if node " (tt "N") " exists in the graph and false otherwise") (dt (tt "'node-info")) (dd "returns a procedure " (tt "LAMBDA N") " which returns the metadata for node " (tt "N")) (dt (tt "'node-info-set!")) (dd "returns a procedure " (tt "LAMBDA N V") " which sets the metadata for node " (tt "N")) (dt (tt "'foreach-node")) (dd "returns an iterator procedure " (tt "LAMBDA F") " which iterates over the nodes in the graph by invoking function " (tt "F") " on the node number and metadata of each node") (dt (tt "'foreach-edge")) (dd "returns an iterator procedure " (tt "LAMBDA F") " which iterates over the edges in the graph by invoking function " (tt "F") " on each edge") (dt (tt "'debug")) (dd "returns a list with the internal representation of the graph")))
