Connected Components

Jay McCarthy <jay at plt-scheme dot org>

Finds the connected components of a graph.

 (require (planet jaymccarthy/connected))

(connected-components nodes    
  edge->node)  (listof (listof any/c))
  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 "" for a short example.