Wolfram Technology Guide: Fully Automated Graph Layout  previous | next 
Automatic Flowcharting
Automatically lay out flowcharts, here the call graph of a function with a nested recursive definition.
In[1]:=

Click for copyable input
LayeredGraphPlot[

 Flatten[Thread /@ 

   Last[Reap[

     Module[{f}, f[n_ /; n < 7] = 1; 

      f[n_] := f[n] = f[Sow[n - 7, n]] + f[Sow[n - 6, n]]; f[40]], _, 

     Rule]]], VertexLabeling -> True]
Out[1]=