Input : Pairs of From->To Rows.
From To
1 2
2 3
3 4
6 7
Output: For Each From Value, pairs of reachable To values. E.g. for 1
Source Reachable
1 2
1 3
1 4
Obviously, one can suck out the data to a Graph structure and run DFS scan.
Is there a alternative way to do so, such that:
- Uses SQL/Functional Style instead of imperative programming?
- Fast enough for 10 million rows. (Current graph approach in C#/SSIS runs in ~2 hrs)