
(source: yworks.com )
The simple hierarchical layout algorithm is a visualization of the ASAP scheduling algorithm (see this lecture [link] ), so it would be better to read it, in my opinion.
By the way, your picture is not entirely correct - the proposed visualization is only one of the possible ones.
Imagine that you have a list of nodes and you know the relationship between them.
List of nodes
node4 node2 node5 node1 node3 node6
Dependency list
node1 -> node2 node2 -> node4 node3 -> node5 node1 -> node3 node3 -> node6
This will only work for non-cyclic directed graphs. For non-oriented ones, you need to slightly change the algorithm (take a random node as root), but the main idea, I think, is understandable.
source share