I am creating a function in Ruby to list all the possible paths that a business process may be executed. Look at the diagram below that represents a sample process:
I want the output to be like:
[
[[Task 1],[Task 2], [Task 4], [Task 6]],
[[Task 1],[Task 3],[Task 5],[Task 6]]
]
So, I created a method to represent it as an adjacency matrix. It works just fine.
Now I want to work on an algorithm to extract all those paths. I was gonna implement the DFS, but I'm not so sure anymore if this is the right way to approach it since I'm not doing an actual search - I am only listing the paths.