How do u get get the edge from the adjacency graph

  adjacency-matrix, algorithm, c++

So I m trying to implement Kruskal MST for a adjacency matrix and i have a 2d array that represent the adjacency matrix. I know I need to sort the edges from lowest to highest weight in order to proceed with the algorithm but how do i get the edges from the matrix itself. i know the (1,1) will always be zero and the (2,1) and (1,2) will have the same value.

Eg. adjacency matrix

0 1 3

1 0 2

3 2 0

Source: Windows Questions C++

LEAVE A COMMENT