I often use

FindPath[G, 1, 2, {L}, All]

where $G$ is some graph. This finds all paths of length exactly $L$ edges which run between nodes $1$ and $2$.

In large graphs this is very slow.

One solution is to (I think) use Depth-Limited-Search starting at node $1$, of depth $L$.

I there an efficient way of doing this in Mathematica?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.