Download the PHP package letournel/path-finder without Composer
On this page you can find all versions of the php package letournel/path-finder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download letournel/path-finder
More information about letournel/path-finder
Files in letournel/path-finder
Informations about the package path-finder
PathFinder - The best route is the shortest
PathFinder is a standalone library aiming to implement famous path and route finding algorithms in PHP to solve classical problems such as:
Features
-
SSP solving algorithms: AStar, Dijkstra, FloydWarshall
- TSP solving algorithms: NearestNeighbour, 2Opt, 3Opt
Roadmap
-
New SSP solving algorithms: Kruskal MooreBellmanFord Prim or others
-
New TSP solving algorithms: Christofides, kOpt, LinKernighan or others
-
Speed optimisations
- Open to suggestions and contributions
Classes
Core Classes
- Heuristic: A distance with a floating weight.
- Node: A node entity used in NodeGrid, NodeGraph, NodeMap or NodePath which is basically a couple of coordinates (x, y) or indices (i,j)
- NodeGraph: A graph is a set of vertices connected by edges. Here, vertices are nodes and any couple of them can be connected by an edge with a floating value. By default, the graph is symmetric so the edge from vertex A to vertex B and vice versa have the same value.
-
NodeGrid: Simply a matrix of Nodes with coordinates (x, y) or indices (i,j) using the following pattern:
- NodeMap: A map or dictionary which maps a Node (as key) to an object (as value) which can be a Node, boolean, ...
- NodePath: A linked list of successive Nodes which forms a path
Algorithms Classes
- ShortestDistance\Dijkstra: Compute shortest distance with Dijkstra algorithm
- ShortestDistance\FloydWarshall: Compute shortest distance with FloydWarshall algorithm
- ShortestPath\AStar: Compute shortest path with AStar algorithm
- ShortestPath\Dijkstra: Compute shortest path with Dijkstra algorithm
- TravelingSalesman\NearestNeighbour: Compute shortest tour with NearestNeighbour algorithm
- TravelingSalesman\ThreeOpt: Improve shortest tour with ThreeOpt algorithm
- TravelingSalesman\TwoOpt: Improve shortest tour with TwoOpt algorithm
Converters Classes
- Grid\ASCIISyntax: Allow converting map with an ASCII syntax to NodeMap, NodePath, Node Objects back and forth
Distances Classes
- Chebyshev: Compute the Chebyshev distance between two nodes which is max(|dx|, |dy|)
- Euclidean: Compute the Euclidean distance between two nodes which is sqrt(|dx|^2 + |dy|^2)
- Manhattan: Compute the Manhattan distance between two nodes which is |dx| + |dy|
- Octile : Compute the Octile distance between two nodes which is (|dx| < |dy|) ? (sqrt(2) - 1) |dx| + |dy|: (sqrt(2) - 1) |dy| + |dx|
- Zero : Compute the null or zero distance between two nodes A and B which is always 0
Examples
ASCIISyntax for maps:
- Path: '.'
- Source: '>'
- Target: '<'
- Wall: 'X'
SSP solving:
Installation
Use composer:
Legal
Letournel/PathFinder is Copyright(c) 2015 Letournel
Code released under the MIT license