mercredi 6 mars 2019

Ideal algorithm for finding all paths from a given node to any possible node

Say we have a given number of vertices and edges. We can easily fin all paths between any two nodes but what if I wanted to find all possible paths that started from the first node and can terminate at any given node.

Eg. 1->2->3->4 and also 1->3 then all possible paths we can take from 1 can be (1),(1,2),(1,2,3),(1,2,3,4),(1,3,4),(1,3)

Aucun commentaire:

Enregistrer un commentaire