A path is simple if no vertices are repeated. How many simple paths exist between two vertices in a complete graph?
One way is listing all simple paths using depth-first search. but I think it should be more simple to find the number of all simple paths between 2 nodes in a complete graph.
Here is the same problem but mine is for a complete graph: Algorithm that finds the number of simple paths from $s$ to $t$ in $G$
$countPathBetween2vertices=countOfAllpathInClique(n-2)+2*(n-1)-1$
because we can assume we have a (n-2)clique + 2 other vertices. so after we computed the all path of (n-2)clique we should add 2*(n-1) new edge and one of them is not new.
I'm not sure about the correctness of this.
– Ali Sep 01 '14 at 06:35