I would like to use the hierarchical layout in yEd. However, when running the algorithm to layout the nodes, it is selecting the wrong node to place at the top. Is it possible to control which node is placed at the top and then let the algorithm position the remainder of the nodes?

The reason why the algorithm is failing is that the end node has an arrow pointing back to the start node. If I remove the cycle in the graph, the start node will be on top. I would like to be able to maintain the cycle to be able to indicate that the process will start over again and have the start node be on the top.

I am using version 3.21.1 on macOS 10.15.7 if it matters.


Answered at https://yed.yworks.com/support/qa/22725/specifying-the-start-node-in-a-hierarchical-layout-in-yed?show=22734#a22734 ... repeated here for completeness

Unfortunately, yEd does not provide a way to specify which node should be the top-most one in a cycle.

You can try the following workaround though:

  1. Remove one edge from the cycle such that the desired top-most node does not have an in-going edge.
  2. Run hierarchic layout.
  3. Re-insert the previously removed edge.
  4. Run hierarchic layout again, but this time turn on "Use Drawing As Sketch" on tab "General" of the hierarchic layout settings.

The last step should nicely integrate the re-inserted edge while keeping the existing order of nodes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.