3
donuts
5y

I had a problem visualizing giant job/schedule dependencies trees a few years ago and basically wrote a program to convert the dependencies so it could be read in by a JS graph program that actually did the work. The output was a Gantt chart but really messed up, overlapping arrows, not very readable.

Today someone asked me for my app and but in a better format/visualization.

I so I was thinking how do I do this... Figure out which nodes are leaves, how to combine visually.

Programmatically you just link all the Nodes together. So I was thinking like how u need to use BFS and Mark when each more is traverse and on its first traversal, add it to a Map<Depth,List<Node>> then print each level, etc.

But not so straight forward.... But finally realized that I'm not trying to draw a Tree (or a tree where the rootams are actually in the middle and the top n bottom are leaves)... But actually a Graph.... A DAG....

SO FINALLY I googled and found GraphViz...
https://graphviz.gitlab.io/gallery/

And in the gallery I opened some pictures and printed at the bottom was like 1996...

And I'm now wondering "how the fuck did they do this?" Calculate where all the vertices should be placed so they can be linked with lines and and not look like a big mess...I guess like a yarnball

Comments
  • 4
    Math

    Like in meth math but instead of nibbling faces printing pretty nodes.

    https://www.graphviz.org/theory/

    If u feel thirsty for good old dry knowledge
  • 0
    Before reading @IntrusionCM 's link, my guess is traversing the graph and creating a map in order of traversal
  • 2
    @yellow-dog Half right.

    But the actual complexity stems from the necessity to eg draw the nodes without overlapping each other, calculation of positions of the nodes and so on.

    It seems trivial, but it is astonishing when you take an indepth look at it.
Add Comment