# Department of Mathematics

Babu BanarAsi Das National Institute of Technology & Management, Lucknow

Class Room Notes: Graph Theory (ECS 505)

Math Notes/GT/ECS 505/Unit-1 NOTE: This handout is not a replacement of the prescribed textbooks. You are recommended to refer the following prescribed textbooks for further reading. You may find good number of examples for practice in these textbooks together with applications of graph theory in engineering problems and computer science. 1. 2. 3. Graph Theory With Applications to Engineering & Computer Science, Narsingh Deo, Prentice Hall of India Graph Theory, Frank Harary, Narosa Publishing House Graph Theory & Applications, Bondy & Murthy, Addison Wesley

The matter contained in will be discussed/explained in classroom lectures. I will appreciate your active participation. Wish you all success. Your course begins here! 1. GRAPH THEORY BASICS: DEFINITIONS & TYPES OF GRAPHS

The word graph refers to a specific mathematical structure usually represented as diagram consisting of points joined by lines. In applications the points may, for instance, correspond to chemical atoms, towns, electrical terminals or anything that can be connected in pairs. The lines may be chemical bonds, roads, wires or other connections. Applications of graph theory are found in communications, structures and mechanisms, electrical networks, transport systems, social

networks and computer science etc. A graph is a mathematical structure comprising a set of vertices, V, and a set of edges, E, which connect the vertices. It is usually represented as a diagram consisting of points, representing the vertices (or nodes), joined by lines, representing the edges (figure 1.1). It is formally denoted by G = (V, E). If in the graph the vertices are connected by directed lines, the graph is called directed graph or a digraph (figure 1.4). The graph is called labeled graph, if the vertices have labels or names (figure 1.2). If each edge has a weight associated with it, it is then called a weighted graph, (figure 1.3). The two vertices joined by an edge are said to be adjacent. The vertices are said to be incident with the edge that joins them and an edge is said to be incident with the vertices it joins. The two or more edges joining the same pair of vertices are called multiple/ parallel edges (figure 1.5). An edge joining a vertex to itself is called a loop (figure 1.5). A graph with no multiple edges and no loops is a simple graph(figure 1.1).

MATH NOTES/GT/ECS 505/UNIT-1

Prepared by Dr S Ahmad Ali, Math Department, BBDNITM  2011

1

4). Try to write the degree sequence of graphs in figures 1.6 . MATH NOTES/GT/ECS 505/UNIT-1 Prepared by Dr S Ahmad Ali. 2. A vertex of degree 1 is pendent. is the length of a shortest path joining them. A loops count as 2. The two subgraphs are said to be vertex-disjoint subgraphs if there is no common vertex in the two subgraphs. b). Note that edge-disjoint subgraphs may have common vertices but vertex-disjoint subgraphs cannot have common edges. indegree of a vertex is the number of edges incident on it and the outdegree of a vertex is the number of edges incident from it. The degree of a vertex v is defined as the number of edges incident with v. then G –v denotes a subgraph obtained by deleting the vertex v from G. the degrees of the vertices of G. If v is a vertex in a graph G.7. A vertex having no edge being incident on it is isolated vertex. G – e denoted a subgraph obtained by deleting the edge e from G.5 and 1. By deleting a vertex. If G1 = (V!. In a digraph. in figure 1. G2 is an induced subgraph of G. The degree sequence of a graph G is the sequence obtained by listing. denoted by dist (a. The degree of isolated vertex is 0. Any two subgraphs G1 and G2 of the graph G are edge-disjoint if they do not have any edge in common.7 the degree sequence of G is (1. Math Department. Similarly. E) then V! ⊆V and E1 ⊆ E. In figure 1. G3 is a spanning subgraph of G. b). In figure 1. In figure 1. denoted diam (G). E1) is a subgraph of G = (V. BBDNITM  2011 2 . all edges incident on that vertex are also deleted.7 below. G3 and G4 are subgraphs of G. G2. in ascending order with repeats. For example.The distance between two vertices a and b. An induced (generated) subgraph is a subset of the vertices of the graph together with all the edges of the graph between the vertices of this subset. A subgraph of G is a graph all of whose vertices and edges are vertices and edges of G. is max dist (a. A subgraph H is a spanning subgraph if V (H) = V (G). The diameter of a connected graph.7. 2. The deletion of an edge does not delete the vertices of graph. G1. 3.

s . An infinite graph with finite number of edges has an infinite number of isolated vertices. If the degree is r the graph is r-regular.The Handshaking Theorem states that the sum of the degrees of the vertices of a graph is equal to twice the number of edges. BBDNITM  2011 3 . (Can u prove it?) A walk of length k in a graph is a succession of k edges joining two vertices. Nn is 0-regular graph.11 shows some bipartite graphs. Figure 1. Note that an edge cannot occur more than once in a walk. Math Department. a walk is an alternating sequence of vertices and edges. Figure 1. Notice that the allocation of the nodes to the sets A and B can sometimes be done in several ways. Kn is (n – 1)-regular and so has n(n – 1) /2 edges. A graph whose vertex set is and edge set is a finite set is called a finite graph otherwise an infinite is an infinite graph (figure 1. A cycle graph consists of a single cycle of vertices and edges. all vertices have the same degree. MATH NOTES/GT/EC S505/UNIT-1 Prepared by Dr S Ahmad Ali. See the systematic proof in next Section. The cycle graph with n vertices is denoted by Cn.3). The complete bipartite graph with r vertices in A and s vertices in B is denoted Kr. A bipartite graph is a graph whose vertices can be split into two subsets A and B in such a way that every edge of G joins a vertex in A with one in B. In a regular graph.12 shows some complete bipartite graphs. A complete bipartite graph is a bipartite graph in which every vertex in A is joined to every vertex in B by exactly one edge. In other words. then it has ½ n r edges (from the Handshaking Theorem). If G is r-regular with n vertices. such that each edge is incident with the vertices preceding and following it. The null graph with n vertices is denoted Nn. Verify it! A complete graph is a graph in which every vertex is joined to every other vertex by exactly one edge. This follows readily from the fact that each edge joins two vertices (not necessarily distinct) and so contributes 1 to the degree of each of those vertices. The complete graph with n vertices is denoted by Kn. Verify it! A null graph is a graph with no edges.

a b c d a e is a walk of length 5 between a and e. NOTE: For more definitions and graph theory terminology. … .5: The PROOF. The walk d a b c d is a circuit. THEOREM 2. THEOREM 2. A path is a walk in which all the edges and all the vertices are distinct. is called an open walk. In figure 1. Sum of even degree vertices = Sum of odd degree vertices = No. vn . E) be a graph with vertices v1. MATH NOTES/GT/ECS 505/UNIT-1 Prepared by Dr S Ahmad Ali. of edges in G.4: The sum of all degrees of a graph is even.2: (Handshaking Theorem): The sum of degrees of all vertices is two times the number of edges. or e = n ( n − 1 ) /2. A walks. Prove it yourself. which are not closed. If a walk begins and ends at same vertex.and e edges. Hence the theorem. Thus.1: The maximum number of degree of any vertex in a simple graph of n vertices is n − 1 . if there are e edges in G then sum of degrees of all vertices of G will be equal to 2e. a walk which does not intersects it self is a path. By handshaking theorem Sum of degrees of all n vertices = 2 e We know that maximum number of degree of any vertex in a simple graph of n vertices is n − 1 . therefore n −1+ n −1+ n −1+ ….14. The walk a b c d e is a path of length 4 between a and e. A circuit is a closed walk in which no vertex appears more that once. THEOREM 2. THEOREM 2. refer to classroom discussions and prescribed textbooks. a vertex may appear more than once in a walk. SOME IMPORTANT RESULS THEOREM 2. Math Department. Let G = (V. except the initial and final vertex. v2. Prove it yourself. Prove it yourself. BBDNITM  2011 4 . deg (v1) + deg (v2) + … + deg (vn) = 2e. 2. That is. maximum number of edges in a simple graph with n vertices is n ( n − 1 ) 2 . n term = 2 e n ( n − 1 ) = 2 e . it is called a closed walk. Let G be a graph with n vertices and e edges.3: In a digraph. v3. PROOF. Since each edge is associated with two vertices and hence it contributes two degree in the sum of degree of all vertices. In other words.However.

PROBLEM 1. Sum: Let G1 = (V1 . then u has n –1 adjacent vertices. …. 2. a graph G. n − 1 . Intersection: The intersection of two graphs G1 ∩ G 2 is a graph whose vertex set and edge sets are V1 ∩ V2 and E1 ∩ E 2 respectively.THEOREM 2. 4 (ii) 1. 2. Sum of odd degree vertices is an even number. 4.Sum of even degree vertices This implies that. Let u be a vertex of degree n –1. a simple graph with at least 2 vertices. Hence. 2. of edges in G) Sum of even degree vertices + Sum of odd degree vertices = 2 (no. Hence the degree of each vertex is less than or equal to n − 1 .2 2.2: What is the largest number of vertices in a graph with 35 edges if all vertices are of degree 3. the number of vertices of odd degree is even. 5 PROBLEM 1. this contradiction proves that a simple graph contains two vertices of same degree. 2.4: Show that compliment of a bipartite graph need not to be a bipartite.5: Find the size of the k – regular graph. 3 (iii) 2. Hence v is an isolated vertex. E1 ) and G 2 = (V2 .6: In PROOF. Hence v cannot be an isolated vertex. Math Department. OPERATIONS ON GRAPHS Union: Let G1 = (V1 . The sum G1 + G 2 is defined as a graph whose vertex set is V1 ∪ V2 and edge set consists of those edges that are in G1 and in G2 and the edges obtained by joining each vertex of G1 to each vertex of G2 . 3. Let v be a vertex of degree 0.3: Show that there exists no graph corresponding to the following degree sequence: (i) 0. n ≥ 2.1: Find the number of vertices in a graph with 21 edges and 3 vertices of degree 4 and other vertices each of degree 3. In PROOF. Hence possible degrees for n vertices of G are 0. PROBLEM 1. 3. THEOREM 2. there are at least 2 vertices of the same degree. 1. Ring Sum: The ring sum G1 ⊕ G2 is defined as a graph whose vertex set is V1 ∪ V2 and edge set is ( E1 ∪ E 2 ) − ( E1 ∩ E 2 ) . BBDNITM  2011 MATH NOTES/GT/ECS 505/UNIT-1 5 . of edges in G) . it has no loops or parallel edges. The graph G is simple. Hence the theorem. PROBLEM 1. Suppose all vertices of G are of different degree.6: Show that there exists there exists no cycle of odd length in a bipartite graph. E 2 ) be two graphs such that V1 ∩ V2 = φ . PROBLEM 1. of edges in G) Sum of odd degree vertices = 2 (no. We know that in a graph G Sum of degrees of all vertices = 2 (no. E1 ) and G 2 = (V2 . Let G be the simple graph with n vertices. number of odd degree vertices is even. PROBLEM 1. 5. E 2 ) be two graphs. Prepared by Dr S Ahmad Ali. 3. 1. 3. The union of two graphs G1 ∪ G 2 is a graph whose vertex set and edge sets are V1 ∪ V2 and E1 ∪ E 2 respectively..7.

Further. In figure 4. then every edge of G occurs in G1 or in G2 . For example. In other words. denoted as G ′ . It is easy to observe that a disconnected graph is union of two or more connected graphs. the complement of a graph G = (V.8: Find the compliment of the first graph in Problem 1.Compliment: The compliment of a graph G .1 the graph is a connected graph and that in figure 4. 4. a graph with m edges can be decomposed in 2m—1 — 1 different ways into pair of subgraphs.2. the disconnected graph has two connected components. each connected subgraph of a graph G is a connected component MATH NOTES/GT/ECS 505/UNIT-1 Prepared by Dr S Ahmad Ali.1. It may be noted that if G is decomposed into two graphs G1 and G2 . Math Department. intersection and ring sum of the following graphs: PROBLEM 1. CONNECTED & DISCONNECTED GRAPHS AND COMPONENTS A graph is said to be connected if its every vertex is reachable from every vertex. some of the vertices may occur in both G1 and G2 . E) is a graph with vertex set V and edge set E’ such that e ∈ E’ if and only if e ∉ E.2 is a disconnected graph. BBDNITM  2011 6 . Decomposition: A graph G is said to be decomposed in to two graphs G1 and G 2 if G1 ∪ G 2 = G and G1 ∩ G2 = a null graph. Moreover. However. which are called connected components. in figure 4. PROBLEM 1. A graph is self-complimentary if it is isomorphic to its compliment (see the definition of isomorphism in next section). A graph that is not connected is a disconnected graph. but not in both.7: Find the union. is a simple graph with same vertex set as that of G and in which any two vertices are adjacent if they are not adjacent in G .

THEOREM 4. say V2. Therefore.. Consider now the set V1 of all vertices of G that are joined by a path to a. there exists a path between v1 and v2. n k be the number vertices in k components.3: A simple graph with n vertices and k components can have at most edges. THEOREM 4... An edge in a connected graph is called a bridge if its removal leaves a disconnected graph. . PROOF.of the vertex set V of the graph G. therefore maximum number of edges in G is 1 2 k ∑n i =1 i ( n i − 1) = 1 2 k ∑ i =1 n i2 − 1 2 k ∑ i =1 ni = 1 2 k ∑ i =1 n i2 − n 2 MATH NOTES/GT/ECS 505/UNIT-1 Prepared by Dr S Ahmad Ali. n k = n We know that the maximum number of edges in i th component can be n ( n − 1 ) 2 . . Thus there exists a partition. If G is a connected graph. Let there exists partition V1 and V2. Let us now suppose that G is a disconnected graph. . the set V1 does not contain all vertices of G as G is disconnected. there must be a path joining two vertices. ( n − k )( n − k + 1 ) 2 PROOF. Obviously. i. therefore v1 and v2 must belong to the same component. Conversely. This completes the proof.of G . PROOF.. Math Department. BBDNITM  2011 7 . Let a ∈ V1 and b ∈ V2 such that no edge exists that connects a and b.e. In other words.. As each component is a connected graph... The theorem is proved. THEOREM 4.1: A graph G is disconnected if and only if its vertex set V can be partitioned into two non- empty disjoint sets V1 and V2 such that there exists no edge in whose one vertex in V1 and other in V2. Thus the remaining vertices will be contained in another set... This completes the proof. Since the number of odd degree vertices in a graph is always even. Let n 1 . If such a partition exists then G is disconnected. n 2 . let us now suppose that G is disconnected. A vertex in a connected graph is called a cut-vertex if its removal makes the graph disconnected. Let a be any vertex of G. . n 2 . each graph can be expressed as the union of one or more pair-wise disjoint connected graphs.2: If a graph (connected or disconnected) has exactly two vertices of odd degree. in G there exists a path between every two vertices. n 1 . Let v1 and v2 be the vertices of odd degree and all other vertices are of even degree.. Let G be the graph with n vertices and k components.

More precisely. Thus.12: What is the total number of subgraphs and spanning subgraphs of K6. For example. Math Department. BBDNITM  2011 8 . and the pattern of vertex degrees. then the union of two paths has atleast one circuit. and then the two graphs can not be isomorphic. here are two different ways of drawing C5 (figure 5. The correspondence itself is called an isomorphism. two graphs can be proved to be non-isomorphic by identifying some property that one possesses and the other does not.9: Show that if G is not connected then G’ is connected. It is important to note that the converse is not true. The graphs in figure 5. if one graph has two vertices of degree 5 and another has three vertices of degree 5. PROBLEM 1. such as the number of vertices. two graphs are isomorphic then (i) they have same number of edges. GRAPH ISOMOSRPHISM The graphs G1 and G2 are said to be isomorphic if there exists a one-to-one correspondence between vertices in G1 and vertices in G2 such that there is an edge between two vertices in G1 if and only if there is an edge between the two corresponding vertices in G2.Using the following inequality k ∑n i =1 2 i ≤ n 2 − ( k − 1 )( 2 n − k ) . two isomorphic graphs may be drawn to look quite different.10: Show that if a graph (connected or disconnected) has exactly two vertices of odd degree. the two graphs are isomorphic. c → C. number of edges.1. and (iii) their degree sequence are same. (ii) they have same number of vertices.3 further illustrate this idea. but if two graphs satisfy these conditions they are not necessarily be isomorphic. Consider the following correspondence between vertices in the two graphs shown in figure 5. 5. Further. The isomorphic graphs share a great many properties. For example. C corresponds to 3. The two graphs are isomorphic under the correspondence a → A. then there must be a path joining two vertices. PROBLEM 1.e. MATH NOTES/GT/ECS 505/UNIT-1 Prepared by Dr S Ahmad Ali. PROBLEM 1. D corresponds to 4. b → B. i. Since there is an edge between two vertices in the first graph if and only if there is an edge between the two corresponding vertices in the second graph on the right. B corresponds to 2. 2 PROBLEM 1.11: Show that if the intersection of two paths is a disconnected graph.. if two graphs are isomorphic then all above conditions are satisfied. Therefore. We get 1 2 k ∑n i =1 i ( n i − 1) ≤ 1 ( n − k )( n − k + 1 ) .2). A corresponds to 1.

. For example. A graph that contains an Euler line is called an Euler graph. THEOREM 6. It is important to note that an Euler graph is always connected.2 are not Euler graphs because no Euler line exists.18: Show that there are 11 non-isomorphic graphs with 4 vertices. the graphs in figure 6. vn.16: Show that the two simple connected graphs with n vertices each of degree 2 are isomorphic.17: If a graph with n vertices is isomorphic to its compliment G’. v2. f → F. PROBLEM 1. number of edges and their degree sequences). e → E. e1.15: Construct three non-isomorphic spanning subgraphs of the following graph PROBLEM 1. EULER GRAPH A closed walk in a graph that contains all edges of the graph exactly once is called an Euler line. v1. PROOF. Let the Euler line starting from the vertex v1 and traversing all edges of graph be v1. The following are the important results for Euler graphs. PROBLEM 1. en.1 are both Euler graphs. show that n or (n -1) must be divisible by 4.14: Show that the following graphs are isomorphic: PROBLEM 1. …….13: Which of the following graphs are isomorphic: (i) (ii) PROBLEM 1. 6. e2. The close walk containing all edges (Euler line) in two graphs are a b c d e a and A a B d C e D f E c B b E g D h A respectively. Therefore. The vertices in this circuit MATH NOTES/GT/ECS 505/UNIT-1 Prepared by Dr S Ahmad Ali. PROBLEM 1. Math Department. Let G be an Euler graph.1: A connected graph is an Euler graph if and only if its all vertices are of even degree. v3.d → D. an Euler line exist in G. (also check their number of vertices. The graphs in figure 6. BBDNITM  2011 9 .

Consider v be any vertex. say u. so we can always exit from every vertex we enter. thus forming a circuit.19: Which of the following graphs are Euler graph. (i) the complete graph K5. Let the connected graph G is decomposed in to circuits. the remove the edges included in this circuit from G. it is an Euler line. start making a circuit from u. Since the degree of each vertex of the circuit is 2. Conversely. then it cannot have an Euler circuit. 3 PROBLEM 1. H must touch G – H at one vertex. Since all vertices in H are even. G is connected. Math Department.. it must have another edge incident of v.may not be all distinct but all edges are distinct. Hence all vertices are of even degree. KONIGSBERG BRIDGE PROBLEM The Seven Bridges of Königsberg is a notable historical problem in mathematics. i. If this circuit does not contain all edges of G. there are atleast two edges incident on u as G is Euler graph and all vertices are of even degree. Since the vertex v is also of even degree. say H. THEOREM 6. If we continue this process we arrive at the vertex already traversed. Since every vertex is even. G is the union of edge-disjoint circuits. In this circuit every pair of edge ei and ei+1 contributes 2 to the degree of vertex vi+1. Thus. BBDNITM  2011 10 . let connected graph G has all vertices of even degree.2: The connected graph G is an Euler graph if and only if G can be decomposed into circuits. The vertex v is also even so we can arrive at v so as to complete the circuit. Hence G is an Euler graph. 7. we get an Euler line. ……. suppose that G is an Euler graph. (ii) the complete bipartite graph K2. If this circuit contains all edges. the circuit must terminate at u. Thus v2. we get a subgraph. This completes the proof of the theorem. Therefore.21: Show that if a graph had a vertex of odd degree. All vertices in the remaining graph are of even degree. We repeat this process until all edges are covered. hence the degree of each vertex of G is even. G is an Euler graph..20: Which of the following graphs are Euler graphs. Let us start constructing a circuit from v and going through edges of G so that no edge is traversed twice. The city of Königsberg in MATH NOTES/GT/ECS 505/UNIT-1 Prepared by Dr S Ahmad Ali. repeat the above process and remove another circuit formed from G until no edge is left. Now remove this circuit from G.e. PROOF. Moreover. v3. Conversely. Thus the graph is decomposed into circuits. with w as the vertex on its other end. Consider a vertex u. Let other end of the edge incident on u is v. Now. . Again all vertices in H are even. PROBLEM 1.. Its negative resolution by Leonhard Euler in 1735 laid the foundations of graph theory. and v1 gets 2 degree from e1 and en. Obliviously. vn are all of even degree. also find the Euler line if it is Eulerian: (i) (ii) PROBLEM 1. of G.

a connected graph with a Hamiltonian path may or may not have a Hamiltonian circuit. we get a path that is called a Hamiltonian path.3. b. and included two large islands (A and D) which were connected to each other and the mainland (B and C) by seven bridges. BBDNITM  2011 11 . The problem came to the attention of a Swiss mathematician named Leonhard Euler. But. HAMILTONIAN GRAPH A closed walk in a connected graph that traverses every vertex exactly once (except initial and terminal vertices) is called a Hamiltonian circuit. 8. which only serves to record which pair of vertices (land masses) is connected by that bridge (see figure 7. trying to devise a route which crossed every bridge once only and returned to its starting point. f. g) as shown in figure 7. on the other hand. He finally proved (during the 1730s) that the task was impossible. e. Euler replaced each land mass with an abstract "vertex" or node. there are now five bridges in Königsberg (modern name Kaliningrad).1. and each bridge with an abstract connection. Math Department. What the citizens of Königsberg were seeking was an Euler line through this graph. Two others were later demolished and replaced by a modern highway. if any one edge from a Hamiltonian circuit is removed. it has Hamiltonian circuit a b c d e f g h a (note that all MATH NOTES/GT/ECS 505/UNIT-1 Prepared by Dr S Ahmad Ali. It is obvious that the number of edges in a Hamiltonian path in a connected graph with n vertices is n –1. Russia) was set on both sides of the Pregel river. It is also important to note that in a connected graph. c. The degree sequence of the graph in figure 7. a. although only two of them are from Euler's time (one was rebuilt in 1935). The connected graph is figure 8. A connected graph that has a Hamiltonian circuit is called Hamiltonian graph.5) so it is not Eulerian and no Euler line exists. d.3. a Hamiltonian path is a subgraph of a Hamiltonian circuit. Thus. We can see this readily using the result of theorem 6. Thus. The three other bridges remain.2 is (3. Theorem 6. an "edge". It is because of this fact that a connected graph with a Hamiltonian circuit has a Hamiltonian path also.2). Something of your interest: Two of the seven original bridges were destroyed by bombs during World War II.Prussia (now Kaliningrad. but no one could find a way to do it.1 is a Hamiltonian graph.1.1 tells us that the graph is Eulerian if and only if every vertex has even degree. during their Sunday afternoon strolls. (namely. Further. The citizens of Königsberg used to amuse themselves. a Hamiltonian circuit in a connected graph with n vertices has exactly n edges.

2) /2 = (n2 – 5 n + 6) /2. . (i) Hamiltonian but not Euler. Let H is a subgraph obtained on removing u and v from G.5 is both Euler and Hamiltonian (Can you give the reasons. (iii) both Hamiltonian and Euler graph. By the hypothesis of the theorem. n ≥ PROBLEM 1. a connected graph that is an Euler graph may or may not be a Hamiltonian graph and vice versa. The graph is figure 8.22. PROBLEM 1. Math Department.3 is a Hamiltonian graph as it has a Hamiltonian circuit a b c d e f a. Also. THEOREM 8. it is not a Hamiltonian graph. the graph in figure 8. the graph in figure 8. The maximum number of edges in H may be n -2 C2 = (n-1) (n . PROOF. Show that the complete graph Kn.25: If G be a graph with n vertices. then show that G has a Hamiltonian circuit with each vertex of degree ≥ n/2.(n2 – 5 n + 6) /2 = n. but this graph is not Euler graph because all vertices are not of even degree.1 (Dirac’s Theorem): A simple connected graph with n (n ≥ 3) vertices is Hamiltonian if deg v ≥ n/2 for every vertex v in G.24: Which of the following graphs are Hamiltonian graphs.(n2 – 5 n + 6) /2. THEOREM 8.1) (n . m – deg u – deg v ≤ (n2 – 5 n + 6) /2 deg u + deg v ≥ m . This completes the proof.vertices have been used but not all edges). deg u + deg v ≥ (n2 – 3 n + 6) /2 . Lastly.2 has a Hamiltonian path a b c d but does not have a Hamiltonian circuit. Therefore. (ii) Euler graph but not Hamiltonian graph. It may be noted that an Euler line visits each edge of the graph exactly once whereas a Hamiltonian circuit visits each vertex of the graph exactly once. BBDNITM  2011 12 . Next. n ≥ 3. also find the Hamiltonian circuit (i) (ii) PROBLEM 1.2: A simple connected graph with n vertices and m edges is Hamiltonian if m ≥ 1/2 (n . Try it !). A complete graph is Hamiltonian graph.4 is Euler graph but not a Hamiltonian graph. PROBLEM 1. The subgraph H has n – 2 vertices and number of edges in it is m – deg u – deg v or less than this. Let u and v be two non-adjacent vertices in G. Total number of Hamiltonian circuits in a complete graph with n vertices is (n-1) !/2.2) + 2.23: Draw a graph which is: 3. is Hamiltonian. MATH NOTES/GT/ECS 505/UNIT-1 Prepared by Dr S Ahmad Ali. The connected graph is figure 8. or.

one possible approach to get the shortest rout is to calculate the weights of all the (n -1)! /2 Hamiltonian circuits and find the shortest one. n . BBDNITM  2011 13 .5. graph is not possible because maximum degree cannot exceed one less than the number of vertices. 23 1.1. the problem is to find a shortest Hamiltonian circuit. We can try to approach this problem of finding a shortest rout by constructing a graph. G is a disconnected graph.PROBLEM 1.. Given the distance between cities. e=nk/2 1. we do not know any efficient algorithm for solving this problem. in what order should he travel so as to visit every city precisely once and return home covering shortest distance. then u and v are not adjacent in G. we need to show that there exists a path between u and v. 9. Given that G is not connected. As we can notice that the approach discussed above is practically impossible because of the cumbersome calculation involved. Note. therefore.. We know that Sum of degree of all n vertices = 2e i. TRAVELLING SALESMAN PROBLEM A sales man is required to visit a number of cities during a trip. the number of Hamiltonian circuits are 181440.9. Let G be a k – regular graph with n vertices and e edges. Let u and v be any two vertices. such a graph is not possible.e. Unfortunately. The traveling salesman has to visit each city (vertex in graph) exactly once and has to return home (the vertex from where he starts). that is. k + k + k + …. Therefore. For example. We know that in a complete graph of n vertices there exist (n -1)! /2 Hamiltonian circuits. so this graph is a weighted graph. 1. Let us represent cities by vertices in a graph and roads by edges connecting cities.e. k = 2 e.27: Solve the traveling salesman problem in the following graph: ANSWERS & HINTS TO PROBLEMS 1. To show that G’ is connected. PROBLEM 1. n times = 2 e.2.3. 13 1. Hence they are adjacent MATH NOTES/GT/ECS 505/UNIT-1 Prepared by Dr S Ahmad Ali.26: In a complete graph with n vertices there are (n . the graph is a complete graph. This implies that G has more than one component. Since we are given lengths of roads.. Math Department. (iii) Thee r four vertices given and maximum degree is 6. In (i) and (ii) there are odd number of odd degree vertices. if n = 10. If u and v are vertices in different components. i. Let us consider that there exists a road between every two city. which are connected.1)/2 edge-disjoint Hamiltonian circuits. if n is an odd number ≥ 3.

1.12. deg v ≥ n/2. It now follows from above that n (n – 1) /4 is a positive integer.13. and total number of spanning subgraphs is 215. so they have same number of edges. that is .10. let us suppose that u and v are in the same component of G. BBDNITM  2011 14 . MATH NOTES/GT/ECS 505/UNIT-1 Prepared by Dr S Ahmad Ali. 3 is not even.17. of vertices is 6 and no. Obiviously. Hence there is a path between u and v. and therefore.19.in G. If n > 2. (i) Degree of each vertex in K5 is even. Let in a graph G. Hence Kn is Hamiltonian. (i) Hamiltonian (ii) Not Hamiltonian 1. Therefore. Hence G’ is connected. Let u and v be two vertices of G. Also total nuber of edges in G and G’ together equals to number of edges in Kn. Since G and G’ are isomorphic. u w v make a path u v in G’.1) 215 . we at once get deg u ≥ n/2. (ii) Each vertex in K2. 3.27. (i) Isomorphic (ii) Not isomorphic 1. The graph has two Hamiltonian circuits: A B C D E F H G A and A B C D E F G H A.20. Math Department. Let w be a vertex of G but in other component of G. therefore total number of subgraphs is (26 .25. 1. Thus. n or (n – 1) must be divisible by 4. We know that deg u + deg v ≥ n or.24. salesman should travel according to the first circuit A B C D E F H G A.15. Since we know that in any graph the number of odd vertices are always even in number. 1. the degree of each vertex is n –1. 1. In K6. it is Eulerian. 1. of edges is 15. . 1. therefore the two odd vertices of G must belong to the same component of G. 1. the vertices u and v are of odd degree and rest of the vertices are of even degree. no. Next. in Kn . n ≥ or n –2 > 2 n or n –1 > n /2.22. In Kn. 1. The total weight of the circuits are 22 and 25 respectively. we have n –2 > 0 Thus. each G and G’ have n (n – 1) /4 edges. deg u + deg v ≥ n/2 + n/2 By comparison (comparison test in binomial expressions) for n =1. (i) Not Eulerian (ii) Eulerian 1. the degree of every vertex is greater than n /2. n (n – 1) /2. it is not Eulerian.