Skip to content

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

Open
prismofeverything wants to merge 1 commit into
aysylu:masterfrom
prismofeverything:master
Open

Fix bipartite-color for digraphs with nodes with no outgoing edges#117
prismofeverything wants to merge 1 commit into
aysylu:masterfrom
prismofeverything:master

Conversation

@prismofeverything

Copy link
Copy Markdown

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!

…ming edges, through the addition of a function
jsavyasachi added a commit to jsavyasachi/loom that referenced this pull request Jun 21, 2026
bipartite-color colored only successors, so a digraph node with no outgoing
edges was unreachable and the result was non-deterministic (often a false nil).
Add loom.graph/neighbors (predecessors union successors for digraphs, plain
successors for undirected graphs) and color over it.

The fix in PR aysylu#117 used predecessors unconditionally, which throws on
undirected graphs; guard on directed? so the undirected path is unaffected.

Fixes aysylu#118.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant