title: Find the number of paths that run through an edge between two vertex
body: <p>I have an algorithm to determine, in a DAG, the number of paths from each vertex to a specific vertex <strong>t</strong> (which has out-degree equal to 0). Now I choose other specific vertex <strong>s</strong> with 0 in-degree. I have to develop another algorithm to determine, for each edge <strong>(u, v)</strong>, the number of paths that run through <strong>(u, v)</strong> from <strong>s</strong> to <strong>t</strong> in O(|V|+|E|).</p>
  
  <p>I have tried to modify the BFS (since with a DFS I think is impossible to reach the solution) but if I have an edge with more than one paths, it doesn't work. Could you suggest me or give me a hint about how can I focus my work to get the solution?</p>
  
  <p>By the way, the problem is related to topological sort.</p>
  
  <p>Thanks so much in advance! :)</p>