Skip to content

Commit

Permalink
chore: update repo
Browse files Browse the repository at this point in the history
  • Loading branch information
slavik-pastushenko committed Oct 24, 2024
1 parent dbde587 commit 567b769
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Graph Algorithms in Rust
# Graph Algorithms

A collection of graph algorithms implemented in Rust. This repository aims to provide efficient and easy-to-understand implementations of various graph algorithms for educational purposes and practical use.

Expand All @@ -8,6 +8,7 @@ Contributions are welcome to expand the set of algorithms and improve existing i

[![test](https://github.com/slavik-pastushenko/graph-algorithms-rs/actions/workflows/test.yml/badge.svg)](https://github.com/slavik-pastushenko/graph-algorithms-rs/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/slavik-pastushenko/graph-algorithms-rs/graph/badge.svg?token=9EL0F6725A)](https://codecov.io/gh/slavik-pastushenko/graph-algorithms-rs)
[![License](https://img.shields.io/github/license/slavik-pastushenko/graph-algorithms-rs)](https://github.com/slavik-pastushenko/graph-algorithms-rs/blob/main/LICENSE)

## Algorithms

Expand Down
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.82.0"
components = ["clippy", "rustfmt"]
3 changes: 1 addition & 2 deletions src/dijkstra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::GraphAlgorithm;

/// Dijkstra's Algorithm.
/// Finds the shortest path from a starting node to all other nodes in a weighted graph.
/// Docs: https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
#[derive(Debug)]
pub struct Dijkstra {
/// Graph to search.
Expand Down Expand Up @@ -148,7 +147,7 @@ impl GraphAlgorithm for Dijkstra {
}

// Convert the distances to a vector of shortest paths.
for (&node, &dist) in distances.iter() {
for (node, dist) in distances.into_iter() {
if node < result.len() {
result[node] = dist;
}
Expand Down
7 changes: 0 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
#![forbid(unsafe_code)]

// A* Algorithm
// Dijkstra's Algorithm
// Breadth-First Search (BFS)
// Depth-First Search (DFS)
// Bellman-Ford Algorithm
// Floyd-Warshall Algorithm

mod dijkstra;

/// A trait for graph search algorithms.
Expand Down

0 comments on commit 567b769

Please sign in to comment.