Skip to content

Adjacency list

A graph representation that associates each vertex with a collection of its neighboring vertices or incident edges.

Core Idea

An adjacency list stores graph connectivity as one neighbor collection for each vertex. Looking up a vertex retrieves exactly the local endpoints reachable by its incident edges, making traversal proportional to vertex and edge counts when collections are enumerated. The abstraction is therefore identified by a declared carrier, a transformation or constraint over that carrier, and an invariant that tells an analyst whether the named structure is genuinely present.

The load-bearing residual is not the broad topic of computer science. It is vertex-indexed sparse representation of graph incidence. That residual remains recognizable when examples, notation, scale, or implementation change, but it disappears if the carrier is mistyped, the condition that each graph edge appears in the required endpoint collection or collections under the directedness convention and no stored adjacency denotes a nonexistent edge fails, a neighboring object is substituted, or notation and topical resemblance replace the constitutive test.

How would you explain it like I'm…

Everybody's Friend List

Imagine every kid in class has a card listing the names of their friends. To find who someone can reach, you just read their card. A computer can keep a map of connections the same way, with one friend list for each spot. That is an adjacency list.

Each Dot's Neighbor List

A graph is a set of dots (called vertices) connected by lines (called edges), like towns and roads. An adjacency list stores it by giving each dot its own list of the dots it connects to directly. To see where you can go from a town, you look at that town's list. Every road must show up on the right lists, and no list may mention a road that doesn't exist. This saves space when most towns connect to only a few others.

Per-Vertex Neighbor Storage

A graph is a set of vertices (points) joined by edges (links). An adjacency list represents a graph by storing, for each vertex, a collection of its neighbors, the vertices it is directly joined to. For an undirected edge, each endpoint lists the other; for a directed edge, usually only the starting vertex lists the target. The rule that makes it correct is that every edge appears in the right lists and no list contains a neighbor that is not really connected. Compared with an adjacency matrix, a big table with a slot for every possible pair, an adjacency list is much smaller when the graph is sparse, and walking through the whole graph takes time proportional to the number of vertices plus edges.

 

An adjacency list represents a graph by indexing a neighbor collection on each vertex. Retrieving a vertex's collection returns exactly the endpoints reachable by its incident edges. The correctness condition is two-sided: each edge appears in the required endpoint collection(s) according to the directedness convention (both endpoints for undirected graphs, typically the tail for directed ones), and no stored entry denotes an edge that doesn't exist. Because storage and full enumeration scale with the number of vertices plus edges, it is the standard sparse representation, in contrast to the adjacency matrix, whose storage scales with the square of the vertex count. Traversal algorithms such as breadth-first search run in time proportional to vertices plus edges when they enumerate these collections. The collection type (array, linked list, hash set) is an implementation choice; what matters is the vertex-indexed incidence structure.

Scope of Application

Adjacency list belongs to computer science and is useful where the analyst can specify a finite directed or undirected graph, vertex identifiers, per-vertex neighbor or incident-edge collections, edge attributes, duplication convention, collection representation, iteration operations and memory complexity, then evaluate each graph edge appears in the required endpoint collection or collections under the directedness convention and no stored adjacency denotes a nonexistent edge. The scope is broad within that domain but bounded by the need for each graph edge appears in the required endpoint collection or collections under the directedness convention and no stored adjacency denotes a nonexistent edge. The entry records a descriptive analytical identity; practical use requires the governing domain's evidence, standards, and safety obligations.

Clarity

The abstraction clarifies a crowded vocabulary by making each graph edge appears in the required endpoint collection or collections under the directedness convention and no stored adjacency denotes a nonexistent edge the center of the account. A claim should name the carrier, the governing operation or relation, the applicable assumptions, and the recognition test. A bare label is insufficient because the name Adjacency list can be used for a formal identity, an implementation, or a neighboring result unless carrier and convention are stated.

Manages Complexity

Without the abstraction, an analyst must reason directly over many local details: the carrier roles, admissibility assumptions, competing conventions, derived invariants, boundary cases, and proof or validation obligations specific to Adjacency list. Adjacency list compresses them into the roles in the structural signature. That compression permits comparison across instances without erasing the variables that determine validity. It also exposes which details may be varied safely and which are constitutive.

Abstract Reasoning

  1. Identify the carrier. State what the elements, states, objects, or observations are: a finite directed or undirected graph, vertex identifiers, per-vertex neighbor or incident-edge collections, edge attributes, duplication convention, collection representation, iteration operations and memory complexity. Reject examples whose alleged carrier belongs to a different problem.
  2. Lock the constitutive rule. Express each graph edge appears in the required endpoint collection or collections under the directedness convention and no stored adjacency denotes a nonexistent edge independently of one notation or implementation.

Knowledge Transfer

Knowledge transfers strongly among subfields of computer science because they reuse a finite directed or undirected graph, vertex identifiers, per-vertex neighbor or incident-edge collections, edge attributes, duplication convention, collection representation, iteration operations and memory complexity, Looking up a vertex retrieves exactly the local endpoints reachable by its incident edges, making traversal proportional to vertex and edge counts when collections are enumerated., and type the carrier, state every parameter and convention in the definition, test that each graph edge appears in the required endpoint collection or collections under the directedness convention and no stored adjacency denotes a nonexistent edge, compare the nearest accepted identity, and report counterexamples, uncertainty, and limiting cases.

Relationships to Other Abstractions

Local relationship map for Adjacency listParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Adjacency listDOMAINPrime abstraction: Representation — is a kind ofRepresentationPRIME

Current abstraction Adjacency list Domain-specific

Parents (1) — outgoing typed relations

  • Adjacency list is a kind of Representation Prime

    The structure represents graph connectivity through local neighbor collections.

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

Adjacency list sits in a crowded region of the domain-specific corpus (5th percentile for distinctiveness): several abstractions share nearly its structure, so a description that fits it tends to fit its neighbors too.

Family — Graph Classes & Invariants (40 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-25