Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
Loading...
Searching...
No Matches
kruskals_minimum_spanning_tree.cpp File Reference

Kruskals Minimum Spanning Tree implementation More...

#include <array>
#include <iostream>
Include dependency graph for kruskals_minimum_spanning_tree.cpp:

Namespaces

namespace  greedy_algorithms
 for std::vector
 

Functions

template<typename T >
void greedy_algorithms::findMinimumEdge (const int &infinity, const std::array< std::array< T, 6 >, 6 > &graph)
 Finds the minimum edge of the given graph.
 
int main ()
 Main function.
 

Detailed Description

Kruskals Minimum Spanning Tree implementation

Quoted from Simplilearn.

Kruskal’s algorithm is the concept that is introduced in the graph theory of discrete mathematics. It is used to discover the shortest path between two points in a connected weighted graph. This algorithm converts a given graph into the forest, considering each node as a separate tree. These trees can only link to each other if the edge connecting them has a low value and doesn’t generate a cycle in MST structure.

Author
coleman2246

Function Documentation

◆ main()

int main ( void )

Main function.

Returns
0 on exit
57 {
58 constexpr int INFINITY = 99999;
60 0, 4, 1, 4, INFINITY, INFINITY,
61 4, 0, 3, 8, 3, INFINITY,
62 1, 3, 0, INFINITY, 1, INFINITY,
63 4, 8, INFINITY, 0, 5, 7,
64 INFINITY, 3, 1, 5, 0, INFINITY,
65 INFINITY, INFINITY, INFINITY, 7, INFINITY, 0};
66
68 return 0;
69}
Graph Algorithms.
void findMinimumEdge(const int &infinity, const std::array< std::array< T, 6 >, 6 > &graph)
Finds the minimum edge of the given graph.
Definition kruskals_minimum_spanning_tree.cpp:36
Here is the call graph for this function: