app graph-algorithms

A crate for 5 graph algorithms - DIJKSTRA'S, BFS, DFS, KOSARAJU'S and BELLMAN FORD ALGORITHM

4 releases

0.1.3 May 2, 2023
0.1.2 Apr 23, 2023
0.1.1 Apr 23, 2023
0.1.0 Apr 23, 2023

#144 in Algorithms

25 downloads per month

MIT license

765 lines


This is a Rust command-line application that implements 5 graph algorithms, namely

  1. Dijkstra's algorithm: Dijkstra's algorithm allows us to find the shortest path between any two vertices of a graph.
  2. Breadth-First Search algorithm: BFS allows to traverse all the vertices of a graph in breadthfirst order, visiting all the neighbors of a vertex before visiting the neighbors of its neighbors.
  3. Depth-First Search algorithm: DFS allows us to traverse all the vertices of a graph in depthfirst order, visiting a vertex and then recursively visiting its unvisited neighbors.
  4. Kosaraju's algorithm: Kosaraju's algorithm is used to find the strongly connected components of a directed graph.
  5. Bellman Ford algorithm: Bellman Ford algorithm helps us find the shortest path from a vertex to all other vertices of a weighted graph.

Getting Started

To get started with this application, you must have Rust and Cargo installed on your system. Once you have Rust and Cargo installed, you can clone this repository and run the following command to build and run the application:

cargo run

This will start the application and present a menu of available algorithms. Select an algorithm by entering the corresponding number and pressing Enter. The application will then run the selected algorithm. After that you can enter the necessary details displayed on the command prompt to display the results.

To run the test cases, you can mention the following command:

cargo test


  1. Sanskruti Reddy Donthi - https://github.com/SanskrutiReddy
  2. Shanwaz Waqar Kotekanti - https://github.com/ShanwazWaqarK9
  3. Abhishek Cherukuru - https://github.com/abhi1701
  4. Pavan Bodanki - https://github.com/pavanbodanki

No runtime deps