a-star
This library provides a generic a-star search algorithm.
a-star = "0.1.0-rc.1"
Overview
A generic, reusable A* pathfinding implementation. The algorithm is parameterized over:
- Node -- the type of node in the graph
- Cost -- the type used for edge weights and heuristics
- Graph -- a trait providing neighbors and heuristic
- DiscoveredSet -- a trait abstracting the priority queue
Core Types
Graph<Node, Cost>-- trait for providing graph structureAStar-- the search algorithm, reusable across multiple searchesPath<Node, Cost>-- the result of a search (nodes + total cost)NodeCost<Node, Cost>-- a node with an associated costDiscoveredSet-- trait for the priority queueMinHeap-- binary min-heap implementation ofDiscoveredSet
Example
use *;
// Implement Graph for your domain.
;
let graph: MyGraph = MyGraph;
let discovered: = default ;
let mut search: = new;
if let Some = search.search