Pathfinder module

class Pathfinder.Pathfinder(graph, invalid_points)

Bases: object

This class is used to find path between two points

Attributes
ggraph (networkx)

The graph from Voronoi.py

invalid_pointsList of Points

Points that paths can’t go through

Methods

dist(a, b)

Heuristic method for the astar_path method in find_path method

find_path(origin, target)

Given an origin find the shortest path to target

path_distance

static dist(a, b)

Heuristic method for the astar_path method in find_path method

Parameters
aPoint

First node

bPoint

Second node

Returns
float

simple distance between a and b

find_path(origin, target)

Given an origin find the shortest path to target

Parameters
originPoint

The first point in the path

targetPoint

The last point in the path

Returns
List of Points

The path from origin to target

static path_distance(path)