0

I have a list of paths (unidentified paths, that is, I do not know all the paths beforehand) A ->B-> C-D, A -> A-> B-> C,A->B-> C->B->C ->D

I need to get all different paths which user use to get from A ->D Under this condition, A->B->C ->D and using backforth/loops like A->B-> C->B->C ->D will qualify as one path.

This seems like a common algorithm or pattern recognition. My only caveat is I don't know the different paths/nodes beforehand (the number of nodes is finite though).

Has someone seen similar use case or can give pointers on how to proceed with it?

kundan kanan
  • 91
  • 1
  • 2
  • Is it significant that sometimes your "arrows" (`->`) have spaces before them, sometimes after them and sometimes neither? What programming language are you targeting? Your question, as it is, asks of those people that have **not seen such use cases** to come up with pointers (because of your use of *or*. It is more likely that ones who have seen use cases can provide pointers. IMO it is better to ask how can I implement this in XYZ, or better still show your code, and indicate what goes wrong. – Anthon Mar 31 '15 at 06:42
  • No, it is not significant. I am targetting to simplify this using scala and Apache spark. I will include tag for scala. – kundan kanan Mar 31 '15 at 07:25
  • Would Dijkstras algorithm work? – Ritwik Bose Mar 31 '15 at 17:53

0 Answers0