chickadee » interval-digraph » make-digraph

make-digraph:procedure

where NAME is the graph name (string or symbol), LABEL is an optional metadata object of an arbitrary type or #f.

The returned selector procedure can take one of the following arguments:

'name
returns the graph name (string or symbol)
'label
returns the graph metadata (arbitrary type)
'nodes
returns a procedure with no arguments, which returns a list with the node indices of the graph
'nodes-with-labels
returns a procedure with no arguments, which returns a list with the node indexes of the graph, along with optional label
'node-intervals
returns the node indices of the graph as a cis interval object
'edges
returns a procedure with no arguments, which returns a list with the edges of the graph
'edges-with-labels
returns a procedure with no arguments, which returns a list with the edges of the graph and their labels
'order
returns a procedure with no arguments, which returns the number of nodes in the graph
'size
returns a procedure with no arguments, which returns the number of edges in the graph
'out-edges
returns a procedure LAMBDA N which returns a list with the outgoing edges of node N
'succ
returns a procedure LAMBDA N which returns a list with the successor nodes of node N
'succ-interval
returns a procedure LAMBDA N which returns a cis interval object with the successor nodes of node N
'has-edge
returns a procedure LAMBDA I J which returns true if edge I -> J exists in the graph and false otherwise
'has-node
returns a procedure LAMBDA N which returns true if node N exists in the graph and false otherwise
'has-node-interval
returns a procedure LAMBDA I which returns true if interval I exists in the graph and false otherwise
'edge-property
returns a procedure LAMBDA P I J which returns the property P of edge I -> J, if it exists, #f otherwise
'edge-property-keys
returns a procedure without arguments, which returns a list with all edge property names
'edge-interval-property
returns a procedure LAMBDA P I J which returns the property P of all edges defined on the intervals I, J, if it exists, #f otherwise
'edge-interval-prototype
returns a procedure LAMBDA P I J which returns the prototype P of all edges defined on the intervals I, J, if it exists, #f otherwise; a prototype is a user-supplied procedure of the form LAMBDA G I J which returns a property value for the edge I -> J
'node-property
returns a procedure LAMBDA P N which returns the property P of node N, if it exists, #f otherwise
'node-property-keys
returns a procedure without arguments, which returns a list with all node property names
'node-interval-property
returns a procedure LAMBDA P I which returns the property P of node interval I, if it exists, #f otherwise
'node-label
returns a procedure LAMBDA N which returns the label of node N if it exists, #f otherwise
'foreach-node
returns an iterator procedure LAMBDA F which iterates over the nodes in the graph by invoking function F on the node index of each node
'foreach-node-with-label
returns an iterator procedure LAMBDA F which iterates over the nodes in the graph by invoking function F on the node index and label of each node
'foreach-edge
returns an iterator procedure LAMBDA F which iterates over the nodes in the graph by invoking function F on the node indices of each edge
'add-node
returns a procedure LAMBDA N [LABEL] which when given a node index N and optional label, returns a new graph containing the original graph plus the given node
'add-node-interval
returns a procedure LAMBDA I [LABEL] which when given a cis interval object I and optional label, returns a new graph containing the original graph plus the given node interval
'add-edge
returns a procedure LAMBDA E [LABEL] which when given edge E = (list I J) and optional label, returns a new graph containing the original graph plus the given edge
'node-label-set
returns a procedure LAMBDA N LABEL which when given a node index N and label, returns a new graph with the labeled node
'node-property-set
returns a procedure LAMBDA P N V which when given property name P, node index N and property value, returns a new graph with the property P set for node N
'node-interval-property-set
returns a procedure LAMBDA P I V which when given property name P, cis interval object I and property value, returns a new graph with the property P set for all nodes in the interval I
'edge-property-set
returns a procedure LAMBDA P I J V which when given property name P, node indices I,J and property value, returns a new graph with the property P set for edge I -> J
'edge-interval-property-set
returns a procedure LAMBDA P I J V which when given property name P, cis interval objects I,J and property value, returns a new graph with the property P set for all defined edges on the intervals I, J
'edge-interval-prototype-set
returns a procedure LAMBDA P I J V which when given property name P, cis interval objects I,J and prototype procedure, returns a new graph with the prototype P set for all defined edges on the intervals I, J; a prototype is a user-supplied procedure of the form LAMBDA G I J which returns a property value for the edge I -> J