aysylu / loom

Graph library for Clojure. Mailing list https://groups.google.com/forum/#!forum/loom-clj
http://aysy.lu/loom/
886 stars 108 forks source link

connected-components should return a seq of (sub)graphs #122

Open skrat opened 4 years ago

skrat commented 4 years ago

A component is a subgraph, whereas the connected-components returns vector of vectors without any connectivity data. It also does not preserve order even in simple cases such as this one:

(alg/connected-components
 (graph/graph {\a #{\b}
               \b #{\c}
               \c #{\d}
               \d #{\a}}))

=> [[\a \b \d \c]]

I'm not sure how is this function useful.