Essay record
Graph Search: Adjacency Matrix
- Record
- Essay / / 1 min read / 80 words
- Tags
- Unfiled
DISCLOSURE: Some links may be affiliate links. Details
For each coordinate in the matrix, place a 1 if the nodes are connected and a 0 if they aren’t. In the case of a weighted graph, replace the one with the respective weight.
Adjacency Matrix
| Node | 1 | 2 | 3 | 4 | 5 | 6 |
| 1 | 1 | 1 | 0 | 0 | 1 | 0 |
| 2 | 1 | 0 | 1 | 0 | 1 | 0 |
| 3 | 0 | 1 | 0 | 1 | 0 | 0 |
| 4 | 0 | 0 | 1 | 0 | 1 | 1 |
| 5 | 1 | 1 | 0 | 1 | 0 | 0 |
| 6 | 0 | 0 | 0 | 1 | 0 | 0 |