AI engineering glossary · Data structures algorithms
What is adjacency list?
Adjacency list: A way of storing a graph where each vertex keeps a list of its neighbours. It uses space proportional to vertices plus edges, making it the usual choice for sparse graphs.
Adjacency list: an example
For edges A-B and A-C, the list is {A: [B, C], B: [A], C: [A]}, and visiting A's neighbours costs only its degree.
Related terms
More Data structures algorithms terms
Where you learn it
Adjacency list is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.