I'm given a graph which can have more than one arch between 2 nodes.
Example :
4 nodes 1->2 2->3 3->4 3->4 1->4
Which is the optim way to find the number of the roads from node A to node B ?
The answer for the example is 3 : 1->2->3->4 ; 1->2->3->4 and 1->4
Limit for nodes and archs are 1 000 000
I'm only thinking at a brute force algorithm.
Any other ideas? Edit:
graph is acyclic