title: How to compute the critical path of a directional acyclic graph?
body: <p>What is the best (regarding performance) way to compute the critical path of a directional acyclic graph when the nodes of the graph have weight?</p>
  
  <p>For example, if I have the following structure:</p>
  
  <pre><code>            Node A (weight 3)
                 /            \
       Node B (weight 4)      Node D (weight 7)
       /               \
  Node E (weight 2)   Node F (weight 3)
  </code></pre>
  
  <p>The critical path should be A->B->F (total weight: 10)</p>