Counting roundtrip paths in a graph given a number of steps
Aug 2, 2015
This problem appeared in a SO question
asking for help converting a recursive \( O(N^k) \) solution into a bottom-up
dynamic programming one \( O(kN^2) \) where k is the number of allowed steps
and N is the number of nodes in a graph.
As noted on the post given a sample graph
and setting \( k = 5 \) yields a total of 6 possible roundtrip paths from the origin
node