0% found this document useful (0 votes)
3 views24 pages

Graph Theory

The document discusses concepts in graph theory, including Eulerian and Hamiltonian graphs, and defines key terms such as connected graphs, degrees of vertices, and bipartite graphs. It highlights the conditions for a graph to have an Euler tour or trail, and introduces the concept of isomorphism between graphs. Additionally, it touches on planar graphs and complete graphs, emphasizing the complexity of determining Hamiltonian graphs.

Uploaded by

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

Graph Theory

The document discusses concepts in graph theory, including Eulerian and Hamiltonian graphs, and defines key terms such as connected graphs, degrees of vertices, and bipartite graphs. It highlights the conditions for a graph to have an Euler tour or trail, and introduces the concept of isomorphism between graphs. Additionally, it touches on planar graphs and complete graphs, emphasizing the complexity of determining Hamiltonian graphs.

Uploaded by

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

Can you draw the

above figure in one


continuous trace with
no line being drawn
twice?

1
How about this
one?

2
Definitions:

A graph is connected if it is possible to


walk from any vertex to any other
vertex.
Two nodes (vertices) are adjacent if
there is at least one edge between them.
The degree of a vertex is the
adjacen number of edges emanating from it.
t

This node
has degree Note: Each loop
5. counts as two
edges emanating
connected graph from a node.
3
Picture only what is
essential to the problem.

The residents of Königsberg,


Königsberg Germany,
wondered if it was possible to take a
walking tour of the town that crossed each
of the seven bridges over the Presel river
exactly once.
4
Is it possible to start at some node
and take a walk that uses each
edge exactly once, and ends at the
starting node?

5
1
Original:

2 3

4
Redrawn: 2

4 1
3
You can redraw the original picture as
long as for every edge between nodes i
and j in the original you put an edge
between nodes i and j in the redrawn
version (and you put no other edges in 6
Has no tour that uses each edge
exactly once.

(Even if we allow the walk to start and


finish in different places.)

Can you see why?


Leonard Euler 1736 proved it
(father of graph theory)
7
A walk in a graph is called an Euler tour if it
starts and ends in the same place and uses each
edge exactly once.

A walk in a graph is called an Euler trail if it uses


each edge exactly once.

If a graph has an Euler tour, it is said to be an


Eulerian graph.
8
The problem in our language:

Show that is not Eulerian.

In fact, it contains no Euler trail.

9
Theorem (Euler):

1. A connected graph G is
Eulerian

G is connected and has no
vertices of odd degree
2. A connected graph G is has
an Euler trail from node a to
some other node b

G is connected and a  b are
the only two nodes of odd
10
degree
A directed graph is a graph
where each edge is directed
from one of its endpoints to the
other.
Example:

Exercise: If a directed graph G


has the property that
# of edges leaving a node =
# of edges coming in
Then G has a directed Eulerian
tour. 11
A graph has a Hamiltonian
tour if there is a tour that
visits every vertex exactly
once (and returns to its
starting point).

A graph with a Hamiltonian


tour is called a Hamiltonian
graph.

12
Yes.

A graph of the vertices of a


dodecahedron.
13
Is it Hamiltonian?
This one has a Hamiltonian path,
but not a Hamiltonian tour.

This one has an Euler tour, but no Hamiltonian path.


14
Given a graph, what is a fast
way to determine if it is
Hamiltonian?

Can we give a
characterization of
Hamiltonian graphs that is as
simple as the one for Eulerian
graphs?

15
No one knows. Deciding if
a graph is Hamiltonian is
NPcomplete.

There is probably no nice


characterization of
Hamiltonian graphs the
way there was with
Eulerian graphs.

16
Bipartite Graphs
A bipartite graph is a graph G whose vertex set V can be partitioned
into two non empty sets V1 and V2 in such a way that every edge of G
joins a vertex in V1 to a vertex in V2.

An alternative way of thinking about it is coloring the vertices in V1


one color and those in V2 another color. Then adjacent vertices would
have different colors.

17
Bipartite Graphs
If V1 has r vertices and V2 has s vertices then the complete bipartite
graph is written as Kr,s.

If in a bipartite graph G with V1 and V2 as above we have that every


vertex in V1 is adjacent to every vertex in V2 then G is a complete
bipartite graph.

The graph K3,4

18
Examples: Bipartite Graphs
Graph between courses and class rooms. Application?

Graph between documents and keywords. Application?

Graph between cars and parking slots.

19
Isomorphism

Let G1 and G1 be two graphs and let f be a function from the vertex set
of G1 to the vertex set of G2. Suppose that

• f is one-to-one and onto


• f(v) is adjacent to f(w) in G2 if and only if v is adjacent to w in
G1.

Then we say that the function f is an isomorphism and that the two
graphs G1 and G2 are isomorphic.

20
Isomorphism
So two graphs G1 and G2 are isomorphic if there is a one-to-one
correspondence between vertices of G1 and those of G2

with the property that if two vertices of G1 are adjacent then so are
their images in G2.

If two graphs are isomorphic then as far as we are concerned they


are the same graph though the location of the vertices may be
Cut lines
different.
1 2 3 1 2 3

4 5 6 6 5 4

Sum cut = 8 Sum cut = 4 21


Isomorphism
How many different ways of drawing a graph, such that all
drawings are isomorphic?
1 2 3 2 3 1

4 5 6 4 5 6

1 3 2 3 1 2
n! x n!

4 5 6
3! X 3! = 36
4 5 6

2 1 3 3 2 1

4 5 6 4 5 6 22
Planarism & Platonic Graph
When a graph can be drawn without any of the edges crossing we
say that it is a planar graph

A non-planar depiction of a cube A planar depiction of a cube


23
Complete Graph & Sub-
Graph
A complete graph is a graph where every pair of distinct vertices are
adjacent. A complete graph on n vertices is denoted by Kn (or
sometimes by K(n) ). So, for example, the figure shows a graph K5.

The Graph K5
We say that a graph G1 is a subgraph of a graph G2 if G1 is
isomorphic to a graph all of whose vertices and edges are in G2.

Note that by our definition a graph is always a subgraph of itself.


24

How many K in a K ?

You might also like