SQLite Forum

Recursive query to find the shortest path
Login
So, is there no clean way to find the shortest path more reliably than by setting a high enough limit in the recursive query and hoping for the best?  I found a 12-step shortest path between two places using 500000 as the limit (takes about 10 seconds to run), and the previous best was a 10-step solution that about 1000 miles longer when I set the limit at 250000.  I really don't want to just experiment with the limit when I know that the correct way to find the shortest path is to prune branches based on what I have already found.  Thank you.