I was going through the adjacency matrix in graph data structures. I have seen some examples representing the degree of a vertex in the adjacency matrix and some representing the weight of edges in the adjacency matrix but I was curious if we could represent multigraph weighted edges in the adjacency matrix? It seems quite impossible. I tried googling but any help is greatly appreciated.
Look at the below image consisting of multigraph weighted edges. How could we represent this using an adjacency matrix, if not an adjacency matrix is there any other way of representing in a matrix or other structure?
You could do it by storing a list of weights in each cell of the adjacency matrix, instead of just the one integer.
1.4m articles
1.4m replys
5 comments
56.9k users