Hi Mattias,
Yes I did encounter an actual example where findSinglePath doesn't seem to return the shortest path. In fact it returns a path of length 4 with maxDepth = 4, and of length 3 with maxDepth = 3.
I have a graph of Wikipedia pages and their links. Recreating it is a bit involved because you need a Wikipedia dump to start with, but my code is on
GitHub.
Here's what I see (using Groovy just for its interactive shell)
groovy:000> println graphipedia.findPath("Microsoft", "Hotels.com", 4).join(" --> ")
Microsoft --> Windows 7 --> Steven Sinofsky --> Cornell University --> Hotels.com
groovy:000> println graphipedia.findPath("Microsoft", "Hotels.com", 3).join(" --> ")
Microsoft --> Human Rights Campaign --> Cornell University --> Hotels.com
groovy:000> graphipedia.findShortestPaths("Microsoft", "Hotels.com", 4).each { path -> println path.join(" --> ") }
Microsoft --> Bill Gates --> Cornell University --> Hotels.com
Microsoft --> Human Rights Campaign --> Cornell University --> Hotels.com
In
GraphipediaService findPath calls findSinglePath and findShortestPaths calls findAllPaths.
Thanks
Mirko