I have a simple graph which has some nodes and different type of relationships between nodes as shown in following image.
Are you using TreeLayout? If so, you can sort the “children” by the type of link they have from the parent.
You’ll need to implement a custom IComparer and set the TreeLayout.Sorting and Comparer properties.
That’s a problem then, because LayeredDigraphLayout tries to re-order the nodes in a layer in order to reduce the number of crossings.
Imagine there were an “A2” node next to “A1” and that it were connected to “B”, “C”, et al with links of type “R1” and “R2” randomly and differently than “A1”'s connections. There would be no way to sort the “B”, “C” et al nodes in the second layer to ensure that all of the “R1” links are together.
Understood. Thanks a lot for your support.
If there is a “main” backbone to your graph, perhaps you could use TreeLayout after all. It depends on your application data – I don’t know if you would want to include the non-“main” links in the layout.
TreeLayout is tolerant of non-tree-structured links, although the results may be surprising.