0% found this document useful (0 votes)
96 views11 pages

W9 Graphs Theory PDF

Graph theory is the study of graphs, which are mathematical objects consisting of vertices and edges. The key concepts introduced are: 1) A graph is formally defined as an ordered pair (V,E) where V is a set of vertices and E is a set of 2-element subsets of V representing edges. 2) Two graphs are equal if they have the same vertex and edge sets. Graphs that are not equal but have the same underlying structure are called isomorphic. 3) An isomorphism between two graphs is a bijection between their vertex sets that preserves edges - two vertices are connected by an edge in one graph if and only if their images under the bijection are connected in the

Uploaded by

vererar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views11 pages

W9 Graphs Theory PDF

Graph theory is the study of graphs, which are mathematical objects consisting of vertices and edges. The key concepts introduced are: 1) A graph is formally defined as an ordered pair (V,E) where V is a set of vertices and E is a set of 2-element subsets of V representing edges. 2) Two graphs are equal if they have the same vertex and edge sets. Graphs that are not equal but have the same underlying structure are called isomorphic. 3) An isomorphism between two graphs is a bijection between their vertex sets that preserves edges - two vertices are connected by an edge in one graph if and only if their images under the bijection are connected in the

Uploaded by

vererar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Chapter 4

Graph Theory

Investigate!
In the time of Euler, in the town of Königsberg in Prussia, there
was a river containing two islands. The islands were connected
to the banks of the river by seven bridges (as seen below). The
bridges were very beautiful, and on their days off, townspeople
would spend time walking over the bridges. As time passed, a
question arose: was it possible to plan a walk so that you cross
each bridge once and only once? Euler was able to answer this
question. Are you?

! Attempt the above activity before proceeding !


Graph Theory is a relatively new area of mathematics, first studied by
the super famous mathematician Leonhard Euler in 1735. Since then it
has blossomed in to a powerful tool used in nearly every branch of science
and is currently an active area of mathematics research.
The problem above, known as the Seven Bridges of Königsberg, is the
problem that originally inspired graph theory. Consider a “different”
problem: Below is a drawing of four dots connected by some lines. Is
it possible to trace over each line once and only once (without lifting up
your pencil, starting and ending on a dot)?

There is an obvious connection between these two problems. Any


path in the dot and line drawing corresponds exactly to a path over the
bridges of Königsberg.

231
232 4. Graph Theory

Pictures like the dot and line drawing are called graphs. Graphs are
made up of a collection of dots called vertices and lines connecting those
dots called edges. When two vertices are connected by an edge, we say
they are adjacent. The nice thing about looking at graphs instead of
pictures of rivers, islands and bridges is that we now have a mathematical
object to study. We have distilled the “important” parts of the bridge
picture for the purposes of the problem. It does not matter how big
the islands are, what the bridges are made out of, if the river contains
alligators, etc. All that matters is which land masses are connected to
which other land masses, and how many times.
We will return to the question of finding paths through graphs later.
But first, here are a few other situations you can represent with graphs:

Example 4.0.1

Al, Bob, Cam, Dan, and Euler are all members of the social net-
working website Facebook. The site allows members to be “friends”
with each other. It turns out that Al and Cam are friends, as are Bob
and Dan. Euler is friends with everyone. Represent this situation
with a graph.
Solution. Each person will be represented by a vertex and each
friendship will be represented by an edge. That is, two vertices will
be adjacent (there will be an edge between them) if and only if the
people represented by those vertices are friends.
A B

E
C D

Example 4.0.2

Each of three houses must be connected to each of three utilities.


Is it possible to do this without any of the utility lines crossing?
Solution. We will answer this question later. For now, notice how
we would ask this question in the context of graph theory. We
are really asking whether it is possible to redraw the graph below
without any edges crossing (except at vertices). Think of the top
row as the houses, bottom row as the utilities.
4.1. Definitions 233

4.1 Definitions

Investigate!
Which (if any) of the graphs below are the same?

The graphs above are unlabeled. Usually we think of a graph


as having a specific set of vertices. Which (if any) of the graphs
below are the same?
f b c f c b f v1 v2 v3
b d

a c e a d e a e d v6 v5 v4

Actually, all the graphs we have seen above are just drawings
of graphs. A graph is really an abstract mathematical object con-
sisting of two sets V and E where E is a set of 2-element subsets
of V. Are the graphs below the same or different?

Graph 1:
V  {a, b, c, d, e},
E  {{a, b}, {a, c}, {a, d}, {a, e}, {b, c}, {d, e}}.
Graph 2:
V  {v 1 , v2 , v 3 , v 4 , v 5 },
E  {{v 1 , v 3 }, {v1 , v 5 }, {v 2 , v 4 }, {v 2 , v 5 }, {v 3 , v 5 }, {v 4 , v 5 }}.

! Attempt the above activity before proceeding !


Before we start studying graphs, we need to agree upon what a graph
is. While we almost always think of graphs as pictures (dots connected
by lines) this is fairly ambiguous. Do the lines need to be straight? Does
it matter how long the lines are or how large the dots are? Can there be
two lines connecting the same pair of dots? Can one line connect three
dots?
The way we avoid ambiguities in mathematics is to provide concrete
and rigorous definitions. Crafting good definitions is not easy, but it is
incredibly important. The definition is the agreed upon starting point
from which all truths in mathematics proceed. Is there a graph with no
edges? We have to look at the definition to see if this is possible.
We want our definition to be precise and unambiguous, but it also
must agree with our intuition for the objects we are studying. It needs to
be useful: we could define a graph to be a six legged mammal, but that
234 4. Graph Theory

would not let us solve any problems about bridges. Instead, here is the
(now) standard definition of a graph.
Graph Definition.

A graph is an ordered pair G  (V, E) consisting of a nonempty set


V (called the vertices) and a set E (called the edges) of two-element
subsets of V.

Strange. Nowhere in the definition is there talk of dots or lines. From


the definition, a graph could be
({a, b, c, d}, {{a, b}, {a, c}, {b, c}, {b, d}, {c, d}}).
Here we have a graph with four vertices (the letters a, b, c, d) and five
edges (the pairs {a, b}, {a, c}, {b, c}, {b, d}, {c, d})).
Looking at sets and sets of 2-element sets is difficult to process. That
is why we often draw a representation of these sets. We put a dot down
for each vertex, and connect two dots with a line precisely when those
two vertices are one of the 2-element subsets in our set of edges. Thus
one way to draw the graph described above is this:
a b

c d
However we could also have drawn the graph differently. For example
either of these:
a d

c b a b c d
We should be careful about what it means for two graphs to be “the
same.” Actually, given our definition, this is easy: Are the vertex sets
equal? Are the edge sets equal? We know what it means for sets to be
equal, and graphs are nothing but a pair of two special sorts of sets.

Example 4.1.1

Are the graphs below equal?

G1  ({a, b, c}, {{a, b}, {b, c}}); G2  ({a, b, c}, {{a, c}, {c, b}}).

Solution. No. Here the vertex sets of each graph are equal, which
is a good start. Also, both graphs have two edges. In the first graph,
we have edges {a, b} and {b, c}, while in the second graph we have
4.1. Definitions 235

edges {a, c} and {c, b}. Now we do have {b, c}  {c, b}, so that is
not the problem. The issue is that {a, b} , {a, c}. Since the edge
sets of the two graphs are not equal (as sets), the graphs are not
equal (as graphs).

Even if two graphs are not equal, they might be basically the same. The
graphs in the previous example could be drawn like this:
G1 G2

a b c a c b
Graphs that are basically the same (but perhaps not equal) are called
isomorphic. We will give a precise definition of this term after a quick
example:

Example 4.1.2

Consider the graphs:


whe re and;
whe re and.
Are these graphs the same?
Solution. The two graphs are NOT equal. It is enough to notice
that V1 , V2 since a ∈ V1 but a < V2 . However, both of these
graphs consist of three vertices with edges connecting every pair
of vertices. We can draw them as follows:
a u

b c v w
Clearly we want to say these graphs are basically the same, so
while they are not equal, they will be isomorphic. We can rename
the vertices of one graph and get the second graph as the result.

Intuitively, graphs are isomorphic if they are basically the same, or


better yet, if they are the same except for the names of the vertices. To
make the concept of renaming vertices precise, we give the following
definitions:
236 4. Graph Theory

Isomorphic Graphs.
An isomorphism between two graphs G1 and G2 is a bijection
f : V1 → V2 between the vertices of the graphs such that {a, b} is
an edge in G1 if and only if { f (a), f (b)} is an edge in G2 .
Two graphs are isomorphic if there is an isomorphism between
them. In this case we write G1  G2 .

An isomorphism is simply a function which renames the vertices. It


must be a bijection so every vertex gets a new name. These newly named
vertices must be connected by edges precisely when they were connected
by edges with their old names.

Example 4.1.3

Decide whether the graphs G1  {V1 , E1 } and G2  {V2 , E2 } are


equal or isomorphic.
V1  {a, b, c, d}, E1  {{a, b}, {a, c}, {a, d}, {c, d}}
V2  {a, b, c, d}, E2  {{a, b}, {a, c}, {b, c}, {c, d}}
Solution. The graphs are NOT equal, since {a, d} ∈ E1 but {a, d} <
E2 . However, since both graphs contain the same number of ver-
tices and same number of edges, they might be isomorphic (this is
not enough in most cases, but it is a good start).
We can try to build an isomorphism. How about we say f (a) 
b, f (b)  c, f (c)  d and f (d)  a. This is definitely a bijection, but
to make sure that the function is an isomorphism, we must make
sure it respects the edge relation. In G1 , vertices a and b are connected
by an edge. In G2 , f (a)  b and f (b)  c are connected by an edge.
So far, so good, but we must check the other three edges. The edge
{a, c} in G1 corresponds to { f (a), f (c)}  {b, d}, but here we have
a problem. There is no edge between b and d in G2 . Thus f is NOT
an isomorphism.
Not all hope is lost, however. Just because f is not an isomor-
phism does not mean that there is no isomorphism at all. We can
try again. At this point it might be helpful to draw the graphs to
see how they should match up.
a a
G1 : G2 :

d b d b

c c

Alternatively, notice that in G1 , the vertex a is adjacent to every


other vertex. In G2 , there is also a vertex with this property: c. So
4.1. Definitions 237

build the bijection g : V1 → V2 by defining g(a)  c to start with.


Next, where should we send b? In G1 , the vertex b is only adjacent
to vertex a. There is exactly one vertex like this in G2 , namely d.
So let g(b)  d. As for the last two, in this example, we have a free
choice: let g(c)  b and g(d)  a (switching these would be fine as
well).
We should check that this really is an isomorphism. It is defi-
nitely a bijection. We must make sure that the edges are respected.
The four edges in G1 are

{a, b}, {a, c}, {a, d}, {c, d}.

Under the proposed isomorphism these become

{ g(a), g(b)}, { g(a), g(c)}, { g(a), g(d)}, { g(c), g(d)}

{c, d}, {c, b}, {c, a}, {b, a},


which are precisely the edges in G2 . Thus g is an isomorphism, so
G1  G2

Sometimes we will talk about a graph with a special name (like K n or


the Peterson graph) or perhaps draw a graph without any labels. In this
case we are really referring to all graphs isomorphic to any copy of that
particular graph. A collection of isomorphic graphs is often called an
isomorphism class. 1
There are other relationships between graphs that we care about, other
than equality and being isomorphic. For example, compare the following
pair of graphs:

These are definitely not isomorphic, but notice that the graph on the
right looks like it might be part of the graph on the left, especially if we
draw it like this:

1This is not unlike geometry, where we might have more than one copy of a particular
triangle. There instead of isomorphic we say congruent.
238 4. Graph Theory

We would like to say that the smaller graph is a subgraph of the larger.
We should give a careful definition of this. In fact, there are two
reasonable notions for what a subgraph should mean.
Subgraphs.

We say that G0  (V 0 , E0) is a subgraph of G  (V, E), and write


G0 ⊆ G, provided V 0 ⊆ V and E0 ⊆ E.
We say that G0  (V 0 , E0) is an induced subgraph of G  (V, E)
provided V 0 ⊆ V and every edge in E whose vertices are still in V 0
is also an edge in E0.

Notice that every induced subgraph is also an ordinary subgraph,


but not conversely. Think of a subgraph as the result of deleting some
vertices and edges from the larger graph. For the subgraph to be an
induced subgraph, we can still delete vertices, but now we only delete
those edges that included the deleted vertices.

Example 4.1.4

Consider the graphs:


f f f

d e d d d

a b c a b c a b c a b c
G1 G2 G3 G4

Here both G2 and G3 are subgraphs of G1 . But only G2 is an


induced subgraph. Every edge in G1 that connects vertices in G2 is
also an edge in G2 . In G3 , the edge {a, b} is in E1 but not E3 , even
though vertices a and b are in V3 .
The graph G4 is NOT a subgraph of G1 , even though it looks
like all we did is remove vertex e. The reason is that in E4 we have
the edge {c, f } but this is not an element of E1 , so we don’t have
the required E4 ⊆ E1 .

Back to some basic graph theory definitions. Notice that all the graphs
we have drawn above have the property that no pair of vertices is con-
nected more than once, and no vertex is connected to itself. Graphs like
these are sometimes called simple, although we will just call them graphs.
This is because our definition for a graph says that the edges form a set of
2-element subsets of the vertices. Remember that it doesn’t make sense to
say a set contains an element more than once. So no pair of vertices can
be connected by an edge more than once. Also, since each edge must be
4.1. Definitions 239

a set containing two vertices, we cannot have a single vertex connected to


itself by an edge.
That said, there are times we want to consider double (or more) edges
and single edge loops. For example, the “graph” we drew for the Bridges
of Königsberg problem had double edges because there really are two
bridges connecting a particular island to the near shore. We will call
these objects multigraphs. This is a good name: a multiset is a set in
which we are allowed to include a single element multiple times.
The graphs above are also connected: you can get from any vertex to
any other vertex by following some path of edges. A graph that is not
connected can be thought of as two separate graphs drawn close together.
For example, the following graph is NOT connected because there is no
path from a to b:

a b

Vertices in a graph do not always have edges between them. If we add


all possible edges, then the resulting graph is called complete. That is, a
graph is complete if every pair of vertices is connected by an edge. Since
a graph is determined completely by which vertices are adjacent to which
other vertices, there is only one complete graph with a given number of
vertices. We give these a special name: K n is the complete graph on n
vertices.
Each vertex in K n is adjacent to n −1 other vertices. We call the number
of edges emanating from a given vertex the degree of that vertex. So every
vertex in K n has degree n − 1. How many edges does K n have? One might
think the answer should be n(n − 1), since we count n − 1 edges n times
(once for each vertex). However, each edge is incident to 2 vertices, so we
counted every edge exactly twice. Thus  there are n(n − 1)/2 edges in K n .
Alternatively, we can say there are n2 edges, since to draw an edge we
must choose 2 of the n vertices.
In general, if we know the degrees of all the vertices in a graph, we
can find the number of edges. The sum of the degrees of all vertices will
always be twice the number of edges, since each edge adds to the degree of
two vertices. Notice this means that the sum of the degrees of all vertices
in any graph must be even!
This is our first example of a general result about all graphs. It seems
innocent enough, but we will use it to prove all sorts of other statements.
So let’s give it a name and state it formally.
240 4. Graph Theory

Lemma 4.1.5 Handshake Lemma. In any graph, the sum of the degrees of
vertices in the graph is always twice the number of edges.
The handshake lemma2 is sometimes called the degree sum formula,
and can be written symbolically as
Õ
d(v)  2e.
v∈V

Here we are using the notation d(v) for the degree of the vertex v.
One use for the lemma is to actually find the number of edges in a
graph. To do this, you must be given the degree sequence for the graph
(or be able to find it from other information). This is a list of every degree
of every vertex in the graph, generally written in non-increasing order.

Example 4.1.6

How many vertices and edges must a graph have if its degree
sequence is
(4, 4, 3, 3, 3, 2, 1)?

Solution. The number of vertices is easy to find: it is the number


of degrees in the sequence: 7. To find the number of edges, we
compute the degree sum:

4 + 4 + 3 + 3 + 3 + 2 + 1  20,

so the number of edges is half this: 10.

The handshake lemma also tells use what is not possible.

Example 4.1.7

At a recent math seminar, 9 mathematicians greeted each other by


shaking hands. Is it possible that each mathematician shook hands
with exactly 7 people at the seminar?
Solution. It seems like this should be possible. Each mathemati-
cian chooses one person to not shake hands with. But this cannot
happen. We are asking whether a graph with 9 vertices can have
each vertex have degree 7. If such a graph existed, the sum of the
degrees of the vertices would be 9 · 7  63. This would be twice the
number of edges (handshakes) resulting in a graph with 31.5 edges.
That is impossible. Thus at least one (in fact an odd number) of the

2A lemma is a mathematical statement that is primarily of importance in that it is used


to establish other results.
4.1. Definitions 241

mathematicians must have shaken hands with an even number of


people at the seminar.

We can generalize the previous example to get the following proposi-


tion.3
Proposition 4.1.8 In any graph, the number of vertices with odd degree must be
even.
Proof. Suppose there were a graph with an odd number of vertices with
odd degree. Then the sum of the degrees in the graph would be odd,
which is impossible, by the handshake lemma. qed
We will consider further applications of the handshake lemma in the
exercises.
One final definition: we say a graph is bipartite if the vertices can be
divided into two sets, A and B, with no two vertices in A adjacent and no
two vertices in B adjacent. The vertices in A can be adjacent to some or
all of the vertices in B. If each vertex in A is adjacent to all the vertices in
B, then the graph is a complete bipartite graph, and gets a special name:
K m,n , where |A|  m and |B|  n. The graph in the houses and utilities
puzzle is K 3,3 .

Named Graphs.
Some graphs are used more than others, and get special names.

Kn The complete graph on n vertices.


K m,n The complete bipartite graph with sets of m and n vertices.
Cn The cycle on n vertices, just one big loop.
Pn The path on n + 1 vertices (so n edges), just one long path.

K5 K2,3 C6 P5

3A proposition is a general statement in mathematics, similar to a theorem, although


generally of lesser importance.

You might also like