Beginner in Rust - Feedback highly appreciated!
This library will contain standard path finding algorithms and return the resulting path or graph object
Table of contents generated with markdown-toc
Currently supported: - construct graphs - create minimum spanning tree from graph - find path with depth-first search
Download the crate: https://crates.io/search?q=path-finding-lib
At the moment, we have three major concepts: - Edge - Node - Graph
You only need to pass edges to the graph. The nodes are generated automatically. Each pathfinding method will accept a graph, and return a graph that only contains the edges and nodes of the result.
Create Edge
rust
pub fn your_function() {
graph::Edge::from();
}
Create Graph
rust
pub fn your_function() {
graph::Graph::from(Vec::from([edge1, edge2]));
}
rust
pub fn your_function() {
let mst_graph = graph::minimum_spanning(graph);
}
rust
pub fn your_function() {
let dfs = path::find(
4 /* source */,
1 /* target */,
&graph,
Box::from(DepthFirstSearch {}) as Box<dyn PathFinding> /* used algorithm */
);
}