eulerian graph hamiltonian cyclegn.dronacharya.info/itdept/downloads/question... · a connected...

12
Eulerian Graph & Hamiltonian Cycle

Upload: others

Post on 24-Jun-2020

63 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Eulerian Graph Hamiltonian Cyclegn.dronacharya.info/itDept/Downloads/Question... · A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose

Eulerian Graph

&

Hamiltonian Cycle

Page 2: Eulerian Graph Hamiltonian Cyclegn.dronacharya.info/itDept/Downloads/Question... · A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose

Definitions A trail is a walk in which all the edges, but not necessarily all the vertices, are different. A path is a walk in which all the edges and all the vertices are different.

walk vzzywxy is a trail walk vwxyz is a path

Page 3: Eulerian Graph Hamiltonian Cyclegn.dronacharya.info/itDept/Downloads/Question... · A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose

Definitions Eulerian Graph: A connected graph is Eulerian if it contains a closed trail that includes every edge; such a trail is an Eulerian trail. Hamiltonian Cycle: A connected graph is Hamiltonian if it contains a cycle that includes every vertex; such a cycle is a Hamiltonian cycle.

Both Eulerian and Hamiltonian

Hamiltonian Cycle: a b c d e g f a & a f e d c g b a

Eulerian Trails: a b c d e f b g c e g f a & a f g c d e g b c e f b a

Page 4: Eulerian Graph Hamiltonian Cyclegn.dronacharya.info/itDept/Downloads/Question... · A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose

Eulerian but not Hamiltonian Hamiltonian but not Eulerian

Neither Eulerian nor Hamiltonian ? ?

Page 5: Eulerian Graph Hamiltonian Cyclegn.dronacharya.info/itDept/Downloads/Question... · A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose

THEOREM 2-4 A given connected graph G is an Euler graph if and only if all vertices of G are of even degree. Proof: Suppose that G is an Euler graph. It therefore contains an Euler line (which is a closed walk). In tracing this walk we observe that every time the walk meets a vertex v it goes through two "new" edges incident on v-with one we "entered" v and with the other "exited." This is true not only of all intermediate vertices of the walk but also of the terminal vertex, because we "exited" and "entered" the same vertex at the beginning and end of the walk, respectively. Thus if G is an Euler graph, the degree of every vertex is even.

To prove the sufficiency of the condition, assume that all vertices of G are of even degree. Now we construct a walk starting at an arbitrary vertex v and going through the edges of G such that no edge is traced more than once. We continue tracing as far as possible. Since every vertex is of even degree, we can exit from every vertex we enter; the tracing cannot stop at any vertex but v. And since v is also of even degree, we shall eventually reach v when the tracing comes to an end. If this closed walk h we just traced includes all the edges of G, G is an Euler graph. If not, we remove from G all the edges in h and obtain a subgraph h' of G formed by the remaining edges.

Page 6: Eulerian Graph Hamiltonian Cyclegn.dronacharya.info/itDept/Downloads/Question... · A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose

Since both G and h have all their vertices of even degree, the degrees of the vertices of h' are also even. Moreover, h' must touch h at least at one vertex a, because G is connected. Starting from a, we can again construct a new walk in graph h'. Since all the vertices of h' are of even degree, this walk in h' must terminate at vertex a; but this walk in h' can be combined with h to form a new walk, which starts and ends at vertex v and has more edges than h. This process can be repeated until we obtain a closed walk that traverses all the edges of G. Thus G is an Euler graph.

Page 7: Eulerian Graph Hamiltonian Cyclegn.dronacharya.info/itDept/Downloads/Question... · A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose

THEOREM A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose graph G can be decomposed into cycles; that is, G is a union of edge-disjoint cycles. Since the degree of every vertex in a circuit is two, the degree of every vertex in G is even. Hence G is an Euler graph.

Conversely, let G be an Euler graph. Consider a vertex v1. There are at least two edges incident at v1. Let one of these edges be between v1 and v2. Since vertex v2 is also of even degree, it must have at least another edge, say between v2 and v3. Proceeding in this fashion, we eventually arrive at a vertex that has previously been traversed, thus forming a circuit ¿. Let us remove ¿ from G. All vertices in the remaining graph (not necessarily connected) must also be of even degree. From the remaining graph remove another circuit in exactly the same way as we removed ¿ from G. Continue this process until no edges are left. Hence the theorem.

Page 8: Eulerian Graph Hamiltonian Cyclegn.dronacharya.info/itDept/Downloads/Question... · A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose

Properties of

Hamiltonian Graph

Page 9: Eulerian Graph Hamiltonian Cyclegn.dronacharya.info/itDept/Downloads/Question... · A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose

The problem of deciding whether a given graph is Hamiltonian, however, no such condition is known, and the search for necessary or sufficient conditions for a graph to be Hamiltonian is still a major area of study in graph theory.

Page 10: Eulerian Graph Hamiltonian Cyclegn.dronacharya.info/itDept/Downloads/Question... · A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose

THEOREM In a complete graph with n vertices there are (n - 1)/2 edge-disjoint Hamil- tonian circuits, if n is an odd number > 3. Proof. A complete graph G of n vertices has n(n-1)/2 edges, and a Hamiltonian circuit in G consists of n edges. Therefore, the number of edge-disjoint Hamiltonian circuits in G cannot exceed (n - 1) / 2. That there are (n - 1) / 2 edge-disjoint Hamiltonian circuits, when n is odd, can be shown as follows: The subgraph (of a complete graph of n vertices) is a Hamiltonian circuit.

Keeping the vertices fixed on a circle, rotate the polygonal pattern clockwise by 360/(n - 1), 2. 360/(n - 1), 3. 360/(n - 1), . . . , (n - 3)/2. 360/(n - 1) degrees. Observe that each rotation produces a Hamiltonian circuit that has no edge in common with any of the previous ones. Thus we have (n - 3)/2 new Hamiltonian circuits, all edge disjoint from the one in Figure above and also edge disjoint among themselves. Hence the theorem.

Page 11: Eulerian Graph Hamiltonian Cyclegn.dronacharya.info/itDept/Downloads/Question... · A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose

Seating Problem: Nine members of a new club meet each day for lunch at a round table. They decide to sit such that every member has different neighbors at each lunch. How many days can this arrangement last? This situation can be represented by a graph with nine vertices such that each vertex represents a member, and an edge joining two vertices represents the relationship of sitting next to each other.

Figure shows two possible seating arrangements - these are I 2 3 4 5 6 7 8 9 I (solid lines), and 1 3 5 2 7 4 9 6 8 1 (dashed lines). It can be shown by graph-theoretic considerations that there are only two more arrangements possible. They are I 5 7 3 9 2 8 4 6 I and 1 7 9 5 8 3 6 2 4 1. In general it can be shown that for n people the number of such possible arrangements is: (n-1)/2 if n is odd (n-2)/2 if n is even

Page 12: Eulerian Graph Hamiltonian Cyclegn.dronacharya.info/itDept/Downloads/Question... · A connected graph G is an Euler graph if and only if it can be decomposed into cycles. Proof. Suppose

This theorem enables us to solve the problem of the seating arrangement at a round table as follows: Representing a member x by a vertex and the possibility of his sitting next to another member y by an edge between x and y, we construct a graph G. Since every member is allowed to sit next to any other member, G is a complete graph of nine vertices - nine being the number of people to be seated around the table. Every seating arrangement around the table is clearly a Hamiltonian circuit.

The first day of their meeting they can sit in any order, and it will be a Hamiltonian circuit H1. The second day, if they are to sit such that every member must have different neighbors, we have to find another Hamiltonian circuit H2 in G, with an entirely different set of edges from those in HI; that is, H1 and H2 are edge-disjoint Hamiltonian circuits. From Theorem the number of edge-disjoint Hamiltonian circuits in G is four; therefore, only four such arrangements exist among nine people.