Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to get all nodes in a radius #5

Open
Eh2406 opened this issue Jun 28, 2019 · 7 comments
Open

Add a way to get all nodes in a radius #5

Eh2406 opened this issue Jun 28, 2019 · 7 comments

Comments

@Eh2406
Copy link
Contributor

Eh2406 commented Jun 28, 2019

My main use of this algorithm is in pandana ware the common need is to for each knode, calculate summary statistics about all the nodes that are within a thresholded.

@easbar
Copy link
Owner

easbar commented Jun 28, 2019

Starting from some node p you want to find all nodes q such that the weight of the shortest path p->q is less than some threshold ?

@Eh2406
Copy link
Contributor Author

Eh2406 commented Jun 28, 2019

Yes. That is what I had in mind.

@Eh2406
Copy link
Contributor Author

Eh2406 commented Jun 28, 2019

Now that I think about it we could have an iterator that returns q's sorted by the shortest path p->q. If you want a k nearest: iterator.take(k). If you want all in a range iterator.take_while(|p| p->q < range).

If you have some pointers I may be able to give this a try.

@easbar
Copy link
Owner

easbar commented Jun 28, 2019

Ok yes the trivial way of doing this is calculating all paths p->q, then sorting by distance and taking only those up to some limit. Do you think this should be included here (it can easily be done using the existing API) ?

This can also be done more efficiently, but currently this is not supported. Btw in the context of routing networks this is sometimes called isochrone calculation.

@Eh2406
Copy link
Contributor Author

Eh2406 commented Jun 28, 2019

Only when it can be done more efficiently than the alternatives. Do Contraction Hierarchies help make it more efficient than a Dijkstra's on an unprepared Graph? If so then yes it should be here. If not then I need talk to the pandana team about why they do it this way. :-P

@easbar
Copy link
Owner

easbar commented Jun 28, 2019

Yes it can be more efficient. Even the trivial way we lined out above might be faster (on small maps at least).

why they do it this way

You mean they are doing this already ? How would implementing it here help with Pandana ?

@Eh2406
Copy link
Contributor Author

Eh2406 commented Jun 28, 2019

It is a C++ python Library, it has in the past caused our entire model to segfault. I spent today trying to diagnose a regression in performance, our model is now taking an additional 16 hours to run. As someone who doesn't know C++... let's just say I would like the rust alternatives to be as ready to be a drop-in replacement as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants