I\'ve got a numeric pyramid like this
7 4 8 1 8 9 2 4 6 7 4 6 7 4 9 4 9 7 3 8 8 routes: 32
every number indexed by
as you can Consider the tree a DAG Do a Topological sort then relax(relax to the max not min) each edge as they are in the topological sort O(E+V) .