Minimizing edge crossings in a force simulation

Hey, folks! I’ve been exploring rendering DAGs using force simulations in D3, and I’m having some concerns about edge crossings. Specifically, for good visualizations I’d like to minimize edge crossings, but I’m not certain how to adapt force simulations to that goal. I’m a bit concerned that force simulations aren’t a good match; I’d expect force simulations to be best when there aren’t many local energy minima, and my gut suggests that graphs with crossings are likely to have a lot of local minima. Any suggestions?

For context, what I’m interested in doing is building an interactive graph explorer that allows looking at subsets of a larger, more complicated graph (e.g. the call tree or object relationship diagram of a complex program) and interactively adding and removing nodes to focus on areas of interest in that graph. In the past for displaying simple structures of that type I’ve used GraphViz, but the programmable interactivity of D3 makes want to come up with a good enough solution within it.

Thanks much in advance …

– Randy

I’m not sure that force layouts are the right tool here. Have you seen d3-dag?

There are quite a few examples on Observable: Search / Observable

1 Like

No, but that may be the right tool for the job; d3+Sugiyama looks hopeful. I’ll take a look. Thanks!