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.

Level: intermediateTopic: Data structures algorithms

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.