microsoft / microsoft/automatic-graph-layout
"Soft" constraint as a tie breaker
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 319
- Avg merge
- 38m
- Merged PRs (30d)
- 1
Description
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.

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Sugiyama layout implementation and the SugiyamaLayoutSettings.AddLeftRightConstraint(Node, Node) entry point to determine where ordering constraints are handled. Define how a soft ordering preference should interact with crossings and other restrictions, then document or test the expected M1, M2, M3, M4 ordering behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100