microsoft / automatic-graph-layout

A set of tools for graph layout and viewing
Other
1.36k stars 304 forks source link

"Soft" constraint as a tie breaker #265

Open fraschfn opened 3 years ago

fraschfn commented 3 years ago

I use a Sugiyama layout to produce a graph. I have soft constraints on some nodes regarding relative ordering. In the image below the nodes M1,M2, M3, M4 should be in this order from left to right. But only if there is no other restriction. So I cannot enforce this with restrictions with SugiyamaLayoutSettings.AddLeftRightConstraint(Node, Node).

If one looks just at the number, crossings etc. there is no difference between this image and the one where M2 and M3 are swapped.

I'd like to know if it's possible to define this.

image