0% found this document useful (0 votes)
44 views

Group Assignment: SUBJECT: Eulerian Graph, Hamiltonian Graph, Shortest Path and Distance

1. The document describes a group assignment on topics related to graphs, including Eulerian graphs, Hamiltonian graphs, shortest paths, and distance. 2. The group has 4 members from the Bilingual Mathematics Education program studying these topics in 2011 for a mathematics department assignment. 3. The document provides definitions, theorems, algorithms, and examples related to Eulerian graphs, Hamiltonian graphs, and finding the shortest path between vertices in a graph.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Group Assignment: SUBJECT: Eulerian Graph, Hamiltonian Graph, Shortest Path and Distance

1. The document describes a group assignment on topics related to graphs, including Eulerian graphs, Hamiltonian graphs, shortest paths, and distance. 2. The group has 4 members from the Bilingual Mathematics Education program studying these topics in 2011 for a mathematics department assignment. 3. The document provides definitions, theorems, algorithms, and examples related to Eulerian graphs, Hamiltonian graphs, and finding the shortest path between vertices in a graph.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 35

GROUP ASSIGNMENT

SUBJECT : Eulerian Graph, Hamiltonian Graph, Shortest Path and Distance

THIRD GROUP

Members : 1. Dini Rahmadani S 409312016 Attend : times


2. Rini Prautami 409312024 Attend : times
3. Rizki Husnaini 409312023 Attend : times
4. Siti Zulayfa 409312026 Attend : times
Study Program : S1 - Bilingual Mathematics Education
Class : Bilingual Mathematics Education ‘09

MATHEMATICS DEPARTMENT
2011
4.13. Eulerian Graph
Definition 4.13.1:
Graph connected G is called Eulerian Graph if
there is a closed trail that insist every edge of G.
Its trail is called Eulerian trail.
Semi Eulerian Graph if its not a closed trail.
b d b a b
d f

a
a e

c e c c d e
(i) (ii) (iii)

From the figure we get:


a. Figure (i) is Semi Eulerian Graph, because there is trail (not
closed trail) that insist every edge of G, such that: c, a, b, d,
e, b, c, e.
b. Figure (ii) is Eulerian Graph, because there is closed trail that
insist every edge of G, such that: a, b, c, d, e, c, a.
c. Figure (iii) is not Eulerian Graph, because there is no trail.
Lemma 4.13.1 :
If G is a graph that each vertex has at least two
degree, so that G is make a cycle.
Algorithm of proving

1) If G has a loop or multiple edges.


2) Suppose that G is a simple graph and v is any vertex in G.
3) Will be shown that G is make a cycle.
4) We make edge sequence v0, v1, v2, … inductively by
selecting any kind of vertex v1 which relate with v0.
5) For i ≥ 1 choose vi+1 is any kind of vertex which relate with
vi except vi-k (vertex vi+1 be guaranteed our hypothesis).
6) Because many infinite vertex G, then we must choose the
vertex that has been selected. It shown that a cycle.
Theorem 4.13.2 :
A connected graph G is Eulerian Graph if only
if each of vertex has even degree.

(i) Eulerian Graph (ii) Semi Eulerian Graph


Algorithm of proving

(i) Will be shown : A connected graph G is Eulerian Graph


so that each of vertex has even degree.
1) Because G is Eulerian Graph, every edges in G
traversed only once and return to the initial
vertex.
2) Will be shown each of vertex has even degree.
3) It shows that Eulerian trail through vertex v will
obtain the amount edges which coming v is equal
to the amount edges which left v without repeat a
edges. So, v is even degree.
(ii) Will be shown : Each of vertex has even degree so that a
connected graph G is Eulerian Graph.
1) Because connected and each vertex degree is even,
then the degree of each vertex at least two. This
shows that G making cycle, called cycle C.
2) If C contains all paths of G, then the proof is
complete. If it does not mean there is a path from C
to H new sub graph but are still in G. H has fewer
lines than G and each vertex degree is even.
3) According to induction hypothesis, every graph H
has at least one node ally with C, to connect vertices
required Euler trail by following the path in C so that
each edge in H can be passed.
4) Euler trail path from sub graph H contains a vertex
and then continued along the path C that reached
the vertex of sub graph H, then this process ends
when the initial vertex is found again.
Theorem 4.13.3 :
A connected graph G is Semi Eulerian Graph if
only if in the graph has exactly odd degree for
two vertices.

(i) Eulerian Graph (ii) Semi Eulerian Graph


Algorithm of proving

(i) Will be shown : A connected graph G is Semi Eulerian Graph


so that in the graph has exactly odd degree for two vertices.
1) Suppose that a connected graph G has vertices u and v.
2) Will be shown in the graph has exactly odd degree for
two vertices.
3) Because of G is Semi Eulerian Graph, so that has a trail
from u to v in graph G.
4) If u and v adjacent based on Theorem 4.13.2, they are
even degree and all of vertices are even degree, but
because of u and v is not adjacent so that u and v are
odd degree.
(ii) Will be shown : In the graph has exactly odd degree for
two vertices so that a connected graph G is Semi Eulerian
Graph.
1) Suppose that a connected graph G is Eulerian
Graph.
2) Will be shown a connected graph G is Semi
Eulerian Graph.
3) Based on Theorem 4.13.2, all of vertices in G are
even degree include initial vertex and last vertex.
It is contradiction with known before, there are
two vertices has odd degree. So that, a connected
graph G is Semi Eulerian Graph.
Algorithm of Fleury

If G is Eulerian Graph, the following steps is to


generate trail Euler
Step 1 Start from any vertices u
Step 2 At each step, through any existing edge,
by selecting a bridge if there is no other choice
Step 3 After through the edge, remove every
vertex degree 0 and choose another path
Step 4 Stop if there is no other side
1) Start from vertex a and
c moving from a. Choose
a b d
e edge ab, and erase it.
l f
2) Then, continue with edges
bc, cd, de, ef, fg, gh, hi, ij,
k j h g jk, kl and erase them.
i 3) For next trail (if there is not
choose) continue with
edges lj, ji, ih, hg, gf, fd, db,
bl, and la.
4.14. Hamiltonian Graph
Definition 4.14.:
Graph connected G is called Hamiltonian Graph
if there is a cycle that insist every vertices of G.
Its cycle is called Hamiltonian cycle.
Semi Hamiltonian Graph if there is a simple
path (not a closed path) that through every
vertices of G.
e a
a a g
f
b c b
d

c c b d e
(i) (ii) (iii)

From the figure we get:


a. Figure (i) is Semi Hamiltonian Graph, because there is a simple path
(not closed path) that insist every vertices of G, such that: a, b, e, d,
c.
b. Figure (ii) is Hamiltonian Graph, because there is a close simple path
that insist every vertices of G, such that: a, b, c, a.
c. Figure (iii) is not Hamiltonian Graph, because there is no a simple
path.
4.15. Shortest Path and Distance
To find the shortest path between vertices s
and t is the search path from s to t that has
the fewest edges. To find the shortest path
between two vertices can use the following
algorithm.
4.15.1 Shortest Path Algorithm
This algorithm is to find the shortest path between s and t in
the graph G. In this algorithm, L indicates the set of vertices
labeled and a predecessor vertices and the vertices in L are
used to label the vertices a.

Step 1 : (Start with s)


Label 0 at s, let L = {s} and s do not have a predecessor

Step 2 : (Check for equipment)


If t ∉ L, proceed to step three. If t ∈ L, stop. The label for t is
the distance from s to t. Shortest path from s to t is formed by
using the reverse order vertices t, the predecessor of t i.e. t 1, t1
is t2 predecessor and so on until a vertices s.
Step 3: (Find the next vertices)
If t ∉ L, determine the vertices that are not labeled in G is
adjacent to the vertices in L with the largest number label k. If
this vertices does not exist, then there is no path from s to t.
Otherwise give to the new vertices label k + 1 and put the
knot on L. If b is one of the newly discovered vertices and b
incident with k vertices labeled c in L, i.e. c is the precursor b.
(If more than one option to point the predecessor, then select
at random) return to step 2. It can be shown that the label
given to each vertices premises above algorithm is the
distance s to t.
Example 4.15.1

Determine the distance of s to t in graph G in the


Picture 4.15.1

Picture 4.15.1 : Graph G


Solution
Step I

S given label of 0 and determine of L = {s}. Vertices of


s is not have preface.
Step II

t ∉ L so found the vertices which relation with s


are vertices of a , b, and c. And give label of vertices
is 1 and L = {s, a, b, c} and s preface of a , b, and c.
Step III

Found the vertices which relation with t, so t ∉ L so the


process is stop. T is stop in 2(a) and L = {s, a, b, c, t}.
The distance of vertices s to t are 2 with the shortest
path are s and a.
4.15.2 Weighted Graph
Definition :

Weighted Graph is a graph which every edges given


a number is weighted. Weight of path is the number
of weight from the edges.
Example 4.15.2 :

Determine weight of edges ab and de. Determine


weight of path a ,c, b, d in this graph.
Solution

From the picture will shown that weighted of edges


ab is 1 and de is 1. Weighted of path a, c, b, d is (2 + 1
+ 5) = 8
4.15.3 Dijicstra Algorithm
Dijicstra Algorithm is used to find the shortest path
and distance from vertex s to every other vertices in
a weighted graph and the weights given to each path
is not negative. In this algorithm P is the set of vertex
including the vertex in a permanent label.
Predecessor vertex is a vertex in P that are used to
label a. Weight u v path is denoted by w (u, v) and if
there is no u v path, it will be written w (u, v) = ∞.
The order of the steps followed in this algorithm is as
follows:

1st Step : Start from the initial vertices

2nd Step : Label every other vertices

3rd Step : Find the vertices closest to the vertices


on P and the correct label

4th Step : Check for completeness


Example:

Find the distance and the shortest path from vertices s to e


in a weighted graph G below.

3 S
a
2
d 2
1
1
b
c 4

1
e
Solution

1st Step :
3 0( )
a S*
2
d 2
1
1
b
c 4

1
e

Vertex s is labeled 0 and P = {s}. S predecessor does not exist.


s is labeled 0 and P = {s}. S predecessor does not exist.
2nd Step :

3( s ) 3 S* 0 (  )
a
2
2(s) d* 2
1
1
b
c 4 1( s )
 (s)
1
e
 (s)

Vertex adjacent to s is a, b and d, then P = {s, a, b, d}. w (s, a) =


3, a vertex labeled 3, w (s, b) = 1, vertex b is labeled 1, and w (s,
d) = 2, the node labeled d 2, while for the vertex. Another w(s,
v) = ∞ that are labeled s.
3rd Step :
3 S* 0 (  )
3( s ) a
2
2 ( s ) d* 2
1
1
b
c 4 1( s )
5 (b )
1
e
 (s)

P = {s, a, b, c, d}. Since d has the smallest label, then set as a


permanent knot, in order to obtain the image above.
4th Step :
3 S* 0 (  )
3( s ) a
2
2 ( s ) d* 2
1
1
b
c 4 1( s )
5 (b )
1
e*
3(d )

P = {s, a, b, c, d, e}. Because of (label of d) + w(d,e) = 2 + 1 = 3


is lest than (label of c) + w(c,e) = 5 + 1 = 6, then the permanent
label of e is 3. So, the distance of the vertex e is 3 with the
shortest path is s, d, e.

You might also like