Auto layout nodes

I have been using Crtl + L to auto-layout my nodes. Sometimes it works fine, sometimes it mixes all up my patch. So I was wondering how this works internally and if we could improve it?

Some theory:
Most patches are constructed as hirarchical graph. Input top, output buttom. There are several algorithms to auto layout hirarchical graphs. They all try to layout a graph in a way that follows “aesthetic” rules so that humans find the patch easy to read. For example, it will try to find the hirarchical levels of the patch and place each node on the optimal level. They also try to avoid line crossings - it will move nodes in order to not have connections crossing each other.

Some tools:
Graphviz is one of the most know tools and open source.
yEd is great as well but expensive. Another good overview is here:

Does this really help?
If I open patches from other people I often would love to press the magical “autolayout” buttom to have the patch structured correctly. On the other hand: If the complete patch gets restructured you will lose comments that are placed next to specific nodes. But still: There is already an auto layout method in vvvv, so why not improving it? It is not super critical, of course, just an idea.

What do you think?

Well, how it works is pretty easy, since all CTRL-L does is to align the selected nodes horizontally or vertically, depending on which distance is bigger (I guess).

An auto-layout feature (by whatever method) could possibly be applied to groups of nodes, maybe, but in general I don’t think a full auto-mode can improve the overall readability and ease of understanding a patch. An example from right in front of me:

Here the 2 switches let me simulate what happens when a Kinect loses the skeleton inofrmation. They are doing the exact same thing, only for different purposes. Now, an algorithm would place them on the same level, moving the ‘Mean’… where? Up, breaking the horizontal line of in/outputs? Under the Skeleton node, breaking the visual flow of its outputs?

However, maybe you want to have a look at this: http://www.creativeapplications.net/theory/patch-schematics-%E2%80%93-the-aesthetics-of-constraint-best-practices-theory/ , a nice little read on Patch Schematics (in vvvv)