I have a graph which is dynamically generated by code and I'm using graphviz-java to plot it.
but the plotted graph has unnecessary edge crossings despite the fact the generated graph was flat.
i searched similar questions but the answers involved using tricks like adding invisible edges, since in my case graph is generated by code dynamically I can't use those tricks is there any algorithm to improve node placements so that the edge crossings are minimized?
here is desired output vs. generated result by Graphviz (desired is drawn manually)
I managed to get the desired output by changing the Layout Engine to NEATO.
Graphviz.fromGraph(mg).engine(Engine.NEATO).render(Format.PNG).toImage();