You are on page 1of 12

Introduction to Graph Theory

The Königsberg Bridge Problem was solved by the Swiss mathematician Leonhard Euler
(pronounced ‘Oiler ’) in 1736. It heralded the start of the study of two new areas of mathematics,
graph theory and topology.
There are many situations that can be modelled using this simple dot and line model. You
might think of the route maps found in various in-flight magazines, for example. But search out
others. Look for social network situations, electrical networks, molecules or anything else that
might use dots joined by lines. A branch of mathematics called Graph Theory illustrates and
analyzes connections such as these.

Graph
A graph is a set of points called vertices and line segments or curves called edges that connect
vertices.
Question: How many graphs are there with just two vertices?
Solution: First, any edge between two vertices can be drawn any way you like.
So we consider all of the graphs in the figure below to be the same
So we have three graphs on two vertices: one with no edges and two with one. How could
we possibly have infinitely many graphs on two vertices? Well, who said that there was only one
edge between any two vertices? After all, when we were talking about Königsberg’s bridges
before, we sometimes had two lines joining two vertices. Edges like this are what are called
multiple edges and we can use as many multiple edges as we like in a graph. However, such
graphs are called multigraphs.

Multiple edges
If two or more edges connect the same vertices, they are called multiple edges.
Loop
If an edge begins and ends at the same vertex, it is called a loop.
Complete graph
A graph is called connected if any vertex can be reached from any other vertex by tracing
along edges. A connected graph in which every possible edge is drawn between vertices (without
any multiple edges) is called a complete graph.
Notice that it does not matter whether the edges are drawn straight or curved, and their lengths and
positions are not important. Nor is the exact placement of the vertices important. The graph simply
illustrates connections between vertices.

Equivalent Graph
Consequently, the three graphs illustrated below are considered equivalent
graphs because the edges form the same connections of vertices in each graph.

If you have difficulty seeing that these graphs are equivalent, use the labeled vertices to compare
each graph. Notice that in each case, vertex B has an edge connecting it to each of the other four
vertices and no other edges exist.
Example: Determine whether the following two graphs are equivalent.
Solution
Despite the fact that the two graphs have different arrangements of vertices and edges, they are
equivalent. To illustrate, we examine the edges of each graph. The first graph contains six edges; we can
list them by indicating which two vertices they connect. The edges are AC, AE, BD, BE, CE, and DE. If
we do the same for the second graph, we get the exact same six edges. Because the two graphs
represent the same connections among the vertices, they are equivalent.

Isomorphism
Isomorphism
If two graphs are the same they are isomorphic.
More formally, two graphs G1 and G2 are isomorphic if there exists a matching between
their vertices so that two vertices are connected by an edge in G1 if and only if corresponding
vertices are connected by an edge in G2.
Example: Graph Isomorphism
Most properties of a graph do not depend on the particular names of the vertices. For
example, although graphs A and B in the figure below are technically different (as their vertex
sets are distinct), in some very important sense they are the “same”.

Formally a bijection between vertices is a ↔ u,b ↔ v,c ↔ x, and d ↔ w, and between edges is ab ↔ uv,
ac ↔ ux, bd ↔ vw. Using this bijection we can successfully ‘sit’ the right graph on top of the left graph
so that edges sit on top of edges.
While we are thinking about isomorphism, it turns out to be extremely difficult to tell when two
graphs with even a reasonable number of edges are isomorphic. The number of edges in vertices is called
a degree. Thus the degree of points a,b,c, and d in graph A is 2,2,1,1, respectively.
Example: Find the sum of the degrees of the graph below:

Solution:
For Graph 1, the number of edges is 5, thus the sum of degrees is 10.
For Graph 2, the number of edges is 7, thus the sum of degrees is 14.

Euler Circuits
Euler Circuits
A walk in a graph can be thought of as a movement from one vertex to another by
traversing edges.
If a walk ends at the same vertex it started at, it is considered a closed walk, or circuit.
A circuit that uses every edge, but never uses the same edge twice, is called an Euler
circuit. Euler circuit is a walk that starts and ends at the same vertex and uses every edge of the
graph exactly once. (The walk may cross through vertices more than once)
Example:

Sample of walk are A-B-A-C and D-C-B-A-D.


Sample of closed walk are A-B-C-A and D-C-B-A-D.
If we could find an Euler circuit in the graph in the graph above, we would have a solution
to the Königsberg bridges problem: a path that crosses each bridge exactly once and returns to
the starting point.

Euler Graph Theorem


A connected graph is Eulerian if and only if every vertex of the graph is of even degree.
Example: Find an Euler Circuit
Determine whether the graph shown below is Eulerian. If it is, find an Euler circuit. If it is
not, explain how you know. The number beside each vertex indicates the degree of the vertex.

Solution:
Each vertex has degree of either 2, 4, or 6, so by the Eulerian Graph Theorem, the
graph is Eulerian.
There are many possible Euler circuits in this graph. We do not have a formal method of
locating one, so we just use trial and error. If we label the vertices as shown below, one Euler
circuit is B–A–F–B–E–F–G–E–D–G–B–D–C–B.

An Application of Euler Circuits


The subway map below shows the tracks the subway trains traverse as well as the
junctions where one can switch trains. Suppose an inspector needs to travel the full length of
each track. Is it possible to plan a journey that traverses the tracks and returns to the starting
point without traveling through any portion of a track more than once?
Solution
We can consider the subway map a graph, with a vertex at each junction. An edge represents a track
that runs between two junctions. In order to find a travel route that does not traverse the same track twice,
we need to find an Euler circuit in the graph. Notice, however, that the vertex representing the Civic
Center junction has degree 3. Because a vertex has an odd degree, the graph cannot be Eulerian, and it is
impossible for the inspector not to travel at least one track twice

Euler Walks
If we do not need to return to our starting point, then what we are looking for as an
Example under the Eulerian circuit on the above page is a walk (not necessarily a circuit) that
uses every edge once and only once. We call such a walk an Euler walk. Euler showed that even
with this relaxed condition, the bridge problem still was not solvable. The general result of his
argument is given in the following theorem.

Euler Walk Theorem


A connected graph contains an Euler walk if and only if the graph has two vertices of
odd degree with all other vertices of even degree. Furthermore, every Euler walk must start at
one of the vertices of odd degrees and end at the other.

Example: An Application of Euler Walks


A photographer would like to travel across all of the roads shown on the map below. The
photographer will rent a car that need not be returned to the same city, so the trip can begin in
any city. Is it possible for the photographer to design a trip that traverses all of the roads exactly
once?
Solution:
Looking at the map of roads as a graph, we see that a route that includes all of the roads but does
not cover any road twice corresponds to an Euler walk of the graph. Notice that only two vertices have
odd degree, the cities Alameda and Dover. Thus we know that an Euler walk exists, and so it is possible
for the photographer to plan a route that travels each road once. Because (abbreviating the cities) A and D
are vertices of odd degree, the photographer must start at one of these cities. With a little experimentation,
we find that one Euler walk is A–B–C–D–B–F–A–G–F–E–D

Hamilton Circuit
A Hamiltonian circuit is a circuit that visits every vertex once with no repeats. Being a circuit, it
must start and end at the same vertex. A Hamiltonian path also visits every vertex once with no repeats
but does not have to start and end at the same vertex.
Example: Which of the graph represents a Hamiltonian path?

Solution:
On the left is a graph (Graph A) that is Hamiltonian and non-Eulerian and on the right is a
graph (Graph B) that is Eulerian and non-Hamiltonian.

Dirac’s Theorem
Consider a connected graph with at least three vertices and no multiple edges. Let n be the
number of vertices in the graph. If every vertex has a degree of at least n2 then the graph must be
Hamiltonian.
We must be careful, however; if our graph does not meet the requirements of this theorem,
it still might be Hamiltonian. Dirac’s Theorem does not help us in this case.

Example: Apply Dirac’s Theorem


The graph below shows the available flights of a popular airline. (An edge between two
vertices in the graph means the airline has direct flights between the two corresponding cities.)
Apply Dirac’s Theorem to verify that the following graph is Hamiltonian. What does a
Hamiltonian circuit represent in terms of flights?

Solution:
There are six vertices in the graph, so and every vertex has degree of at least n/2 = 3.
So, by Dirac’s Theorem, the graph is Hamiltonian. This means the graph contains a circuit that
visits each vertex once and returns to the starting vertex without visiting any vertex twice. Here,
a Hamiltonian circuit represents a sequence of flights that visits each city and returns to the
starting city without visiting any city twice. Notice that Dirac’s Theorem does not tell us how to
find the Hamiltonian circuit; it just guarantees that one exists.

Weighted Graphs
A weighted graph is a graph in which each edge is associated with a value, called
a weight. A weighted graph is therefore a special type of labeled graph in which the labels are
numbers (which are usually taken to be positive).
The weight of an edge is often referred to as the "cost" of the edge.
Example: The table below lists the distances in miles between six popular cities that a particular
airline flies to. Suppose a traveler would like to start in Chicago, visit the other five cities this
airline flies to, and return to Chicago. Find three different routes that the traveler could follow,
and find the total distance flown for each route.
Solution: The various options will be simpler to analyze if we first organize the information in a graph.
We can let each city be represented by a vertex. We will draw an edge between two vertices if there is a
flight between the corresponding cities, and we will label each edge with a weight that represents the
number of miles between the two cities.

A route that visits each city just once corresponds to a Hamiltonian circuit. Beginning at
Chicago, one such circuit is Chicago–New York–Dallas–Philadelphia– Atlanta–Washington,
D.C.–Chicago. By adding the weights of each edge in the circuit, we see that the total number of
miles traveled is
713 + 1374 + 1299 + 670 + 544 + 597 = 5197
By trial and error, we can identify two additional routes. One is Chicago– Philadelphia–
Dallas–Washington, D.C.–Atlanta–New York–Chicago. The total weight of the circuit is
665 + 1299 + 1185 + 544 + 748 + 713 = 5154
A third route is Chicago – Washington, D.C. – Dallas – New York – Atlanta –
Philadelphia–Chicago. The total mileage is
597 + 1185 + 1374 + 748 + 670 + 665 = 5239

Planarity of a graph
Planarity of a graph
A puzzle that was posed some time ago goes something like this: Three utility companies
each need to run pipes to three houses. Can they do so without crossing over each other’s pipes
at any point? It might be easier to think about the puzzle visually, as shown below. Go ahead and
try to draw pipes connecting each utility company to each house without letting any pipes cross
over each other.
One way to approach the puzzle is to express the situation in terms of a graph. Each of the houses and
utility companies will be represented by a vertex, and we will draw an edge between two vertices if a pipe
needs to run from one building to the other. If we were not worried about pipes crossing, we could easily
draw a solution, as in the figure on the right

To solve the puzzle, we need to draw an equivalent graph in which no edges cross over each
other. Such a graph is called a planar graph.

Planar Graph
A planar graph is a graph that can be drawn so that no edges intersect each other (except
at vertices).
If the graph is drawn in such a way that no edges cross, we say that we have a planar
drawing of the graph.

EXAMPLE: Identify a Planar Graph


Show that the graph below is planar.
Solution:
As the graph appears currently, several edges intersect each other. However, we can redraw the
graph in an equivalent form in which no edges touch except at vertices by redrawing the two shaded
edges shown below. To verify that the second graph is equivalent to the first, we can label the vertices
and check that the edges join the same vertices in each graph. Because the given graph is equivalent to a
graph whose edges do not intersect, the graph is planar.

If a graph can be drawn in the plane so that no two edges cross it is planar. On the other hand, non-
planar graphs can never ever be drawn in the plane without some edges crossing. However, it may be
possible for a planar graph to be drawn with crossed edges, but it doesn’t make it non-planar. We
underline this below K4 is first drawn with a crossing, and then without any crossings. So K4 is planar.
On the other, no matter how hard you try you will never be able to draw K5 without a crossing.

Euler's Formula
Euler noticed a connection between various features of planar graphs. In addition to edges
and vertices, he looked at the faces of a graph. In a planar graph, the edges divide the graph into
different regions called faces. The region surrounding the graph, or the exterior, is also
considered a face, called the infinite face. (See the figure at the right.) The following
relationship, called Euler’s Formula, is always true.
Euler’s Formula
In a connected planar graph drawn with no intersecting edges, let v be the number of
vertices, e the number of edges, and f the number of faces. Then v + f = e + 2.
Example: Verify Euler’s Formula in a Graph
Count the number of edges, vertices, and faces in the planar graph below, and then verify
Euler’s Formula

Solution
There are seven edges, five vertices, and four faces (counting the infinite face) in the
graph. Thus,
v+f=e+2
5+4=7+2
9=9

You might also like