I have a directed graph that can have cycles and has weighted edges.
I'm having a tough time finding all the different paths you can take from a source node S with a distance less than X (sum of edge weights).
Let's say my graph has a single node "C" which has an edge pointing to itself with a weight of 3. Let's also say that I want all paths with a distance less than 20.
Then my result should be:
- C->C (Weight: 3)
- C->C->C (Weight: 6)
- C->C->C->C (Weight: 9)
- C->C->C->C->C (Weight: 12)
- C->C->C->C->C->C (Weight: 15)
- C->C->C->C->C->C->C (Weight: 18)
Obviously, in the real scenario I have more than a single node. I'm just trying to illustrate the problem I'm trying to solve.
I'm using an adjacency list as my underlying graph data structure (in C#)
You don't have to show me the code, but it would be nice. Most importantly, please guide me in the right direction.