I am confused and trying to figure out how to put this graph data into an adjacency matrix.
This is some sample input from a text file:
0 1,28 3,33
1 2,10 4,44
2 3,50
3 4,30
4
This is how the matrix should look
0 1 2 3 4
0 INF 28 INF 33 INF
1 28 INF 10 INF 44
2 INF 10 INF 50 INF
3 33 INF 50 30 INF
4 INF 44 INF INF INF
This would be some sort of multidimensional array but I'm lost on how to translate the input into one. Any help would be appreciated.
I am working in python.
Thanks!