- Published on
Introduction to Graph Theory - Part 2
- Authors
- Name
- Till Heller
Now, let’s dive deeper and introduce the first key pieces of graph notation and explore how we can describe graphs mathematically. For the beginning, we will look at some basic definitions and observations. Note that these definitions and notation will be used throughout this article.
Basics
Before we start defining graphs, we need to introduce vertices and edges. A vertex is a point in the graph, and an edge is a connection between two vertices. In other words, an edge is a tuple of two vertices.
Now, a graph is a collection of vertices and edges . We write to denote a graph with vertex set and edge set . We formalize this in the following definition:
Definition 1. A graph is a pair , where is a finite set, and is a subset of . The number of vertices is often abbreviated as and the number of edges as .
To make things more clear, let's look at an example. Consider the following graph = . Here, and . This can be visualized as three points and the edges between each pair of points, see the following figure:

Due to the definition above, we can see that the order of the vertices in an edge does not matter. Therefore, and are the same edge1.
Due to their simplicity, graphs can be used to depict and model relationships and structures between objects - the objects under consideration become nodes, their relationship to an edge in between. Before we move on, let's look at a few more examples.
Let's consider a simple example. Suppose we have a group of 5 people and we want to model how they are related to each other. We can do this by representing each person as a vertex and drawing an edge between two vertices if the corresponding people are friends. This way, we can visually represent the relationships between the people in the group. This graph is called a friendship graph. As you surely noticed, the friendship between two people is mutually, i.e. if Alice is friends with Bob, then Bob is friends with Alice. This is an example of a undirected graph, where the edges have no direction2.
In our small example, Alice and Bob are friends - thus, they are close to each other. As it nice for friends to be close, we say that they are adjacent. Even better, they live next to each other. We say that they are neighbors. We formalize this in the following definition:
Definition 2. Two vertices and are adjacent if there exists an edge . We say that the vertices and are neighbors if they are adjacent.
We continue with more definitions. Let's assume that the friendship graph is way bigger than the three people we considered before. We can now ask ourselves how many friends Alice has. This number is called the degree of the vertex . Formally, we define the degree of a vertex as follows:
Definition 3. The degree of a vertex is the number of vertices adjacent to , denoted by .
Consider the following example. We have a graph . The degrees of the vertices are , , , , and .

When looking at the degree of the vertices, we obtain the following small observation:
Observation 1. The degree of a vertex is a number between and , where is the number of vertices in the graph.
This observation might look trivial, but will be the first proved result in this series.
Proof. We know that the degree of a vertex is the number of vertices adjacent to it. Since there are vertices in the graph, the degree of a vertex is at most . Since the degree of a vertex is a non-negative integer, the degree of a vertex is at least .
In other words, the degree of a vertex is the number of neighbors it has.