An adjacency matrix is a square matrix used to represent a finite graph. The elements of the matrix indicate whether pairs of vertices are adjacent or not in the graph.

If the graph is undirected the adjacency matrix is symmetric.

Example of an undirected graph and its adjecancy matrix:

adjacency graph