Nepedia
Back to Discover
Fluent Reader
🔢

Adjacency matrix

math Maturity 7-9 Next article →

Imagine a collection of dots connected by lines. In math, we call these dots vertices and the lines edges. An adjacency matrix is a special square grid used to map these connections. This grid acts like a map for the whole group. It tells us exactly which vertices are adjacent, or neighbors, to each other.

6n-graph2
6n-graph2

Scientists and computer experts use these matrices to study how things are linked. It turns a picture of connections into a clear set of numbers.

How does this grid actually work? For a simple graph, we use a (0,1)-matrix. This means the grid only contains zeros and ones. A one shows that an edge connects two specific vertices. A zero shows there is no connection between them.

Symmetric group 4; Cayley graph 4,9 (adjacency matrix)
Symmetric group 4; Cayley graph 4,9 (adjacency matrix)

In these simple graphs, the diagonal line of numbers from top-left to bottom-right is always zero. This is because a simple graph does not allow a loop from a dot back to itself. If the lines go both ways, the matrix is symmetric. This means the top half looks like a mirror image of the bottom half.

Mathematicians have found many different ways to use these grids. Sometimes, they use a distance matrix instead. This grid does not just show if dots connect. It shows the length of the shortest path between any two dots.

Symmetric group 4; Cayley graph 1,5,21 (adjacency matrix)
Symmetric group 4; Cayley graph 1,5,21 (adjacency matrix)

There is also a special version for bipartite graphs. These are graphs where vertices are split into two separate groups. In these cases, we can use a smaller grid called a biadjacency matrix. This smaller grid is much more efficient for representing the connections.

These matrices can also tell us about the structure of the graph through math. For example, we can use the matrix to count triangles. If we multiply the matrix by itself, the new numbers tell us about paths. The number of ways to walk from one dot to another in a certain number of steps is hidden in the math.

Symmetric group 4; Cayley graph 1,5,21 (Nauru Petersen); numbers
Symmetric group 4; Cayley graph 1,5,21 (Nauru Petersen); numbers

We can even use eigenvalues to study the spectrum of a graph. This helps us understand if the graph is connected or if it has special patterns.

Computers use adjacency matrices as a way to store data. They are very fast when we need to check if two specific dots are connected. However, they can take up a lot of space if there are very few connections. In those cases, a computer might use an adjacency list instead.

Symmetric group 4; Cayley graph 4,9; numbers
Symmetric group 4; Cayley graph 4,9; numbers

An adjacency list only stores the connections that actually exist. This saves memory when the graph is sparse. Choosing between a matrix and a list depends on the job the computer is doing.

436 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (5)
File:6n-graph2.svg
6n-graph2.svg
File:Symmetric group 4; Cayley graph 1,5,21 (Nauru Petersen); numbers.svg
Symmetric group 4; Cayley graph 1,5,21...
File:Symmetric group 4; Cayley graph 1,5,21 (adjacency matrix).svg
Symmetric group 4; Cayley graph 1,5,21...
File:Symmetric group 4; Cayley graph 4,9; numbers.svg
Symmetric group 4; Cayley graph 4,9; numbers.svg
File:Symmetric group 4; Cayley graph 4,9 (adjacency matrix).svg
Symmetric group 4; Cayley graph 4,9...
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.