![]() |
TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Dijkstra algorithm implementation More...
#include <cassert>#include <climits>#include <iostream>#include <vector>Go to the source code of this file.
Classes | |
| class | greedy_algorithms::dijkstra::Graph |
| Wrapper class for storing a graph. More... | |
Namespaces | |
| namespace | greedy_algorithms |
| for string class | |
| namespace | greedy_algorithms::dijkstra |
| Functions for the Dijkstra algorithm implementation. | |
Functions | |
| int | greedy_algorithms::dijkstra::minimum_distance (std::vector< int > mdist, std::vector< bool > vset, int V) |
| Utility function that finds the vertex with the minimum distance in mdist. | |
| void | greedy_algorithms::dijkstra::print (std::vector< int > dist, int V) |
| Utility function to print the distances to vertices. | |
| void | greedy_algorithms::dijkstra::dijkstra (Graph graph, int src) |
| The main function that finds the shortest path from a given source to all other vertices using Dijkstra's Algorithm. | |
| static void | tests () |
| Self-test implementations. | |
| int | main () |
| Main function. | |
Dijkstra algorithm implementation
Quote from Wikipedia.
Dijkstra's algorithm is an algorithm for finding the shortest paths between nodes in a weighted graph, which may represent, for example, road networks. It was conceived by computer scientist Edsger W. Dijkstra in 1956 and published three years later.
Definition in file dijkstra_greedy.cpp.
| int main | ( | void | ) |
Main function.
Definition at line 199 of file dijkstra_greedy.cpp.
|
static |
Self-test implementations.
Definition at line 160 of file dijkstra_greedy.cpp.