-1

I need to find all positive paths in a graph, but the shortest path algorithm only finds 1 best path. So I have to update the matrix and solve the model again. Is there any way to display all paths when path value is greater than 0.

I will also mention that I use docplex to solve my problem and it works well. But when I have to loop my matrix updation and solve it again and again with 2000 different variables it took about 10min to find all the ways. And it is really long.

Alex
  • 1
  • 2
    Just use DFS and record all the paths. Note however that the number of path can be exponential in the size of the graph. – n. m. could be an AI Aug 27 '23 at 17:10
  • 1
    acyclic? directed or undirected? from one node or from a particular node or between a specific pairs of nodes? – Dave Aug 27 '23 at 17:27

0 Answers0