Adjacency matrix
= Adjacency matrix
{wiki=Adjacency_matrix}
An adjacency matrix is a square matrix used to represent a finite graph. It indicates whether pairs of vertices (or nodes) in the graph are adjacent (i.e., connected directly by an edge) or not. Here's how it works: 1. **Matrix Structure**: The size of the adjacency matrix is \\( n \\times n \\), where \\( n \\) is the number of vertices in the graph. Each row and column of the matrix corresponds to a vertex in the graph.