New answers tagged

0

This is a way using RelationGraph (essentially implementing MikeLimaOscar's approach) but not as nicely or efficiently. fun[x__] := If[Last[x] <= 1, {}, {{x, Append[x, Last@x - 1]}, {x, Append[x, Last@x - 2]}}] lab[n_] := "fib[" <> ToString[Last@n] <> "]"; rec[n_] := Module[{gd = Catenate@NestList[Last /@ Flatten[fun /@ #, 1] &...


4

Since each vertex has to be named uniquely, for example with its path through the tree, it is simply a case of using the end of the path in a custom VertexRenderingFunction. One way of generating the edge list: f[___, 0] = {}; f[___, 1] = {}; f[m___, n_] := {{m, n} -> {m, n, n - 1}, {m, n} -> {m, n, n - 2}, f[m, n, n - 1], f[m, n, n - 2]} Then ...



Top 50 recent answers are included