RIDE is a Python library designed to accelerate Dijkstra's algorithm on diverse graph structures using a hierarchical approach. This method involves solving problems on simplified graphs and subsequently combining solutions into a comprehensive result. The technique is rooted in graph partitioning, dividing the original graph into clusters. By leveraging this division, RIDE eliminates numerous suboptimal route constructions, achieving significant speedup without compromising accuracy. The library offers multiple-fold acceleration compared to traditional methods. Detailed information about the underlying methodology will be available in a forthcoming academic article, providing in-depth insights into the algorithm's mechanics and performance.
It is worth noting that this method works for both transport and abstract graphs.
Installing
to install via pip without listing on pypi do:
!pip install git+https://github.com/sb-ai-lab/Ride
to install via pip witр pypi do:
!pip install ride-pfa
Quick start
You can find Ride usage in GoogleColab
from ride_pfa import graph_osm_loader
import ride_pfa.path_finding as pfa
import ride_pfa.clustering as cls
from ride_pfa.centroid_graph import centroids_graph_builder as cgb
id = graph_osm_loader.osm_cities_example['Paris']
g = graph_osm_loader.get_graph(id)
cms_resolver = cls.LouvainCommunityResolver(resolution=1)
# Exact path , but need more memory
exact_algorithm = pfa.MinClusterDistanceBuilder().build_astar(g, cms_resolver)
# Suboptimal paths, with low memory consumption
cg = cgb.CentroidGraphBuilder().build(g, cms_resolver)
suboptimal_algorithm = pfa.ExtractionPfa(
g=g,
upper=pfa.Dijkstra(cg.g),
down=pfa.Dijkstra(g)
)
nodes = list(g.nodes())
s, t = nodes[0], nodes[1]
length, path = exact_algorithm.find_path(s, t)
How it works:
- Creation of a new graph based on centers of initial graph clusters
- Computation of shortes path on a new cluster-based graph (this contraction-hierarchy based approach is obviously faster hhan straight forward calcylation of shortest path, but less accurate)
- Comparison of obtained metric for error-speedup trade-off
Findings
Theoretical estimations and empirical calculations are compared through graphical representations. Figure 1 illustrates the correlation between the maximum acceleration γmax and the number of vertices N0 in the graph. Figure 3 depicts the relationship between the optimal value of the α* parameter and N0. Figure 2 demonstrates the dependence of γmax on graph density D, an unscaled characteristic, alongside theoretical estimations. This comparison considers the equality D=2β0/N0, where β0 represents the average degree of vertices. These visualizations provide insights into the algorithm's performance across various graph configurations, enabling a comprehensive understanding of its efficiency and scalability.
Developed algorithm was applied for 600 cities and the following dependencies were obtained:
License
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
Acknowledgments
For more information, check out our documentation.
In collaboration with
Metadata
Release files for ride_pfa 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ride_pfa-0.1.2.tar.gz | 17.6 kB | Without provenance | Details for ride_pfa-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ride_pfa-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for ride_pfa-0.1.2-py3-none-any.whl |
Total release size: 39.3 kB
Release files / ride_pfa-0.1.2.tar.gz
| Download URL | ride_pfa-0.1.2.tar.gz |
|---|---|
| Size | 17.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20d12084998802270d4285c1f7ea127c89a1b466876f304225c56c4a38cf1e5d
|
|
BLAKE2b-256 checksum How to use checksums |
fe0088eb69c74ecc1d0710b5694ec5ba49c25284feea376a48877a4cf07918b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.12.8 Windows/11
|
Release files / ride_pfa-0.1.2-py3-none-any.whl
| Download URL | ride_pfa-0.1.2-py3-none-any.whl |
|---|---|
| Size | 21.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b0dca35ae12d64f6306830322364bfa021866482da9d8abd6376acf62e792666
|
|
BLAKE2b-256 checksum How to use checksums |
7f8d7edb5f8ce21e26eb9c7afd0391056c692f8fdec907327a8cd73190b79cc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.12.8 Windows/11
|
Security for ride_pfa 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.