Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BuchheimWalkerLayoutManager crashes if a node has two parents #80

Closed
NewColours opened this issue Apr 26, 2021 · 2 comments
Closed

BuchheimWalkerLayoutManager crashes if a node has two parents #80

NewColours opened this issue Apr 26, 2021 · 2 comments

Comments

@NewColours
Copy link

NewColours commented Apr 26, 2021

The first walk tries to figure out layout size by looking at prelim sibling. Since the sibling is itself due to having edges from two parents, it crashes with NoSuchElementException

This seems like it should be a valid use (for something like an elimination tournament) although not a true tree in the datastructure sense

at kotlin.collections.MapsKt__MapWithDefaultKt.getOrImplicitDefaultNullable(MapWithDefault.kt:24)
at kotlin.collections.MapsKt__MapsKt.getValue(Maps.kt:344)
at dev.bandb.graphview.layouts.tree.BuchheimWalkerLayoutManager.getNodeData(BuchheimWalkerLayoutManager.kt:40)
at dev.bandb.graphview.layouts.tree.BuchheimWalkerLayoutManager.executeShifts(BuchheimWalkerLayoutManager.kt:128)
at dev.bandb.graphview.layouts.tree.BuchheimWalkerLayoutManager.firstWalk(BuchheimWalkerLayoutManager.kt:73)
at dev.bandb.graphview.layouts.tree.BuchheimWalkerLayoutManager.firstWalk(BuchheimWalkerLayoutManager.kt:67)
at dev.bandb.graphview.layouts.tree.BuchheimWalkerLayoutManager.firstWalk(BuchheimWalkerLayoutManager.kt:67)
at dev.bandb.graphview.layouts.tree.BuchheimWalkerLayoutManager.run(BuchheimWalkerLayoutManager.kt:330)

@DennisBlock
Copy link
Contributor

The BuchheimWalker algorithm is unfortunately only for trees and therefore can only handle one parent. You could try the Sugiyama algorithm, which accepts multiple parents. But maybe the layout will not look as nice then. You have to see if this is enough for your purposes. Otherwise the only way is to develop another/your own algorithm.

@GregorBlock
Copy link
Contributor

I'm closing this issue due to inactivity. If you have further input on the issue, don't hesitate to reopen this issue or post a new one.

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

No branches or pull requests

3 participants