title: how to determine maximum route cost in a n high numeric pyramid
body: <p>I've got a numeric pyramid like this</p>
  
  <pre><code>       7
        4 8
       1 8 9
      2 4 6 7
     4 6 7 4 9
    4 9 7 3 8 8
  
  routes: 32
  </code></pre>
  
  <p>every number indexed by how powerful in its line.</p>
  
  <pre><code> 0 ( 9 =&gt; 1 ) 1 ( 8 =&gt; 5 ) 2 ( 8 =&gt; 4 ) 3 ( 7 =&gt; 2 ) 4 ( 4 =&gt; 0 ) 5 ( 3 =&gt; 3 )
   0 ( 9 =&gt; 4 ) 1 ( 7 =&gt; 2 ) 2 ( 6 =&gt; 1 ) 3 ( 4 =&gt; 3 ) 4 ( 4 =&gt; 0 )
   0 ( 7 =&gt; 3 ) 1 ( 6 =&gt; 2 ) 2 ( 4 =&gt; 1 ) 3 ( 2 =&gt; 0 )
   0 ( 9 =&gt; 2 ) 1 ( 8 =&gt; 1 ) 2 ( 1 =&gt; 0 )
   0 ( 8 =&gt; 1 ) 1 ( 4 =&gt; 0 )
   0 ( 7 =&gt; 0 )
  </code></pre>
  
  <p>in this pyramid there are 2^(n-1) routes (you can go 2 way form each number)
  If the pyramid high this low, it's easy you can calculate all the routes, and compare to eachother. But if you have an 50 high pyramid with 562949953421312 routes, the problem little bit more difficult.</p>
  
  <p>I thoght I start from the bottom beginning from the most powerful numbers, but soon i realized, the max route cost ain't necesserly start or end up in big numbers.</p>
  
  <p>Then I thought maybe secoundary indexes (where can you go futher from a number) will help, but I didin't even implement that becouse I assumed its still uses much resources and not optimal.</p>
  
  <p>And now i'm confused how to restart thinking about this problem... any advice appreciated</p>