Skip to main content

fast pathfinding lib

Project description

RIDE

Your Banner

The RIDE is a python library for accelerating Deikstra task on any graphs with hierarchical method involving solving a problem on simpler graphs with further combining solutions into a common one. The method is based on the division of the graph into clusters. By using this division, you can eliminate many sub optimal route constructions and achieve multiple-time acceleration without significant loss of accuracy. More information about method ine can find soon in corresponding article.

It is worth noting that this method works for both transport and abstract graphs.

Telergam support

Installing

to install via pip without listing on pipy do:

!pip install git+https://github.com/sb-ai-lab/Ride

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

The relationship between theoretical estimations and empirical cal- culations. Figure 1,3 – the relationship between the maximum of acceleration γmax and the number of vertices N0 in the graph. the relationship between the optimal value of the α∗parameter and the number of vertices N0. Figure 2 – the dependence of the maximum acceleration γmax on the graph density D (unscaled characteristic) along with the theoretical estimations, considering the equality given by D=2β0/N0.

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.0.tar.gz (14.2 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.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ride_pfa-0.1.0.tar.gz
  • Upload date:
  • Size: 14.2 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.0.tar.gz
Algorithm Hash digest
SHA256 50475177edbccb41dec67e00bf2f0af0fadc90e6b3f9f60f35c7da95d5bedc20
MD5 829fb3996e83e46d2358f762e7cc12ae
BLAKE2b-256 c5e44754459bc4b4e8802cdbbae646763b10e51a7ad715fd6b84baf67350cb48

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ride_pfa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd8c831bac09d0853f0b86d5cb1ab8b6b29f62bec5e08d7566b6b511cd923be9
MD5 c3dda59b0dd2efa521ac06b921f01f4f
BLAKE2b-256 566541ea965c1622917fc29bb38f2f2249b8918ecd50710c7a13f30c4d273d38

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