Skip to content

fix: return an undirected minimum spanning tree from prim - #263

Open
Aschenbath wants to merge 1 commit into
dagrejs:masterfrom
Aschenbath:fix/oss-20-20261125-77d1-graphlib-undirected-mst
Open

Aschenbath wants to merge 1 commit into
dagrejs:masterfrom
Aschenbath:fix/oss-20-20261125-77d1-graphlib-undirected-mst

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

prim() promises an undirected minimum spanning tree but constructs a directed graph. Subsequent default shortest-path queries can therefore reach only one side of a selected edge. Construct an undirected result, including empty and single-node inputs, and verify paths in both directions.

Validation: 283 Jest tests pass, plus package build, TypeScript checking, and ESLint on Windows / Node 24.22.0. The pre-existing Windows ESM smoke test fails on the unchanged base with ERR_UNSUPPORTED_ESM_URL_SCHEME; only that test was excluded from this run (tracked separately in #258).

Developed with AI assistance; the regressions were reproduced on the unchanged base before applying the fix.

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