Unit 3 Introduction To Graph Theory
Unit 3 Introduction To Graph Theory
Unit 3:
Introduction to Graph Theory with Applications
Definition 1
A graph G = (V, E) consists of a finite nonempty set V , and E ⊆ V × V . The sets V and E
are the vertex set and edge set of G, respectively. We usually denote the vertex set of G
by V (G) and the edge set of G by E(G). Vertices are sometimes called points or nodes,
while edges are sometimes called lines.
Example 1. The following table lists six students at a college. An “X” indicates that the two
students participate in the same study group this semester.
Draw a graph that represents this information where each vertex represents a student and an edge
connects two vertices if the corresponding students study together.
2
Definition 2
1. The edge e = {u, v} = uv is said to join the vertices u and v.
3. Furthermore, if e1 and e2 are distinct edges of G incident with a common vertex, then
e1 and e2 are adjacent edges.
5. The degree of a vertex v in G, denoted by degG (v) or deg(v), is the number of edges
of G incident with v.
Example 2. Consider the graph G below. Determine the degree of each vertex of G.
Theorem 1
1. The Handshaking Theorem: Let G = (V, E) be an undirected graph with m edges.
Then
X
2m = deg(v)
v∈V
(The sum of the degrees of all the vertices of a graph equals twice the number of edges.)
Definition 3
A directed graph or digraph G = (V, E) consists of a finite set V of vertices and a set
E of directed edges or arcs which are ordered pairs of distinct vertices. In a digraph G, the
in-degree of a vertex v, denoted by id(v), is the number of edges with v as their terminal
vertex. The out-degree of v, denoted by od(v), is the number of edges with v as their
initial vertex. The degree of a vertex v of G is defined by deg(v) = od(v) + id(v).
Theorem 2
If G is a digraph of order n and size m with V (G) = {v1 , v2 , v3 , . . . , vn }, then
n
X n
X
od(vi ) = id(vi ) = m
i=1 i=1
Example 3. Determine the in-degree, out-degree, and degree of each vertex of the digraph below.
1.
2.
4
Definition 4
Let G = (V, E) be a graph.
Example 4. Consider the graph below. Determine some paths and circuits
Definition 5
1. A graph G is said to be connected if there is a path joining any two of its vertices.
Otherwise, it is said to be disconnected.
Question: Can you take a walk through the town, visiting each part of the town, and cross-
ing each bridge exactly once?
The townspeople took long walks through town on Sundays. They wondered whether it was
possible to start at some location in the town, travel across all the bridges once without crossing
any bridge twice, and return to the starting point.
The Swiss mathematician Leonhard Euler solved this problem. His solution, published in 1736,
may be the first use of graph theory.
6
Definition 6
1. An Euler path is a path that travels through every edge of G.
2. If a graph is connected and every vertex has an even degree, then it has at least one
Euler circuit. Such graphs are called Eulerian.
1. Make sure that the graph is connected and all vertices have even degree.
Example 5. Determine an Euler circuit, if there is any, for the following graphs.
7
2. If a graph is connected and has just two vertices of odd degree, then it has at least
one Euler path. Any such path must start at one of the odd-degree vertices and end
at the other one.
1. Make sure that the graph is connected and only two vertices have odd degree.
Example 6. Determine an Euler path, if there is any, for the following graphs.
8
Definition 7
Given a connected graph G.
1. A Hamilton path of G is a path that passes through each vertex exactly once.
2. A Hamilton circuit of G is a circuit that passes through each vertex exactly once.
A graph G that contains a Hamilton circuit is called Hamiltonian.
Example 7. Determine a Hamilton path and a Hamilton circuit, if there is any, for the following
graphs.
9
Definition 8
A weighted graph is a graph whose edges have an assigned numbers. Such numbers are
called weights. Common weights are time, distance, and cost.
2. After arriving at the next vertex, travel along the edge of smallest weight that connects
to a vertex not yet visited. Continue this process until you have visited all vertices.
1. Mark the edge of the smallest weight in the graph. (Note: If two or more edges have
the same weight, pick any one.)
2. Mark the edge of next smallest weight in the graph, as long as it does not complete a
circuit and does not add a third marked edge to a single vertex.
3. Continue this process until you can no longer mark any edges. Then mark the final
edge that completes the Hamiltonian circuit.
10
Example 8.
1. The cost of flying between various European cities is shown in the following table below.
Determine the lowest cost route that visits each city exactly once and starts and ends in
London using Greedy Algorithm and Edge-Picking Algorithm
11
2. Businesses often network their various computers. One option is to run cables from a central
hub to each computer individually; another is to connect one computer to the next, and that
one to the next, and so on until you return to the first computer. Thus the computers are all
connected in a large loop. Suppose a company wishes to use latter method, and the lengths
of cable (in feet) required between computers are given in the table below.
Determine how the computers should be networked if the business wishes to use the smallest
amount of cable possible using Greedy Algorithm and Edge-Picking Algorithm.
12
Definition 9
Graph coloring is a function of labeling either the vertices or edges of a graph for means
of classification. A coloring of a simple graph is the assignment of a color to each vertex (or
edge) of the graph so that no two adjacent vertices (or edges) are assigned the same color.
Definition 10
The chromatic number of a graph is the least number of colors needed for a coloring of
this graph. The chromatic number of a graph G is denoted by χ(G).
Definition 11
A graph is called planar if it can be drawn in the plane without any edges crossing (where
a crossing of edges is the intersection of the lines or arcs representing them at a point other
than their common endpoint). Such a drawing is called a planar representation of the
graph.
2. Assign color 2 to the vertex with the next highest degree not yet colored and to any vertex
not connected to this vertex.
Example 9.
1. What is the chromatic number of the planar graph representing this map?
14
2. A tropical fish collector had six different types of fish: Alphas, Betas, Certas, Deltas, Epsalas
and Fetas. Because of predator-prey relationships, water conditions, and size, some fish
cannot be kept in the same tank with other types of fish. The following table shows which
fish cannot be together:
What is the smallest number of tanks needed to keep the fishes? Be able to present which
types of fish will be kept in the same tank.
15
3. Eight different school clubs want to schedule meetings on the last day of the semester. Some
club members, however, belong to more than one of these clubs, so clubs that share members
cannot meet at the same time. How many different time slots are required so that all members
can attend all meetings? Be able to provide a scheduling for the eight clubs. (Clubs that
have a member in common are indicated with an “X” in the table below.)
SC SG DC HS SN CO CD CR
Ski club − X X X X
Student X − X X X
Government
Debate X − X X X
Club
Honor X X X − X X
Society
Student X X − X X
Newspaper
Community X X X − X X
Outreach
Campus X X X −
Democrats
Campus X X X −
Republicans
16
4. Five classes at an elementary school have arranged a tour at a zoo where the students get to
feed the animals:
If the zoo allows animals to be fed only once a day by one class of students, can the tour be
accomplished in two days? (Assume that each class will visit the zoo only on one day.) If
not, how many days will be required? Be able to provide a scheduling for the 5 classes.