Skip to content

Preserve shortest-path edges in Kou-Markowsky-Berman Steiner trees - #1391

Merged
jsichi merged 1 commit into
jgrapht:masterfrom
PHJ2000:fix-steiner-shortest-path-edges
Oct 9, 2026
Merged

jsichi merged 1 commit into
jgrapht:masterfrom
PHJ2000:fix-steiner-shortest-path-edges

Conversation

@PHJ2000

@PHJ2000 PHJ2000 commented Oct 4, 2026

Copy link
Copy Markdown

Fixes #1390.

Path expansion reconstructs edges from consecutive vertices, so parallel edges of weights 10 and 1 can produce a tree of weight 10. It also creates replacement edges, leaving the returned edge set outside the input graph even for a simple path.

Use the stored shortest paths' edge lists and retain the original edges through the final MST. Add regressions for original edge identity and selection of the cheaper parallel edge.

Both regressions fail before the fix and pass afterward. Reproduced on 1.5.3 and master. mvn clean install checkstyle:check javadoc:aggregate -P checkstyle passed all 10 modules: 7,520 tests, 0 failures/errors, 16 skipped. Existing compiler and Javadoc warnings in unchanged sources remain.


@jsichi
jsichi merged commit 63ab943 into jgrapht:master Oct 9, 2026
3 checks passed
@jsichi

jsichi commented Oct 9, 2026

Copy link
Copy Markdown
Member

Thanks!

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.

KouMarkowskyBermanAlgorithm loses shortest-path edge identities

2 participants