gtnotes1

Post on 08-Apr-2018

216 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

  • 8/7/2019 gtnotes1

    1/14

    1

    Depar tment o f Mathemat i cs 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. Graph Theory With Applications to Engineering & Computer Science, Narsingh Deo, Prentice Hall ofIndia

    2. Graph Theory, Frank Harary, Narosa Publishing House3. 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 ofvertices, V, and a set ofedges, 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 weightassociated 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 edgejoining 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).

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

  • 8/7/2019 gtnotes1

    2/14

    2

    The distance between two vertices a and b, denoted by dist(a, b), is the length of a shortest path

    joining them. The diameter of a connected graph, denoted diam (G), is maxdist(a, b).

    A subgraph of G is a graph all of whose vertices and edges are vertices and edges of G. If

    G1 = (V!, E1) is a subgraph of G = (V, E) then V! Vand E1 E. In figure 1.7 below, G1, G2, G3 and G4are subgraphs ofG.

    Any two subgraphs G1 and G2 of the graph G are edge-disjoint if they do not have any edge in

    common. The two subgraphs are said to be vertex-disjoint subgraphs if there is no common vertex in the

    two subgraphs. Note that edge-disjoint subgraphs may have common vertices but vertex-disjoint

    subgraphs cannot have common edges.

    A subgraph His aspanning subgraphifV(H) = V(G). In figure 1.7, G3 is a spanning subgraph

    ofG. 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. In figure 1.7, G2 is an induced subgraph ofG.

    The degree of a vertex v is defined as the number of edges incident with v. A loops count as 2.

    A vertex having no edge being incident on it is isolated vertex. The degree of isolated vertex is

    0. A vertex of degree 1 is pendent.

    Ifv is a vertex in a graph G, then G v denotes a subgraph obtained by deleting the vertex v from

    G. By deleting a vertex, all edges incident on that vertex are also deleted. Similarly, G e denoted a

    subgraph obtained by deleting the edge e from G. The deletion of an edge does not delete the vertices of

    graph.

    The degree sequence of a graph G is the sequence obtained by listing, in ascending order with

    repeats, the degrees of the vertices of G. For example, in figure 1.7 the degree sequence of G is

    (1, 2, 2, 3, 4). Try to write the degree sequence of graphs in figures 1.5 and 1.6 .

    In a digraph, 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.

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

  • 8/7/2019 gtnotes1

    3/14

    3

    The Handshaking Theorem states that the sum of the degrees of the vertices of a graph is equal

    to twice the number of edges. 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. See the systematic proof

    in next Section.

    In a regular graph,all vertices have the same degree. If the degree is r the graph is r-regular. If

    G is r-regular with n vertices, then it has n redges (from the Handshaking Theorem). Verify it!

    A complete graph is a graph in which every vertex is joined to every other vertex by exactly one

    edge. The complete graph with n vertices is denoted by Kn. Kn is (n 1)-regular and so has

    n(n 1) /2 edges. Verify it!

    A null graph is a graph with no edges. The null graph with n vertices is denoted Nn. Nn is

    0-regular graph.

    A cycle graph consists of a single cycle of vertices and edges. The cycle graph with n vertices is

    denoted by Cn.

    A bipartite graph is a graph whose vertices can be split into two subsets A and B in such a way

    that every edge ofG joins a vertex in A with one in B. Figure 1.11 shows some bipartite graphs. Notice

    that the allocation of the nodes to the sets A and B can sometimes be done in several ways.

    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. The complete bipartite graph with rvertices in A and s vertices in B is

    denoted Kr, s. Figure 1.12 shows some complete bipartite graphs.

    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.3).

    An infinite graph with finite number of edges has an infinite number of

    isolated vertices. (Can u prove it?)

    A walk of length kin a graph is a succession ofkedges joining two vertices. In other words, a

    walk is an alternating sequence of vertices and edges, such that each edge is incident with the

    vertices preceding and following it. Note that an edge cannot occur more than once in a walk.

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

  • 8/7/2019 gtnotes1

    4/14

    4

    However, a vertex may appear more than once in a walk. If a walk begins and ends at same vertex, it is

    called a closed walk. A walks, which are not closed, is called an open walk.

    A path is a walk in which all the edges and all the vertices are distinct. In other words, a walk

    which does not intersects it self is a path.

    A circuit is a closed walk in which no vertex appears more that once,

    except the initial and final vertex.

    In figure 1.14, a b c d a e is a walk of length 5 between a and e. The walk a b c d e is a path of length 4

    between a and e. The walkd a b c dis a circuit.

    NOTE: For more definitions and graph theory terminology, refer to classroom discussions and prescribed

    textbooks.

    2. SOME IMPORTANT RESULS

    THEOREM 2.1: The maximum number of degree of any vertex in a simple graph of n vertices is 1n .

    Prove it yourself.

    THEOREM 2.2: (Handshaking Theorem):The sum of degrees of all vertices is two times the number of

    edges.

    PROOF. Let G = (V, E) be a graph with vertices v1, v2, v3, , vn ,and e edges. Since each edge is

    associated with two vertices and hence it contributes two degree in the sum of degree of all vertices.

    Thus, if there are e edges in G then sum of degrees of all vertices ofG will be equal to 2e. That is,

    deg (v1) + deg (v2) + + deg (vn) = 2e.

    Hence the theorem.

    THEOREM 2.3: In a digraph,

    Sum of even degree vertices = Sum of odd degree vertices = No. of edges in G.

    Prove it yourself.

    THEOREM 2.4: The sum of all degrees of a graph is even.

    Prove it yourself.

    THEOREM 2.5: The maximum number of edges in a simple graph with n vertices is 2)1( nn .

    PROOF. Let G be a graph with n vertices and e edges. 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 ofn vertices is 1n ,

    therefore 1n + 1n + 1n + . n term = 2 e

    n ( 1n ) = 2 e , or e = n ( 1n ) /2.

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

  • 8/7/2019 gtnotes1

    5/14

    5

    THEOREM 2.6: In a graph G, the number of vertices of odd degree is even.

    PROOF.. We know that in a graph G

    Sum of degrees of all vertices = 2 (no. of edges in G)

    Sum of even degree vertices + Sum of odd degree vertices = 2 (no. of edges in G)

    Sum of odd degree vertices = 2 (no. of edges in G) - Sum of even degree vertices

    This implies that, Sum of odd degree vertices is an even number. Hence, number of odd degree vertices iseven. Hence the theorem.

    THEOREM 2.7. In a simple graph with at least 2 vertices, there are at least 2 vertices of the same degree.

    PROOF. Let G be the simple graph with n vertices, n2. The graph G is simple; it has no loops or paralleledges. Hence the degree of each vertex is less than or equal to 1n . Suppose all vertices ofG are of

    different degree. Hence possible degrees for n vertices ofG are 0, 1, 2, 3, , 1n . Let v be a vertex of

    degree 0. Hence v is an isolated vertex. Let u be a vertex of degree n 1, then u has n 1 adjacent

    vertices. Hence v cannot be an isolated vertex; this contradiction proves that a simple graph contains two

    vertices of same degree.

    PROBLEM 1.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.

    PROBLEM 1.2: What is the largest number of vertices in a graph with 35 edges if all vertices are of degree 3.

    PROBLEM 1.3: Show that there exists no graph corresponding to the following degree sequence:

    (i) 0, 2, 2, 3, 4 (ii) 1, 1, 2, 3 (iii) 2,2 2, 3, 4, 5, 5

    PROBLEM 1.4: Show that compliment of a bipartite graph need not to be a bipartite.

    PROBLEM 1.5: Find the size of the k regular graph.

    PROBLEM 1.6: Show that there exists there exists no cycle of odd length in a bipartite graph.

    3. OPERATIONS ON GRAPHS

    Union: Let ),( 111 EVG = and ),( 222 EVG = be two graphs. The union of two graphs 21 GG is a graph

    whose vertex set and edge sets are 21 VV and 21 EE respectively.

    Intersection: The intersection of two graphs 21 GG is a graph whose vertex set and edge sets are

    21 VV and 21 EE respectively.

    Sum: Let ),( 111 EVG = and ),( 222 EVG = be two graphs such that = 21 VV . The sum 21 GG + is

    defined as a graph whose vertex set is 21 VV and edge set consists of those edges that are in 1G and in

    2G and the edges obtained by joining each vertex of 1G to each vertex of 2G .

    Ring Sum: The ring sum 21 GG is defined as a graph whose vertex set is 21 VV and edge set is

    )()( 2121 EEEE .

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

  • 8/7/2019 gtnotes1

    6/14

    6

    Compliment: The compliment of a graph G , denoted as G , is a simple graph with same vertex set as

    that ofG and in which any two vertices are adjacent if they are not adjacent in G . In other words, the

    complement of agraph G = (V, E) is a graph with vertex set Vand edge set E such that eE if and

    only ifeE. A graph is self-complimentary if it is isomorphic to its compliment (see the definition of

    isomorphism in next section).

    Decomposition: A graph G is said to be decomposed in to two graphs 1G and 2G if 21 GG = G and

    21 GG = a null graph. It may be noted that ifG is decomposed into two graphs 1G and 2G , then every

    edge of G occurs in 1G or in 2G , but not in both. However, some of the vertices may occur in both

    1G and 2G . Further, a graph with m edges can be decomposed in 2m1

    1 different ways into pair of

    subgraphs.

    PROBLEM 1.7:Find the union, intersection and ring sum of the following graphs:

    PROBLEM 1.8: Find the compliment of the first graph in Problem 1.1.

    4. CONNECTED & DISCONNECTED GRAPHS AND COMPONENTS

    A graph is said to be connected if its every vertex is reachable from every vertex. A graph that is

    not connected is a disconnected graph. In figure 4.1 the graph is a connected graph and that in figure 4.2

    is a disconnected graph. It is easy to observe that a disconnected graph is union of two or more connected

    graphs, which are called connected components. For example, in figure 4.2, the disconnected graph has

    two connected components. Moreover, each connected subgraph of a graph G is a connected component

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

  • 8/7/2019 gtnotes1

    7/14

    7

    of G . In other words, each graph can be expressed as the union of one or morepair-wise disjoint connected graphs.

    An edge in a connected graph is called a bridge if its removal leaves a disconnected graph. A

    vertex in a connected graph is called a cut-vertex if its removal makes the graph disconnected.

    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.

    PROOF. Let there exists partition V1and V2.of the vertex set Vof the graph G. Let aV1 and bV2

    such that no edge exists that connects a and b. If such a partition exists then G is disconnected.

    Conversely, let us now suppose that G is disconnected. Let a be any vertex ofG. Consider now

    the set V1 of all vertices ofG that are joined by a path to a. Obviously, the set V1 does not contain all

    vertices ofG as G is disconnected. Thus the remaining vertices will be contained in another set, say V2..

    Thus there exists a partition. This completes the proof.

    THEOREM 4.2: If a graph (connected or disconnected) has exactly two vertices of odd degree, there must

    be a path joining two vertices.

    PROOF. IfG is a connected graph, i.e., in G there exists a path between every two vertices. The theorem

    is proved.

    Let us now suppose that G is a disconnected graph. Let v1 and v2 be the vertices of odd degree

    and all other vertices are of even degree. Since the number of odd degree vertices in a graph is always

    even, therefore v1 and v2 must belong to the same component. As each component is a connected graph,

    there exists a path between v1 and v2. This completes the proof.

    THEOREM 4.3: A simple graph with n vertices and k components can have at most

    2)1)(( + knkn edges.

    PROOF. Let G be the graph with n vertices and k components. Letk

    nnn ,.....,, 21 be the number vertices

    in kcomponents. Therefore, nnnn k =,.....,, 21

    We know that the maximum number of edges in i th component can be 2)1( nn , therefore maximum

    number of edges in G is

    == ==

    ==k

    i

    i

    k

    i

    k

    i

    ii

    k

    i

    ii

    nnnnnn

    1

    2

    1 1

    2

    1 22

    1

    2

    1

    2

    1)1(

    2

    1

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

  • 8/7/2019 gtnotes1

    8/14

    8

    Using the following inequality

    )2)(1(2

    1

    2 knknnk

    i

    i

    =

    ,

    We get )1)((2

    1)1(

    2

    1

    1

    +=

    knknnnk

    i

    ii.

    PROBLEM 1.9:Show that if G is not connected then G is connected.

    PROBLEM 1.10: Show that if a graph (connected or disconnected) has exactly two vertices of odd degree, then there

    must be a path joining two vertices.

    PROBLEM 1.11: Show that if the intersection of two paths is a disconnected graph, then the union of two paths has

    atleast one circuit.

    PROBLEM 1.12: What is the total number of subgraphs and spanning subgraphs ofK6.

    5. 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 onlyif there is an edge between the two corresponding vertices in G2. The correspondence itself is called an

    isomorphism.

    Consider the following correspondence between vertices

    in the two graphs shown in figure 5.1. A corresponds to 1,

    B corresponds to 2, D corresponds to 4, C corresponds to 3.

    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. Therefore, the two graphs are

    isomorphic.

    Further, two isomorphic graphs may be drawn to look quite

    different. For example, here are two different ways of drawing C5

    (figure 5.2). The isomorphic graphs share a great many properties,

    such as the number of vertices, number of edges, and the pattern

    of vertex degrees. Thus, two graphs can be proved to be

    non-isomorphicby identifying some property that one possesses

    and the other does not. For example, if one graph has two vertices

    of degree 5 and another has three vertices of degree 5, and then the two graphs can not be isomorphic.

    More precisely, two graphs are isomorphic then (i) they have same number of edges, (ii) they have

    same number of vertices, and (iii) their degree sequence are same. It is important to note that the

    converse is not true, i.e., if two graphs are isomorphic then all above conditions are satisfied, but if two

    graphs satisfy these conditions they are not necessarily be isomorphic. The graphs in figure 5.3 further

    illustrate this idea. The two graphs are isomorphic under the correspondence a A, b B, c C,

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

  • 8/7/2019 gtnotes1

    9/14

    9

    d D, e E, fF. (also check their number of vertices, number of edges and their degree

    sequences).

    PROBLEM 1.13:Which of the following graphs are isomorphic:

    (i) (ii)

    PROBLEM 1.14: Show that the following graphs are isomorphic:

    PROBLEM 1.15: Construct three non-isomorphic spanning subgraphs of the following graph

    PROBLEM 1.16: Show that the two simple connected graphs with n vertices each of degree 2 are isomorphic.

    PROBLEM 1.17: If a graph with n vertices is isomorphic to its compliment G, show that n or (n -1) must be

    divisible by 4.

    PROBLEM 1.18:Show that there are 11 non-isomorphic graphs with 4 vertices.

    6. EULER GRAPH

    A closed walk in a graph that contains all edges of the graph exactly once is called an Euler line.

    A graph that containsan Euler line is called an Euler graph.

    It is important to note that an Euler graph is always connected. For example, the graphs in figure

    6.1 are both Euler graphs. 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. The graphs in figure 6.2 are not Euler graphs

    because no Euler line exists.

    The following are the important results for Euler graphs.

    THEOREM 6.1:A connected graph is an Euler graph if and only if its all vertices are of even degree.

    PROOF. Let G be an Euler graph. Therefore, an Euler line exist in G. Let the Euler line starting from the

    vertex v1 and traversing all edges of graph be v1, e1, v2, e2, v3, . , vn, en, v1. The vertices in this circuit

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

  • 8/7/2019 gtnotes1

    10/14

    10

    may not be all distinct but all edges are distinct. In this circuit every pair of edge ei and ei+1 contributes 2

    to the degree of vertex vi+1.. Thus v2, v3, . , vn are all of even degree, and v1 gets 2 degree from e1 and

    en. Hence all vertices are of even degree.

    Conversely, let connected graph G has all vertices of even degree. Consider v be any vertex. Let

    us start constructing a circuit from v and going through edges ofG so that no edge is traversed twice.

    Since every vertex is even, so we can always exit from every vertex we enter. The vertex v is also even sowe can arrive at v so as to complete the circuit. If this circuit contains all edges, it is an Euler line. Thus,

    G is an Euler graph. If this circuit does not contain all edges of G, the remove the edges included in this

    circuit from G, we get a subgraph, say H, of G. Again all vertices in H are even. Moreover, G is

    connected; Hmust touch G Hat one vertex, say u. Now, start making a circuit from u. Since all vertices

    in Hare even, the circuit must terminate at u. We repeat this process until all edges are covered, i.e., we

    get an Euler line. This completes the proof of the theorem.

    THEOREM 6.2: The connected graph G is an Euler graph if and only if G can be decomposed into

    circuits.

    PROOF. Let the connected graph G is decomposed in to circuits. Therefore, G is the union of edge-disjoint

    circuits. Since the degree of each vertex of the circuit is 2, hence the degree of each vertex of G is even.

    Hence G is an Euler graph.

    Conversely, suppose that G is an Euler graph. Consider a vertex u. Obliviously, there are atleast

    two edges incident on u as G is Euler graph and all vertices are of even degree. Let other end of the edge

    incident on u is v. Since the vertex v is also of even degree, it must have another edge incident ofv, with

    w as the vertex on its other end.. If we continue this process we arrive at the vertex already traversed,

    thus forming a circuit. Now remove this circuit from G. All vertices in the remaining graph are of even

    degree, repeat the above process and remove another circuit formed from G until no edge is left. Thus the

    graph is decomposed into circuits.

    PROBLEM 1.19: Which of the following graphs are Euler graph;

    (i) the complete graph K5, (ii) the complete bipartite graph K2, 3

    PROBLEM 1.20:Which of the following graphs are Euler graphs, also find the Euler line if it is Eulerian:

    (i) (ii)

    PROBLEM 1.21: Show that if a graph had a vertex of odd degree, then it cannot have an Euler circuit.

    7. KONIGSBERG BRIDGE PROBLEM

    The Seven Bridges of Knigsberg is a notable historical problem in mathematics. Its negative

    resolution by Leonhard Euler in 1735 laid the foundations of graph theory. The city of Knigsberg in

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

  • 8/7/2019 gtnotes1

    11/14

    11

    Prussia (now Kaliningrad, Russia) was set on both sides of the Pregel river, and included two large

    islands (A and D) which were connected to each other and the mainland (B and C) by seven bridges.

    (namely, a, b, c, d, e, f, g) as shown in figure 7.1. The citizens of Knigsberg used to amuse themselves,

    during their Sunday afternoon strolls, trying to devise a route which crossed every bridge once only and

    returned to its starting point, but no one could find a way to do it.

    The problem came to the attention of a Swiss mathematician named Leonhard Euler. Euler

    replaced each land mass with an abstract "vertex" or node, and each bridge with an abstract connection,

    an "edge", which only serves to record which pair of vertices (land masses) is connected by that bridge

    (see figure 7.2). He finally proved (during the 1730s) that the task was impossible.

    We can see this readily using the result of theorem 6.1. What the citizens of Knigsberg were

    seeking was an Euler line through this graph. Theorem 6.1 tells us that the graph is Eulerian if and only if

    every vertex has even degree. The degree sequence of the graph in figure 7.2 is (3,3,3,5) so it is not

    Eulerian and no Euler line exists.

    Something of your interest: Two of the seven original bridges were destroyed by bombs during World

    War II. Two others were later demolished and replaced by a modern highway. The three other bridges

    remain, although only two of them are from Euler's time (one was rebuilt in 1935). Thus, there are now

    five bridges in Knigsberg (modern name Kaliningrad).

    8. 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. Thus, a Hamiltonian circuit in a connected graph with

    n vertices has exactly n edges. Further, if any one edge from a Hamiltonian circuit is removed, we get a

    path that is called a Hamiltonian path. It is obvious that the number of edges in a Hamiltonian path in a

    connected graph with n vertices is n 1. It is also important to note that in a connected graph, a

    Hamiltonian path is a subgraph of a Hamiltonian circuit. It is because of this fact that a connected graph

    with a Hamiltonian circuit has a Hamiltonian path also. But, on the other hand, a connected graph with a

    Hamiltonian path may or may not have a Hamiltonian circuit.

    A connected graph that has a Hamiltonian circuit is called Hamiltonian graph. The connected

    graph is figure 8.1 is a Hamiltonian graph; it has Hamiltonian circuit a b c d e f g h a (note that all

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

  • 8/7/2019 gtnotes1

    12/14

    12

    vertices have been used but not all edges). The connected graph is figure 8.2 has a Hamiltonian path

    a b c d but does not have a Hamiltonian circuit; it is not a Hamiltonian graph. A complete graph is

    Hamiltonian graph. Total number of Hamiltonian circuits in a complete graph with n vertices is (n-1) !/2.

    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. Also, a connected graph that is an Euler

    graph may or may not be a Hamiltonian graph and vice versa. The graph is figure 8.3 is a Hamiltonian

    graph as it has a Hamiltonian circuit a b c d e f a, but this graph is not Euler graph because all vertices are

    not of even degree. Next, the graph in figure 8.4 is Euler graph but not a Hamiltonian graph. Lastly, the

    graph in figure 8.5 is both Euler and Hamiltonian (Can you give the reasons. Try it !).

    THEOREM 8.1 (Diracs Theorem): A simple connected graph with n (n3) vertices is Hamiltonian if

    deg v n/2 for every vertex v in G.

    THEOREM 8.2: A simple connected graph with n vertices and m edges is Hamiltonian if

    m1/2 (n - 1) (n - 2) + 2.

    PROOF. Let u and v be two non-adjacent vertices in G. Let His a subgraph obtained on removing u and

    v from G. The subgraph Hhas n 2 vertices and number of edges in it is m deg u deg v or less than

    this. The maximum number of edges in Hmay be

    n-2C2 = (n-1) (n - 2) /2 = (n2 5 n + 6) /2.

    Therefore, m deg u deg v (n2

    5 n + 6) /2

    or, deg u + deg v m - (n2

    5 n + 6) /2.

    By the hypothesis of the theorem, , deg u + deg v (n2

    3 n + 6) /2 - (n2

    5 n + 6) /2 = n.

    This completes the proof.

    PROBLEM 1.22. Show that the complete graph Kn, n 3, is Hamiltonian.

    PROBLEM 1.23:Draw a graph which is:

    (i) Hamiltonian but not Euler, (ii) Euler graph but not Hamiltonian graph, (iii) both Hamiltonian and Euler graph.

    PROBLEM 1.24: Which of the following graphs are Hamiltonian graphs, also find the Hamiltonian circuit

    (i) (ii)

    PROBLEM 1.25: IfG be a graph with n vertices, n 3, then show that G has a Hamiltonian circuit with each vertex

    of degree n/2.

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

  • 8/7/2019 gtnotes1

    13/14

    13

    PROBLEM 1.26:In a complete graph with n vertices there are (n - 1)/2 edge-disjoint Hamiltonian circuits, ifn is an

    odd number 3.

    9. TRAVELLING SALESMAN PROBLEM

    A sales man is required to visit a number of cities during a trip. Given the distance between

    cities, in what order should he travel so as to visit every city precisely once and return home covering

    shortest distance.

    We can try to approach this problem of finding a shortest rout by constructing a graph. Let us

    represent cities by vertices in a graph and roads by edges connecting cities. Since we are given lengths of

    roads, so this graph is a weighted graph. The traveling salesman has to visit each city (vertex in graph)

    exactly once and has to return home (the vertex from where he starts). Therefore, the problem is to find a

    shortest Hamiltonian circuit. Let us consider that there exists a road between every two city, i.e., the

    graph is a complete graph. We know that in a complete graph of n vertices there exist (n -1)! /2

    Hamiltonian circuits, therefore, 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.

    Note. As we can notice that the approach discussed above is practically impossible because of the

    cumbersome calculation involved. For example, if n = 10, the number of Hamiltonian circuits are

    181440. Unfortunately, we do not know any efficient algorithm for solving this problem.

    PROBLEM 1.27: Solve the traveling salesman problem in the following graph:

    1.1. 13

    1.2. 23

    1.3. In (i) and (ii) there are odd number of odd degree vertices, such a graph is not possible. (iii) Thee r four vertices

    given and maximum degree is 6, graph is not possible because maximum degree cannot exceed one less than thenumber of vertices.

    1.5. Let G be a k regular graph with n vertices and e edges. We know that

    Sum of degree of all n vertices = 2e

    i.e., k+ k+ k+ .. n times = 2 e, n . k= 2 e, e = n k/ 2

    1.9. Given that G is not connected, that is, G is a disconnected graph. This implies that G has more than one

    component, which are connected. Let u and v be any two vertices. To show that G is connected, we need to show

    that thereexists a path between u and v.

    Ifu and v are vertices in different components, then u and v are not adjacent in G. Hence they are adjacent

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

    ANSWERS & HINTS TO PROBLEMS

  • 8/7/2019 gtnotes1

    14/14

    14

    in G. Next, let us suppose that u and v are in the same component of G. Let w be a vertex of G but in other

    component of G. Obiviously, u w v make a path u v in G. Hence G is connected.

    1.10. Let in a graph G, the vertices u and v are of odd degree and rest of the vertices are of even degree. Since we

    know that in any graph the number of odd vertices are always even in number, therefore the two odd vertices of G

    must belong to the same component ofG. Hence there is a path between u and v.

    1.12. In K6, no. of vertices is 6 and no. of edges is 15, therefore total number of subgraphs is (26

    - 1) 215

    , and total

    number of spanning subgraphs is 215

    .

    1.13. (i) Isomorphic (ii) Not isomorphic

    1.15.

    1.17. Since G and G are isomorphic, so they have same number of edges. Also total nuber of edges in G and G

    together equals to number of edges in Kn, that is , n (n 1) /2. Thus, each G and G have n (n 1) /4 edges. It now

    follows from above that n (n 1) /4 is a positive integer, and therefore, n or (n 1) must be divisible by 4.

    1.19. (i) Degree of each vertex in K5 is even, it is Eulerian. (ii) Each vertex in K2, 3 is not even, it is not Eulerian.

    1.20. (i) Not Eulerian (ii) Eulerian

    1.22. In Kn, the degree of each vertex is n 1. . If n > 2, we have n 2 > 0 or n 2 > 2 n or n 1 > n /2.

    Thus, in Kn , n 3, the degree of every vertex is greater than n /2. Hence Kn is Hamiltonian.

    1.24. (i) Hamiltonian (ii) Not Hamiltonian

    1.25. Let u and v be two vertices ofG. We know that

    degu + degv nor, degu + degv

    n/2 + n/2

    By comparison (comparison test in binomial expressions) for n =1, we at once get degu n/2, degv n/2.1.27. 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 . The total weight of the

    circuits are 22 and 25 respectively. Therefore, salesman should travel according to the first circuit A B C D E F H

    G A.

    M A T H N O T E S / G T / E C S 5 0 5 / U N I T - 1 P r e p a r e d b y D r S A h m a d A l i , M a t h D e p a r t m e n t , B B D N I T M 2 0 1 1

top related