adjacency matrix

Tags: #definition

adjacency matrix

Let G be an undirected graph with n vertices. The adjacency matrix of G is the matrix A=(aij) with
aij= number of edges between vertex i and j

If G is directed graph, aij is the number of directed edges ij.

If G is a weighted graph, aij is the sum over all edges outgoing from i the weights of those edges.

Properties

Example

Let G be the following graph:
Pasted image 20260409095759.png|200
Its adjacency matrix as an UNDIRECTED graph is

A=[0112100110012110]

Whereas as a directed graph, it is

A=[0101000110011000]