Version: 4.2.1.5
Connected Components
Finds the connected components of a graph.
(require (planet jaymccarthy/connected)) |
| |||||||||||||||||||||
nodes : (listof any/c) | |||||||||||||||||||||
node->edges : (any/c . -> . (listof any/c)) | |||||||||||||||||||||
edge->node : (any/c . -> . any/c) |
Returns a list of lists of nodes. Each node list represents a connected component of the graph induced by nodes, node->edges, and edge->node. These are provided as procedures rather than data structures to be more general.
Refer to "test.ss" for a short example.