- Published on
Introduction to Graph Theory - Part 3
- Authors

- Name
- Till Heller
In the previous part, we introduced the basic building blocks of graph theory: vertices, edges, adjacency, and degree. With these tools in hand, we can now explore different types of graphs that show up frequently in theory and practice. Think of it like learning about different shapes in geometry — once you know what a triangle or a circle is, you can start recognizing them everywhere.
Subgraphs
Before we look at specific graph classes, let's first talk about a concept that will come in handy throughout this series. Sometimes, we don't want to consider an entire graph, but only a part of it. For instance, think of our friendship graph from Part 2 — maybe we want to focus on just a few people and the friendships between them. This leads us to the idea of a subgraph.
Definition 4. A graph is a subgraph of a graph if and .
In other words, a subgraph is obtained by selecting some vertices and some edges from the original graph, as long as the selected edges only connect selected vertices. There is also a more specific notion: if we pick a subset of vertices and keep all edges between them, we get a special kind of subgraph.
Definition 5. Let be a graph and . The induced subgraph is the graph , where .
To make this concrete, consider the graph . If we take , the induced subgraph contains the vertices and the edges — notice that the edge is not included because vertex is not in .

Complete Graphs
Let's go back to our friendship example. Imagine a group of people where everyone is friends with everyone else. No one is left out — every possible pair of people has a direct connection. This gives us a very special type of graph called a complete graph.
Definition 6. A complete graph on vertices, denoted , is a graph where every pair of distinct vertices is connected by an edge.
The smallest interesting complete graph is , which is just the triangle graph we saw in Part 2. Next comes , a graph on four vertices where each vertex is connected to every other vertex, giving us edges in total.

In general, has exactly edges. This follows directly from the fact that we need to choose vertices out of to form each edge. We can also verify this using the degree: in , every vertex has degree , so the sum of all degrees is . Since each edge contributes exactly to the total degree sum1, we get edges.
Paths and Cycles
In Part 1, we talked about Euler walking across bridges. But what does it actually mean to "walk" through a graph? Let's make this precise. A path is a sequence of distinct vertices where each consecutive pair is connected by an edge — in other words, you move from one vertex to the next without ever visiting the same vertex twice.
Definition 7. A path graph is a graph on vertices with edges .
The path , for example, consists of three vertices in a line: . The first and last vertex each have degree , while the middle vertex has degree .
Now, what happens if the person walking through the graph ends up exactly where they started? If we take a path and connect the last vertex back to the first, we get a cycle.
Definition 8. A cycle graph is a graph on vertices with edges .
The smallest cycle is , which is the triangle — so is the same graph as . In a cycle , every vertex has degree exactly , since each vertex is connected to its predecessor and its successor.

Observation 2. A path has edges, and a cycle has edges.
This is easy to see: a path connects vertices with one edge between each consecutive pair, giving edges. A cycle does the same but adds one more edge to close the loop.
Bipartite Graphs
So far, we've looked at graphs where any vertex can be connected to any other. But in many real-world scenarios, connections only exist between two distinct groups. Think of students and courses at a university: students are enrolled in courses, but a student isn't "connected" to another student in this context, and a course isn't connected to another course. The edges only go between the two groups.
Definition 9. A graph is called bipartite if its vertex set can be partitioned into two disjoint sets and (with and ) such that every edge connects a vertex in to a vertex in .
Consider the graph with and . Every edge goes from a vertex in to a vertex in , so this graph is bipartite. Notice that there are no edges within or within .
Just as we have complete graphs where every possible edge is present, we can define a complete bipartite graph where every vertex in is connected to every vertex in .
Definition 10. The complete bipartite graph is a bipartite graph with and , where every vertex in is adjacent to every vertex in .
The complete bipartite graph has exactly edges, since each of the vertices on one side is connected to all vertices on the other side. For example, has edges connecting vertices on one side to vertices on the other.

Trees
Trees are among the most important structures in all of graph theory and computer science. You've probably encountered them before — file systems on your computer, organizational hierarchies, and family trees all have the same underlying structure. A tree is a graph that is connected (you can reach any vertex from any other) but contains no cycles.
Definition 11. A tree is a connected graph that contains no cycle as a subgraph.
The simplest tree is a single vertex with no edges. The next is a single edge connecting two vertices — which is also the path . In fact, every path graph is a tree, since paths are connected and don't contain any cycles.
Let's check: the graph is a tree. It is connected (every vertex can be reached from vertex ) and contains no cycle. This particular tree has a special shape — vertex is connected to all others, forming a star.

Observation 3. A tree on vertices has exactly edges.
We can convince ourselves of this by thinking about it inductively. A single vertex has edges. Each time we add a new vertex to the tree, we need exactly one edge to connect it to the existing tree — if we added more than one edge, we would create a cycle, and if we added none, the vertex would be disconnected. So after adding vertices to the initial one, we have exactly edges2.
Regular Graphs
Let's return once more to our friendship analogy. In most social networks, different people have different numbers of friends. But what if everyone in a group had exactly the same number of friends? This gives us a very symmetric type of graph.
Definition 12. A graph is called -regular if every vertex has degree .
We've already seen several examples of regular graphs without realizing it. The cycle is -regular, since every vertex has degree . The complete graph is -regular, since every vertex is connected to all other vertices. And the complete bipartite graph (with equal-sized parts) is -regular.
A particularly famous example is the Petersen graph, which is -regular and has vertices and edges. It serves as an important counterexample in many areas of graph theory and shows up surprisingly often3.

Looking Ahead
Now that we have a toolbox of graph classes, we can start asking more interesting questions. How do we move through a graph? When is a graph "connected"? Can we always find a path between two vertices? In the next part, we will explore walks, paths, and the concept of connectivity — building directly on the definitions we've established so far.
Footnotes
This observation is known as the Handshaking Lemma and holds for any graph: . We will come back to this in a future part. ↩
This argument can be turned into a rigorous proof by induction on the number of vertices, which we will do in a future article dedicated to trees. ↩
The Petersen graph is a counterexample to many conjectures that seem "obviously true" — we might encounter it again in later parts of this series. ↩