Posted inComputer Science Data Structures Graphs
How to Represent Undirected Weighted Graphs Using an Adjacency Matrix
Represent an undirected weighted graph with an adjacency matrix by placing each edge weight in the corresponding row and column. Use infinity for missing connections so a genuine zero weight remains possible. The matrix is symmetric across the identity line, making it simple to verify, and any cell can be read or written in constant time.
