Hacker News new | ask | show | jobs
by czx111331 1133 days ago
Yes, I use a similar approach when debugging some parts of my CRDTs as well. It's very helpful.

However, this algorithm is designed specifically for trees. I'm not sure whether I could manage to make it work on DAGs (Directed Acyclic Graphs). It would require some rewrites of the aesthetic rules and designing a new algorithm.

1 comments

The way we do it at work is to have a separate step before a tree layout that removes non-tree edges, lays out the tree, and then re-insert the edges and calculates separate routes for them. You can play with this here by adding new edges and re-layouting: https://live.yworks.com/demos/layout/layoutstyles/index.html...

That being said, those edges of course sometimes just won't fit nicely into the general layout. And which edges are "tree" edges and which are "non-tree" edges can of course be debatable. If a graph is very much not a tree, this can be somewhat random, but it works very well for graphs that are mostly trees.

Thanks for sharing. I might be able to build upon this.