Adjacent Vertices — Definition, Formula & Examples
Adjacent vertices are two vertices (nodes) in a graph that are directly connected by an edge. If you can travel from one vertex to the other along a single edge, those vertices are adjacent.
In a graph , two vertices and are adjacent if and only if there exists an edge such that . Adjacency is a symmetric relation in undirected graphs: if is adjacent to , then is adjacent to .
How It Works
To determine whether two vertices are adjacent, check whether an edge directly connects them. You do not follow a path through other vertices — only a single edge counts. In an adjacency matrix, vertices and are adjacent when the entry in row , column equals 1. The set of all vertices adjacent to a given vertex is called the neighborhood of , often written . The number of vertices adjacent to equals the degree of .
Worked Example
Problem: A graph has vertices and edges , , , and . Which vertices are adjacent to ? Are and adjacent?
Find edges containing B: Look at every edge that includes vertex .
List adjacent vertices of B: The other endpoint of each edge gives a vertex adjacent to .
Check A and D: Look for an edge in the edge set. No such edge exists, so and are not adjacent.
Answer: is adjacent to , , and (so ). Vertices and are not adjacent because no edge connects them directly.
Why It Matters
Adjacency is the most basic relationship in graph theory and drives algorithms you encounter in computer science courses, such as breadth-first search and Dijkstra's shortest-path algorithm. Social networks, road maps, and circuit diagrams all rely on knowing which nodes connect directly to which others.
Common Mistakes
Mistake: Calling two vertices adjacent when they are connected by a path but not by a single edge.
Correction: Adjacency requires a direct edge between the two vertices. Being reachable through intermediate vertices does not make two vertices adjacent.
