7

Created graph using cytoscape.js. I have set the layout to 'grid'. Need to resolve following problem: original graph-

enter image description here

There is edge from Host3 to Host1 as well as from Host5 to host1,Edge from Host 5 to Host 1 overlapping the edge from Host3 to Host1.

Overlapping edge should appear like:

enter image description here

How to do it? Thanks !

smita chougale
  • 235
  • 5
  • 19
  • I have come across this problem too, though using the dagre layout. – Dale Hurley Feb 18 '15 at 23:55
  • Just want to add that this is only possible in some specific cases. There are graphs where you cannot find such a non-overlapping drawing in the 2D plane. If you want to know more about planar graphs in general, see for example https://en.wikipedia.org/wiki/Planar_graph and http://discretetext.oscarlevin.com/dmoi/sec_planar.html. – Konrad Höffner Dec 05 '18 at 11:06

1 Answers1

3

That's a research problem in graph theory. You can

(1) use a different layout or parameters, or

(2) develop a layout with less overlap for your specific usecase, or

(3) invent and/or implement novel edge overlap avoidance algorithms.

maxkfranz
  • 11,896
  • 1
  • 27
  • 36