Seastar
Features
seastar is a dependency-free, non-generic implementation of the A*
pathfinding algorithm. It
is specifically designed to operate over a 2D grid of tiles in cardinal
directions (North, East, South, West).
I can't necessarily recommend using this over the pathfinding crate, but I wanted a different API for my own use-case, as well as a deeper understanding of the algorithm.
Usage
Examples
If you have cloned the seastar repository, you can run an example with the
command cargo run --example <example_name>.
| Example | File | Description |
|---|---|---|
| random_30 | random_30.rs | Generate a 30x30 map with random walls and find the path from top left to bottom right. |
| random_100 | random_100.rs | Generate a 100x100 map with random walls and find the path from top left to bottom right. |
| random_256 | random_256.rs | Generate a 256x256 map with random walls and find the path from top left to bottom. |
Benchmarks
You can run benchmarks with the command cargo bench.
NOTE: A word of caution about benchmarks here: because the maps are randomly generated in the bench tests, the results will vary greatly from run to run. Maps without valid paths are often outliers that can skew the results heavily, especially on larger grids.
License
Seastar is dual-licensed under either
at your option.