[GraphHopper] Graphhopper using dijkstra's algo directly with graph

Peter K peathal at yahoo.de
Thu May 9 11:47:30 UTC 2013


Hi Quinton,

yes this is possible. You can even determine the detour per POI (and
e.g. sort by it). But with contraction hierarchies things get inflexible
and you'll have to calculate all the involved paths (and the more POIs
you accept the more paths you'll have). Which is can be still very fast
on a server as you need to calculate the shortest path tree per
point/POI only once. But this is probably too slow on a mobile device
(if offline) ... we'll see :)

Regards,
Peter.

> Hi Peter,
>
> So I have a case where I would like to manipulate the routing algorithm through the introduction of POIs. I would like to force that even shortest routes go via POIs that are within a given distance of the ideal route, even with contraction hierarchies. 
>
> Any thoughts? 
>
> On 09 May 2013, at 9:09 PM, Peter K wrote:
>
>> Hi Quinton,
>>
>> you will be able to import POIs into graphhopper. Then you'll be able to
>> do something like
>> List<Path> resultingPaths = graphhopper.route(fromLocation, "restaurant");
>> to get a list of paths sorted by distance or time.
>>
>> For the faster algorithm however (currently contraction hierarchies) one
>> needs to specify the location of the POIs explicitly.
>>
>> Regards,
>> Peter.
>>
>>> Hi Peter,
>>>
>>> Search for the points and route via those points? 
>>>
>>> Thanks. 
>>> On 09 May 2013, at 8:49 PM, Peter K wrote:
>>>
>>>> [forwarded to mailing list]
>>>>
>>>> Hi Zongjie,
>>>>
>>>> have a look into the low level API:
>>>> https://github.com/graphhopper/graphhopper/wiki/Low-Level-API
>>>>
>>>> and the relative efficient one-to-many dijkstra:
>>>> https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/routing/DijkstraOneToMany.java
>>>> where the distance limit is already implemented ('limit')
>>>>
>>>> In the near future one will be able to search for points of interests in
>>>> a certain radius, which will be probably similar to what you want.
>>>>
>>>> Regards,
>>>> Peter.
>>>>
>>>>> Hi Peter,
>>>>>
>>>>> I have been using your graphhopper api for my final year project and
>>>>> it has been great! However, I need to make some changes to my project
>>>>> which I would like to request for your help.
>>>>>
>>>>> I know that graphhopper is providing routing capabilities through
>>>>> reading of the graph of a map and using the various algorithms to
>>>>> return an array of geopoints of the calculated path.
>>>>>
>>>>> What I would need your help on is may I know if i can directly access
>>>>> the graph and apply the dijkstra's algorithm on it? Because what I
>>>>> actually need is geopoints that are of a certain distance away from
>>>>> the current location.
>>>>>
>>>>> For example: I am at point A, and I request for the road distance of
>>>>> 5KM away from point A.
>>>>>
>>>>> I was thinking that by using the dijkstra's algo I would be able to
>>>>> traverse through the nodes of the graph till I find all the 5KM nodes
>>>>> that are away from the current location's node.
>>>>>
>>>>> Currently I am using your graphhopper API to get the distance and
>>>>> geopoints that are of fixed angles from the current location. Let's
>>>>> say 0 degrees, 90 degrees, 180 degrees and 270 degrees. So I will get
>>>>> 4 routes using your API which I will then access the individual route
>>>>> to find the 5KM geopoints I required to get my 5KM points away from
>>>>> the current location.
>>>>>
>>>>> Is there any way I can use your dijkstra's algo and access the graph
>>>>> directly which then can provide me with the distance and geopoints of
>>>>> each node it traversed using the algo. I believe with this, I would be
>>>>> able to get all the geopoints that are of certain distance away from
>>>>> the current location more effectively and efficiently!
>>>>>
>>>>> Thank you for taking your time to read this and I hope to receive your
>>>>> kind response soon!
>>>>>
>>>>> Best Regards,
>>>>> Zongjie Ng




More information about the GraphHopper mailing list