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

Fix `bipartite-color` for digraphs with nodes with no outgoing edges #117

Open prismofeverything opened 5 years ago

prismofeverything commented 5 years ago

An issue came up over in the Ubergraph repository about a failure with bipartite-color in the case of digraphs. There is discussion about the problem and solution there. It turns out this function comes from Loom, so I am submitting the fix here.

As it seems the code was expecting successors to perform as a general neighbors function I wonder if this assumption is being made anywhere else in the code? I know this PR adds neighbors to the core API but IMO this function is fundamental enough to justify it.

Open to all thoughts and feedback, thanks!