Small, but extensible, pathfinding library
Project description
PyPaths is a small library useful for computing paths across simple in-memory graphs. Try it out by installing with pip:
> pip install pypaths
Or, alternatively, install from source:
> git clone https://github.com/jonathanhood/pypaths.git > cd pypaths > python setup.py install
For the simplest default case, usage is very simple:
from pypaths import astar
finder = astar.pathfinder()
print finder( (0,0), (2,2) )
We can also provide some parameters to help the algoriths understand your specific graph:
from pypaths import astar
finder = astar.pathfinder(
distance=my_distance_function, # Calculate the absolute distance between two nodes
cost=my_cost_function, # Calculate the heuristic cost between nodes
neighbors=my_neighbors_function) # Calculate the list of neighbors for a given node
print finder( "MY NODE 1", "MY NODE 3" )
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pypaths-0.1.2.tar.gz
(3.1 kB
view details)
File details
Details for the file pypaths-0.1.2.tar.gz
.
File metadata
- Download URL: pypaths-0.1.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18b30c92b09f1181ad6a97c57796e16f74afcfa2556c06870212c68aec387af7 |
|
MD5 | facb45bbedb55c85f16454cbb060efcf |
|
BLAKE2b-256 | 63a9a154407906f0086385519c8cddaa9bad371f3b802ea2bb43939aa78b22b6 |