All Projects → samueltardieu → Pathfinding

samueltardieu / Pathfinding

Pathfinding library for rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Pathfinding

Dijkstra
Fastest golang Dijkstra path finder
Stars: ✭ 107 (-66.98%)
Mutual labels:  graph, pathfinding, dijkstra
Algorithms
Solved algorithms and data structures problems in many languages
Stars: ✭ 1,021 (+215.12%)
Mutual labels:  hacktoberfest, graph
Dracula
JavaScript layout and representation of connected graphs.
Stars: ✭ 767 (+136.73%)
Mutual labels:  hacktoberfest, graph
Npmcharts.com
Compare npm package downloads over time
Stars: ✭ 129 (-60.19%)
Mutual labels:  hacktoberfest, graph
Java Ds Algorithms
Data Structures and Algorithms in Java
Stars: ✭ 125 (-61.42%)
Mutual labels:  graph, dijkstra
Data Structures
Common data structures and algorithms implemented in JavaScript
Stars: ✭ 139 (-57.1%)
Mutual labels:  graph, dijkstra
Exram.gremlinq
A .NET object-graph-mapper for Apache TinkerPop™ Gremlin enabled databases.
Stars: ✭ 84 (-74.07%)
Mutual labels:  hacktoberfest, graph
Geeksforgeeks Dsa 2
This repository contains all the assignments and practice questions solved during the Data Structures and Algorithms course in C++ taught by the Geeks For Geeks team.
Stars: ✭ 53 (-83.64%)
Mutual labels:  hacktoberfest, graph
Chart.js
Simple HTML5 Charts using the <canvas> tag
Stars: ✭ 55,646 (+17074.69%)
Mutual labels:  hacktoberfest, graph
pathfinding-visualizer
Website built using React Framework for visualizing Pathfinding and Maze Generation Algorithms.
Stars: ✭ 33 (-89.81%)
Mutual labels:  pathfinding, dijkstra
Pathfinder
A pathfinder visualizer in Flutter. Create mazes, generate random walls, or draw your own walls and see the pathfinding algorithms in action
Stars: ✭ 14 (-95.68%)
Mutual labels:  pathfinding, dijkstra
Fl chart
A powerful Flutter chart library, currently supporting Line Chart, Bar Chart, Pie Chart, Scatter Chart and Radar Chart.
Stars: ✭ 3,882 (+1098.15%)
Mutual labels:  hacktoberfest, graph
Pathfinder.vim
Vim plugin to suggest better movements
Stars: ✭ 228 (-29.63%)
Mutual labels:  pathfinding, dijkstra
Competitive coding
This repository contains some useful codes, techniques, algorithms and problem solutions helpful in Competitive Coding.
Stars: ✭ 393 (+21.3%)
Mutual labels:  hacktoberfest, graph
Pathfinding
Visual explanation of pathfinding algorithms and how a*, Dijkstra and BFS can be seen as the same algorithm with different parameter/data structures used under the hood
Stars: ✭ 165 (-49.07%)
Mutual labels:  pathfinding, dijkstra
V Chart Plugin
Easily bind a chart to the data stored in your Vue.js components.
Stars: ✭ 188 (-41.98%)
Mutual labels:  hacktoberfest, graph
unity-dijkstras-pathfinding
Dijkstra's Pathfinding Algorithm Unity Implementation. (Not being maintained by me, it is just an experiment.)
Stars: ✭ 80 (-75.31%)
Mutual labels:  pathfinding, dijkstra
Graphhopper
Open source routing engine for OpenStreetMap. Use it as Java library or standalone web server.
Stars: ✭ 3,457 (+966.98%)
Mutual labels:  pathfinding, dijkstra
Bat Extras
Bash scripts that integrate bat with various command line tools.
Stars: ✭ 320 (-1.23%)
Mutual labels:  hacktoberfest
Documentation Html Template
A Sample Documentation Template for Themes, Templates and Plugins
Stars: ✭ 322 (-0.62%)
Mutual labels:  hacktoberfest

pathfinding

Current Version Documentation License: Apache-2.0/MIT

This crate implements several pathfinding, flow, and graph algorithms in Rust.

Algorithms

The algorithms are generic over their arguments.

Directed graphs

  • A*: find the shortest path in a weighted graph using an heuristic to guide the process.
  • BFS: explore nearest successors first, then widen the search.
  • DFS: explore a graph by going as far as possible, then backtrack.
  • Dijkstra: find the shortest path in a weighted graph.
  • Edmonds Karp: find the maximum flow in a weighted graph.
  • Fringe: find the shortest path in a weighted graph using an heuristic to guide the process.
  • IDA*: explore longer and longer paths in a weighted graph at the cost of multiple similar examinations.
  • IDDFS: explore longer and longer paths in an unweighted graph at the cost of multiple similar examinations.
  • strongly connected components: find strongly connected components in a directed graph.
  • topological sorting: find an acceptable topological order in a directed graph.

Undirected graphs

Matching

  • Kuhn-Munkres (Hungarian algorithm): find the maximum (or minimum) matching in a weighted bipartite graph.

Using this crate

In your Cargo.toml, put:

[dependencies]
pathfinding = "2.1.1"

You can then pull your preferred algorithm (BFS in this example) using:

extern crate pathfinding;

use pathfinding::prelude::bfs;

Example

We will search the shortest path on a chess board to go from (1, 1) to (4, 6) doing only knight moves.

use pathfinding::prelude::bfs;

#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct Pos(i32, i32);

impl Pos {
  fn successors(&self) -> Vec<Pos> {
    let &Pos(x, y) = self;
    vec![Pos(x+1,y+2), Pos(x+1,y-2), Pos(x-1,y+2), Pos(x-1,y-2),
         Pos(x+2,y+1), Pos(x+2,y-1), Pos(x-2,y+1), Pos(x-2,y-1)]
  }
}

static GOAL: Pos = Pos(4, 6);
let result = bfs(&Pos(1, 1), |p| p.successors(), |p| *p == GOAL);
assert_eq!(result.expect("no path found").len(), 5);

License

This code is released under a dual Apache 2.0 / MIT free software license.

Contributing

You are welcome to contribute by opening issues or submitting pull requests. Please open an issue before implementing a new feature, in case it is a work in progress already or it is fit for this repository.

In order to pass the continuous integration tests, your code must be formatted using the latest rustfmt with the nightly rust toolchain (available as the rustfmt-preview component of rustup).

This repository use the imperative mode in commit messages, such as "Add IDDFS", "Fix #xxx". This style is preferred over "Added IDDFS" or "Fixed #xxx".

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].