[GraphHopper] Package private methods in AbstractBidirAlgo

Lars M lars.lmar at gmail.com
Mon May 19 09:16:12 UTC 2014


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20140519/0b669618/attachment.html>


More information about the GraphHopper mailing list