[Solved] Shortest path using php [closed]

As Mark Baker pointed out, you’ll need to use something like Dijkstra’s algorithm to traverse a weighted graph (which is what you’ll have when you include distances). Here’s a simple distance function I found here: <?php /*::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/ /*:: :*/ /*:: This routine calculates the distance between two points (given the :*/ /*:: latitude/longitude of those … Read more

[Solved] How to get a road path which can be travelled in 10 minutes from a location

pgr_drivingDistance uses the cost value you provide, and in the units you implicitly specify, meaning that when you add a column <traveling_time> (note that I use seconds in my example) as the time needed to traverse an edge (given the length and speed limit) and select that as cost, the functions result will represent the … Read more

[Solved] Shortest path on 4×4 grid c++

As you have already pointed out yourself in the comments, the shortest path from (0,2) to (3,1) is “right 3 down 1” in other words: right 3-0=3 and down 2-1=1 And that’s already pretty much the answer… In general, how do find the shortest path from (xStart, yStart) to (xEnd, yEnd)? You just do the … Read more