Category : adjacency-matrix

Trying to take an adjacency relation with this input format {(1,2),(1,5),(2,1),(2,3),(3,2),(3,4),(4,3),(4,5),(5,1),(5,4)} and print a adjacency matrix. My goal was to check for digits using isdigit() and then take the 2 numbers and update my matrix in those indexes. My matrix still results with all 0’s. To test input. 6 as nodes and enter the above ..

Read more