Skip to content

gregstoll/rust-pathfinding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-pathfinding

Examples of pathfinding in Rust

This repo is the example code for the article Pathfinding in Rust: A tutorial with examples on the LogRocket blog. It shows examples of doing breadth-first search, Dijkstra's algorithm, and A* search.

To run these, use:

  • cargo run --bin bfs to run the breadth-first search example - this will output bfs.png in the root directory.
  • cargo run --bin dijkstra to run the Dijkstra's algorithm example - this will output dijkstra.png in the root directory.
  • cargo run --bin astar to run the A* search example - this will output astar.png in the root directory.

The code uses the pathfinding crate to do the searches. The Board struct uses the imageproc crate to draw the board and paths.

The Board struct is defined in lib.rs, and there are some unit tests in that file as well.

About

Examples of pathfinding in Rust

Topics

Resources

License

Stars

Watchers

Forks

Languages