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

Peter K peathal at yahoo.de
Thu May 9 20:42:26 UTC 2013


Hi Zongjie,

> Thanks for the advice, but is it possible to simply extract the nodes'
details while the algo is running?

yes. this is possible. Have a look into the AStar code how e.g. the
latitude/longitude is read or into the normal Dijkstra:
https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/routing/Dijkstra.java

which is easier to understand and extend at the beginning. Where edge
properties are read via edgeIterator.distance() or edgeIterator.flags()


> I tried using the codes found on the links provided by you, however
there are many of them requiring
> imports which I do not have in the graphhopper snapshot I am having.
Is it possible if you can send me the latest snapshot here? Thanks a bunch!

If you switch to the master branch they should be there. Or use the jar
from our fresh maven repository:
https://oss.sonatype.org/content/groups/public/com/graphhopper/

The code is in the flux right now but should stabilize in two or three
month with releasing 0.1

Regards,
Peter.

> Hi Peter,
>
> Thanks for the advice, but is it possible to simply extract the nodes'
> details while the algo is running? like when its traversing the nodes
> to find the destination, I would like to be able to retrieve the
> details of each node it traverse in order for it to finally find the
> destination node.
>
> Best Regards,
> Zongjie Ng
>
>
> On Thu, May 9, 2013 at 6:49 PM, Peter K <peathal at yahoo.de
> <mailto:peathal at yahoo.de>> 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
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20130509/1371257f/attachment-0001.html>


More information about the GraphHopper mailing list