path-finding-lib 0.1.2

This library provides a variety of path finding and graph operations. Work in progress.
Documentation

Path finding library

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

How to use

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 Graph

  • Create Edge
pub fn your_function() {
    graph::Edge::from();
}
  • Create Graph
pub fn your_function() {
    graph::Graph::from(Vec::from([edge1, edge2]));
}

Minimum spanning tree

pub fn your_function() {
    let mst_graph = graph::minimum_spanning(graph);
}

Depth-first search

pub fn your_function() {
    let dfs = path::find(
        4 /* source */, 
        1 /* target */, 
        &graph, 
        Box::from(DepthFirstSearch {}) as Box<dyn PathFinding> /* used algorithm */
    );
}