Adjacency Matrix for the first graph in the examples
vector < vector < int > > graph1 = { { 0 , inf , 9 , inf , inf , inf , 3 , inf } , { inf , 0 , inf , 10 , 1 , 8 , inf , inf } , { 9 , inf , 0 , inf , inf , inf , 11 , inf } , { inf , 10 , inf , 0 , 5 , 13 , inf , inf } , { inf , 1 , inf , 5 , 0 , 3 , inf , inf } , { 8 , inf , inf , 13 , 3 , 0 , inf , inf } , { 3 , inf , 11 , inf , inf , inf , 0 , inf } , { inf , inf , inf , inf , inf , inf , inf , 0 } , } ;