Adjacency matrixA grid of every link.
A row and a column for each item, a filled cell where two are linked. Sorted well, groups show as solid blocks.
- Answers How are things connected?
- Your data one line per link, from and to
- Items about 5 to 200
- Cells items × items
- Excel and Power BI a matrix with colours
- Group 1
- Group 2
What is an adjacency matrix?
An adjacency matrix draws a grid with one row and one column per item. Where two items are linked, the cell is filled; where they are not, it stays empty. Since every possible pair has its own cell, no link hides, however many there are. When items of a group sit next to each other, their links form solid blocks along the diagonal.
The same club of 12 people. The two blocks are the two circles of friends; the only cells outside them are the friendship between Eva and Joe, the one link between the circles.
Why use an adjacency matrix?
Because a grid never turns into a knot.
- Every link shows. One cell per pair, nothing drawn on top of anything.
- Groups show as blocks. Sorted by group, links form squares.
- Scales up. Readable with hundreds of items, where lines would tangle.
- Rows can be read. One row lists all of one item's links.
How does an adjacency matrix work?
Four steps turn pairs into a grid.
- Step 1 of 4A row and a column per itemEach friendship fills two cells: Ann's row at Ben, and Ben's row at Ann.
- Step 2 of 4Sort by groupFriends next to each other: the filled cells gather into blocks.
- Step 3 of 4Colour by groupLinks inside a group take its colour, links between groups stay grey.
- Group 1
- Group 2
- Step 4 of 4Light one itemOne row and one column: all of Joe's links.
- Group 1
- Group 2
What are the parts of an adjacency matrix?
Four parts, and each one has a job.
- Group 1
- Group 2
- Cellfilled where two items are linked
- Rowone item and all its links
- Diagonalan item with itself, left empty
- Blocka group whose items link to each other
How do you read an adjacency matrix?
Three looks, in this order.
- Find the blocksTwo blocks along the diagonal: two circles of friends.
- Group 1
- Group 2
- Count a rowCat's row has five filled cells: the most friends.
- Group 1
- Group 2
- Find cells outside the blocksJoe links to Eva in one circle and Kim in the other.
- Group 1
- Group 2
What kinds of adjacency matrix are there?
The same club, three ways.
- Kind 1Sorted by groupBlocks along the diagonal.
- Group 1
- Group 2
- Kind 2One colourFilled or empty, nothing else.
- Kind 3UnsortedThe same links scattered: the order makes the blocks.
- Group 1
- Group 2
When links have a weight (how many emails, how much trade), the cells are shaded by it, and the matrix becomes a heat map of pairs. When links have a direction, the grid is no longer the same on both sides of the diagonal.
When should you use an adjacency matrix?
When there are many items or many links.
- there are many items or links
- every link must be findable
- you look for groups as blocks
- links have weights
- there are few items and the shape matters (a network graph)
- items have a natural order and few links (an arc diagram)
- you follow paths through many steps (a network graph)
Adjacency matrix or network graph?
A grid for every link, dots and lines for the shape.
The network graph makes paths easy to follow (Ann to Sam goes through Joe), but with many items its lines tangle. The adjacency matrix never tangles and shows every pair, but a path through several items is harder to trace.
How do you make an adjacency matrix?
A matrix with colours, in Excel or Power BI.
In Excel, put the items as row and column headers, write 1 where two are linked (a COUNTIFS on the list of links does it) and add a colour scale with conditional formatting. In Power BI, a matrix visual with the item on rows and on columns, a count of links as values and background colour formatting does the same.
What goes wrong with adjacency matrices?
The most common mistake, and its fix: items in A to Z order.
| Mistake | Why it hurts | Fix |
|---|---|---|
| Items A to Z | Groups stay hidden | Sort by group or by links |
| Labels too small | Rows cannot be found | Short names, or fewer items |
| A filled diagonal | Looks like links to oneself | Leave it empty or faint |
| No weights shown | Strong and weak links look the same | Shade cells by weight |
| Paths asked of it | Hard to trace in a grid | A network graph for paths |
Every chart for “How are things connected?”
Read on, step by step.
Does it fit your data? Try it.
Paste your table into Chart Compass, say what the chart should show, and see the charts that fit, drawn with your own numbers. It runs in your browser, so the data stays with you.