A vertex is a point in a graph that can be connected to other points by lines called edges. In graph theory, vertices (also called nodes) are the fundamental building blocks. Every graph is defined as a collection of vertices and the edges between them. If you’ve seen a diagram with dots and lines connecting them, each dot is a vertex.
This term shows up in two different math contexts. In geometry, a vertex is the corner where two sides of a shape meet, like the point of a triangle. In graph theory, a vertex is more abstract: it represents any object, and the edges represent relationships between objects. The key difference is that geometry cares about exact shapes, angles, and distances, while graph theory doesn’t. You can drag a vertex anywhere on the page, bend the edges into curves, and the graph stays mathematically identical as long as the same connections exist.
How Vertices and Edges Work Together
A graph is formally written as G = (V, E), where V is the set of vertices and E is the set of edges. Each edge is simply a pair of vertices. For example, a graph might have V = {1, 2, 3, 4} as its vertex set and E = {{1, 2}, {2, 3}, {3, 4}} as its edge set. That notation tells you vertex 1 connects to vertex 2, vertex 2 connects to vertex 3, and vertex 3 connects to vertex 4.
When an edge connects to a vertex, mathematicians say the edge is “incident” to that vertex, and the vertex is an “endpoint” of that edge. Two vertices connected by an edge are called adjacent vertices. So in the example above, vertices 2 and 3 are adjacent, but vertices 1 and 4 are not.
Vertex Degree: Counting Connections
The degree of a vertex is the number of edges touching it. A vertex connected to three edges has degree 3. A vertex with no connections at all has degree 0 and is called an isolated vertex. A vertex with exactly one connection is called a leaf.
There’s an elegant rule called the Handshaking Lemma that ties vertex degrees together: if you add up the degrees of every vertex in a graph, the total always equals exactly twice the number of edges. This makes intuitive sense because every edge has two endpoints, so it gets counted once for each vertex it touches. This also means the sum of all vertex degrees is always an even number. You can use this to check your work or prove that certain graphs are impossible. For instance, you can’t build a graph where every vertex has exactly 3 connections and there are 9 vertices, because 3 × 9 = 27, which is odd and can’t equal twice any whole number of edges.
Neighborhoods and Adjacency
The neighborhood of a vertex is the set of all vertices adjacent to it. If vertex A connects to vertices B, C, and D, then the neighborhood of A is {B, C, D}. This is sometimes called the “open neighborhood.” The “closed neighborhood” includes the vertex itself, so it would be {A, B, C, D}.
Neighborhoods matter when you’re analyzing how information, influence, or connections spread through a graph. A vertex with a large neighborhood is highly connected. A group of vertices where every pair is adjacent to each other is called a clique, like a friend group where everyone knows everyone else.
What Vertices Represent in Practice
Vertices are useful because they can represent nearly anything. In social networks, each vertex is a person and edges represent friendships or connections. In transportation networks, vertices are cities or intersections and edges are roads or flight routes. In the structure of the internet, vertices are web pages and edges are hyperlinks between them. Citation networks use vertices for academic papers and edges for references. Power grids model generators and substations as vertices with transmission lines as edges.
This flexibility is what makes graph theory so widely applicable. The same mathematical tools that analyze a social network can analyze a computer network or a biological system, because the underlying structure of vertices and edges is identical.
How Computers Store Vertices
When graphs are used in software, vertices need to be stored in a data structure. The two most common approaches are adjacency lists and adjacency matrices.
An adjacency list stores each vertex alongside a list of the vertices it connects to. This is memory-efficient for graphs where most vertices connect to only a few others. An adjacency matrix uses a grid where each row and column represents a vertex, and the cells indicate whether an edge exists between each pair. This takes more memory but makes it faster to check whether two specific vertices are connected.
These structures are the foundation for graph algorithms like breadth-first search, which explores vertices layer by layer outward from a starting point, and depth-first search, which follows a single path as far as possible before backtracking. Both algorithms work by visiting vertices and checking their neighbors systematically.
Paths and Connectivity
A path is a sequence of distinct vertices where each consecutive pair is adjacent. If you can trace a route from vertex A to vertex Z through a series of edges without revisiting any vertex, that sequence of vertices forms a path. Whether a path exists between two vertices tells you whether they’re connected in the graph.
A graph where every pair of vertices has a path between them is called a connected graph. If some vertices can’t reach others, the graph breaks into separate components. Understanding paths between vertices is central to problems like finding the shortest route between two locations or determining whether a network stays functional if certain connections fail.

