How to get different paths with same start and same end in a digraph(directed graph)?

63 Views Asked by At

giving a digraph like this:

1 --> 2
1 --> 3
2 --> 4
2 --> 5
3 --> 6
4 --> 7
5 --> 7
5 --> 8
7 --> 9
8 --> 9
6 --> 9

It`s easy to see there are 3 circle-like in graph.

{[1,2,5,8,9], [1,3,6,9]}
{[2,4,7], [2,5,7]}
{[5,7,9], [5,8,9]}

It`s just what I want.Sometimes the digraph has 300 nodes and more, so need a effective algorithm.

0

There are 0 best solutions below