Skip to main content

MA 415G course notes

Section 3.2 Graphs and Networks

Many stuctures in the world involve pairwise connections. For example, in a group of people, we could connect each pair of people who are friends. In a city and road network, we can consider two cities connected if there is a road connecting them without any other cities on that road. In a computer network, two computers can be considered connected if they have a direct cable link between them, without any intermediary system.
The mathematical structure that captures the structure of pairwise connection is a graph, also called a network.

Definition 3.2.1.

A graph \(G\text{,}\) also called a network, consists of a finite set \(V=V(G)\) called the vertices or nodes of \(G\) and a collection \(E=E(G)\) of unordered pairs of elements of \(V\) called the edges or arcs of \(G\text{.}\)

Example 3.2.2.

The complete graph, denoted \(K_n\text{,}\) is the graph with \(V=[n]\) and every possible edge. Thus, \(K_n\) has \(n\) vertices and \(\binom{n}{2}\) edges.
Figure 3.2.3. Drawing of \(K_5\text{.}\)

Example 3.2.4.

The Petersen graph is a famous and important graph shown in the figure below. The Petersen graph is particularly noteworthy because it is often a counterexample to conjectures about graphs; if you think something is true, always test your guess on the Petersen graph!
Figure 3.2.5. Drawing of the Petersen graph.

Definition 3.2.6.

For a vertex \(v\in V(G)\text{,}\) we say the degree of \(v\) is the number of edges in \(E(G)\) that contain \(v\text{.}\) We denote the degree of a vertex by \(\deg_G(v)\text{,}\) where we will write \(\deg(v)\) if \(G\) is clear from context.

Checkpoint 3.2.7.

The first key result regarding graphs is the following.

Proof.

We count the number of pairs \((v,e)\) where \(v\in e\in E\) in two ways. This is a strategy called "double counting". First, for each edge, there are two pairs \((v,e)\text{,}\) one for each endpoint \(v\) of the edge. Thus, the total number of pairs is \(2|E|\text{.}\)
Second, for each vertex, there are \(\deg(v)\) pairs \((v,e)\text{,}\) one for each edge \(e\) containing \(v\text{.}\) Thus, there are a total of \(\sum_{v\in V}\deg(v)\) such pairs. Since both of these expressions count the same set, they are equal.

Checkpoint 3.2.10.

Discuss this proof. Does it make sense? Does it make sense why we call this type of proof "double counting"?
We can use the result above to prove a fundamental qualitative result about graphs: the handshake lemma.

Proof.

Since \(\sum_{v\in V}\deg(v)=2|E|\text{,}\) the sum of the degrees is an even number. If there were an odd number of vertices of odd degree, the sum would be odd, which is impossible.
The handshake lemma allows us to obtain statements such as the following.
Note that the theorem and corollary above do not tell us anything about how many vertices there are, or how many odd degree vertices there are. So, this is not a theorem or corollary that we can use to count with. However, these results do tell us qualitative information about the relationship between the degrees of a graph, the total number of edges, and limitations on the number of vertices of odd degree.
Another quality of a graph is whether or not it is connected, where by connected we mean the following.

Definition 3.2.13.

Given a graph \(G\text{:}\)
  1. A path is a finite sequence of edges joining a sequence of vertices.
  2. A trail is a path in which all edges are distinct.
  3. A simple path is a path in which all vertices are distinct.
  4. A circuit is a trail in which the first and last vertices are equal.
  5. A cycle is a trail in which only the first and last vertices are equal. A cycle with \(k\) edges is called a \(k\)-cycle.
  6. A graph is connected if there is a path between every pair of vertices.

Checkpoint 3.2.14.

Below are examples of a connected and disconnected graph. In the connected graph, for each of the following sequences of vertices, identify which are a path, trail, simple path, circuit, or cycle.
  1. \(\displaystyle 0,6,5,4,0\)
  2. \(\displaystyle 1,3,0,6,8\)
  3. \(\displaystyle 1,3,0,6,5,4,0,9\)
  4. \(\displaystyle 1,3,0,6,0,9\)
  5. \(\displaystyle 0,3,2,10,9,0,4,5,6,0\)
Figure 3.2.15. Example of a connected graph.
Figure 3.2.16. Example of a disconnected graph.
There are algorithms known that will generate all connected graphs on a fixed number of vertices, but these are difficult. The number of connected graphs, with vertices that are not labeled, on \(n\) vertices for \(n\geq 1\) is \(1, 1, 2, 6, 21, 112, 853, 11117, 261080,\ldots\text{,}\) and more information can be found in the Online Encyclopedia of Integer Sequences: https://oeis.org/A001349