graphp / algorithms

Common mathematical graph algorithms implemented in PHP
MIT License
136 stars 68 forks source link

Find all possible paths between two vertices on a graph #20

Open titomiguelcosta opened 8 years ago

titomiguelcosta commented 8 years ago

Is there a way to determine all possible paths between two vertices?

clue commented 8 years ago

determine all possible paths between two vertices?

PRs are welcome, I suppose :-)

Perhaps the following could be a good start for an implementation:

titomiguelcosta commented 8 years ago

@clue in the end, I followed this tutorial and ended up implementing a neat solution using a recursive sql query, something i wasn't even aware it existed

clue commented 8 years ago

I followed this tutorial and ended up implementing a neat solution using a recursive sql query

Nice find :+1: Perhaps you feel like sharing your results in case anybody else stumbles upon this ticket? :)

titomiguelcosta commented 8 years ago

@clue Sure. Check the source code on my repository and feel free to play with it on the project page. You can create new graphs using an xml document, check out the example. And query the graph for all graphs or just the shortest one using json, one example here. Any feedback is more than welcome.