[GraphHopper] Package private methods in AbstractBidirAlgo

Lars M lars.lmar at gmail.com
Mon May 19 12:05:14 UTC 2014


Hey Peter,

I had it tested with the graph from the germany extract from geofabrik. The
~1000 points are scattered all over germany.
But don't put too much weight into my numbers, I didn't write them down so
they may be off.

Best regards,
Lars


On Mon, May 19, 2014 at 11:40 AM, Peter K <peathal at yahoo.de> wrote:

>  Hey Lars,
>
> your use case is nice to hear :) as we primarily opened up those methods
> from 'private' to 'package protected' to serve the needs of our GraphHopper
> matrix Add-on which does exactly that what you are looking for (but is
> currently not Open Source). It indeed reduces 1000*1000 normal route
> calculations by a factor of 10 (even ~40 faster is possible but also more
> complex and not yet done).
>
>
> > by setting "instruction" and "calcPoints" to false, so maybe it only
> takes 15 minutes now.
>
> Nice to hear your numbers: either you have a very fast machine or a small
> area :). For what area (in km^2) did you measure this?
>
>
>
> > I guess for a better solution one would have to do some major
> refactorings.
>
> No major refactoring is necessary, you should only need to put your class
> under com.graphhopper.routing (although not recommended as we can break the
> API!). In the next version, when we are more confident of the necessary
> methods, we'll probably make them accessible to everyone.
>
> Regards,
> Peter.
>
>   Hey Peter,
>
>  I have an application where I have to calculate the road distance
> between a
> number of points, let's say a thousand. Right now I'm doing 1000*1000 point
> to point queries (with CH) to calculate that distance matrix. This takes
> about
> 30 minutes, even though I recently found out that you can accelerate this
> by setting "instruction" and "calcPoints" to false, so maybe it only takes
> 15 minutes now.
>
>  Anyways, in
> http://algo2.iti.kit.edu/documents/routeplanning/geisberger_dipl.pdf
>  section 4.1 is described how you can implement a many to many routing by
> doing
> 1000 forward searches and 1000 backward searches but omitting the abort
> criterion.
> Most of the code to do that is already there you just have to get rid of
> the abort
> criterion in "dijkstrabiCH":
>   return currFrom.weight >= bestPath.getWeight() && currTo.weight >=
> bestPath.getWeight();
> and make bestWeightMapFrom and bestWeightMapTo in DijkstraBidirectionRef
> accessible.
>
>  Unfortunately, "dijkstrabiCH" is an anonymous class inside of
> PrepareContractionHierarchies.createAlgo(). So for my preliminary tests I
> just
> ripped lots of code out of PrepareContractionHierarchies and
> DijkstraBidirectionRef.
> That's obviously not a good long-term solution. I guess for a better
> solution one
> would have to do some major refactorings.
>
>  So, that's my motivation. Any comments? :)
>
>  Best regards,
> Lars
>
>
> On Mon, May 19, 2014 at 8:15 AM, Peter K <peathal at yahoo.de> wrote:
>
>> Hey Lars,
>>
>> the reason is simple: no one (except our own classes) should use those
>> methods, so that we can break this API at any time we want. Which
>> methods you need and why?
>>
>> Regards,
>> Peter.
>>
>> > Hey there,
>> >
>> > is there a reason why there are methods and fields in
>> > AbstractBidirAlgo that have default visibility (package private)?
>> > Now you can't inherit from AbstractBidirAlgo if the inheriting class
>> > resides in different package than  com.graphhopper.routing.
>> >
>> > Best regards,
>> > Lars
>> >
>>
>>
>>  _______________________________________________
>> GraphHopper mailing list
>> GraphHopper at openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/graphhopper
>>
>
>
>
> _______________________________________________
> GraphHopper mailing listGraphHopper at openstreetmap.orghttps://lists.openstreetmap.org/listinfo/graphhopper
>
>
>
> --
> GraphHopper.com - Fast & Flexible Road Routing
>
>
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/graphhopper
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20140519/efb2621c/attachment.html>


More information about the GraphHopper mailing list