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

Can you calculate a distance matrix between point patterns without calculating all vertex distance pairs? #725

Open
iboates opened this issue May 20, 2023 · 1 comment

Comments

@iboates
Copy link

iboates commented May 20, 2023

I am struggling with some performance issues when calling Network. allneighbordistances between my source and destination point patterns.

When I looked into the code, it seems to me that the first thing this method does is calculate all the vertex distance pairs in the entire network with Network.full_distance_matrix

Is there a way to only compute the network distances between the source and destination point patterns without computing all vertex pair distances? Maybe I am not getting it but it seems wasteful to do all vertex pairs first when I already know the distances of every line feature from the geodataframe from which I initialized the network.

For reference I am using spaghetti in tandem with spopt to optimize the placement of facilities, mostly by following (but modifying) this tutorial: https://pysal.org/spopt/notebooks/mclp.html

@jGaboardi
Copy link
Member

No, this is not currently possible due to the historic structure of pysal.network (spaghetti's predecessor) and the utilization of the djikstra algorithm). There has been discussion12 for overhauling & modernizing spaghetti for some years now, but there has been little action due to time constraints. And as usual, since this is an OS project maintained in our free time contributions are always welcome!

Footnotes

  1. https://github.com/pysal/spaghetti/discussions/195

  2. https://github.com/pysal/spaghetti/discussions/403

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