Skip to main content

No project description provided

Project description

Your Banner

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.

Telergam support

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

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:

  1. Creation of a new graph based on centers of initial graph clusters

Clustering

  1. 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)

Subgraph_path

  1. Comparison of obtained metric for error-speedup trade-off

Subgraph_path

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:

Your Banner1 Your Banner2 Your Banner3

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

Your Banner

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ride_pfa-0.1.1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ride_pfa-0.1.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file ride_pfa-0.1.1.tar.gz.

File metadata

  • Download URL: ride_pfa-0.1.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.8 Windows/11

File hashes

Hashes for ride_pfa-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e3ee6c00e00bc763d2726a1ad0b25b5242dd3a4539afc893217903e3c7663a08
MD5 0f6ba5b8371f8734c4f4b5707d4c3694
BLAKE2b-256 f7c4de147f3b3d1c45263b3f68c0ddb06232a108df8eb37731a4e7f4d5ad356d

See more details on using hashes here.

File details

Details for the file ride_pfa-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ride_pfa-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.8 Windows/11

File hashes

Hashes for ride_pfa-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de8d442b836ace3b0708ad57147b3cf04f74050c34c0d0f642d90414ffdb9e50
MD5 d9fa5e241ae0cca5d5052bca938b6dea
BLAKE2b-256 9c481cecf47116b532500c41b2135004b888fffc1035eb2fdd01ec093ec6f5bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page