[jgrapht-users] Find all path between two vertex
Brought to you by:
barak_naveh,
perfecthash
From: Thomas H. <ham...@pr...> - 2016-01-04 15:32:33
|
Hi, I´ve seen, that this kind of question has already been posted, but I haven´t found a real solution in the archives yet. So my problem is: I wonder, if there is a good way to find all possible paths between two vertexes. I´m currently working with a DefaultDirectedWeightedGraph and I can be sure, that I do not have more than 5 different vertexes. So there won´t be a too big complexity within this graph. The different edges between these vertexes are defined dynamically. So now I would like to find out all possible path between one source-vertex and a target-vertex, where both vertex can also be the same (like in the eulerian cycle). I tried to work with the „EulerianCircuit", but that doesn´t work, because I do not have a unidirectional graph. Using the „shortestPath"-algorithms (such as KShortestPaths) isn´t working for me as well, because I need ALL paths. I found this article (http://www.scielo.gpeari.mctes.pt/scielo.php?pid=S1645-99112009000200004&script=sci_arttext), dealing with this kind of a problem - but actually the pseudo-code isn´t really easy to understand for me. Maybe someone else already adopted this algorithm to JGraphT or might help me to translate this into a pseudo-jgrapht-code. I would be very thankful, if someone can point me in the right direction, about what to do best in my case. Thanks for your help |