Given a directed unweighted graph and a set of nodes N, I have to find all the paths of length at most L passing thru all the nodes. Since I am not enforcing each node to be visited only once, you can also call this a walk on the graph.
There are a few problems that can appear related but which did not lead me to any significant progress:
- Shortest path: the shortest path is not a satisfactory solution since I would like to get all the paths.
- Steiner tree: in my specific case, due to the graph structure and the properties of the node I need to cover, this will boil down to be the shortest path, but still not solve my problem.
- Hamiltonian path: this has the additional restriction to visit each vertex exactly once, which is not a property I care about and make the problem much harder.
- Random walk on the graph: one can image taking a random walk on the graph until the conditions are met but this can be very slow and I would consider that part of the brute force approach. A better heuristic is to compute random spanning trees and then extract the path from there but it does not seem particularly smart as a solution.
I wonder if this is a known problem and there is an algorithm that is not the good old brute force strategy (which I am already doing).
UPDATE: I kept researching and looks like my problem is a more general version of the path enumeration that you can see discusses here. The main difference is that I don't need to count all the paths between a pair of nodes (i,j) but for a larger set of nodes and each path has to pass thru all the nodes.
I would appreciate suggestions on algorithms for this because I don't have much knowledge on the topic.