Graph Theory Unit: 4.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Chapter 8 Topics in Graph Theory
Chapter 9 Graphs.
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Graph-02.
Introduction to Graphs
1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.
Representing Graphs Wade Trappe. Lecture Overview Introduction Some Terminology –Paths Adjacency Matrix.
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE Discrete.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
9.2 Graph Terminology and Special Types Graphs
GRAPH Learning Outcomes Students should be able to:
Introduction to Network Theory: Basic Concepts
Graphs Chapter 10.
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
Graph Theory Topics to be covered:
Lecture 10: Graphs Graph Terminology Special Types of Graphs
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 9 (Part 2): Graphs  Graph Terminology (9.2)
Chapter 6 Graph Theory R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001.
1 CS104 : Discrete Structures Chapter V Graph Theory.
Graphs.  Definition A simple graph G= (V, E) consists of vertices, V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements.
Data Structures & Algorithms Graphs
Basic Notions on Graphs. The House-and-Utilities Problem.
Many structures involving real world situations can be conveniently represented on a paper by means of a diagram consisting of a set of points together.
1 12/2/2015 MATH 224 – Discrete Mathematics Formally a graph is just a collection of unordered or ordered pairs, where for example, if {a,b} G if a, b.
September1999 CMSC 203 / 0201 Fall 2002 Week #13 – 18/20/22 November 2002 Prof. Marie desJardins.
Chapter 5 Graphs  the puzzle of the seven bridge in the Königsberg,  on the Pregel.
1 Graphs Theory UNIT IV. 2Contents  Basic terminology,  Multi graphs and weighted graphs  Paths and circuits  Shortest path in weighted graph  Hamiltonian.
Unit – V Graph theory. Representation of Graphs Graph G (V, E,  ) V Set of vertices ESet of edges  Function that assigns vertices {v, w} to each edge.
An Introduction to Graph Theory
Graph Theory and Applications
Introduction to Graphs. This Lecture In this part we will study some basic graph theory. Graph is a useful concept to model many problems in computer.
Graphs 9.1 Graphs and Graph Models أ. زينب آل كاظم 1.
Introduction to Graph Theory
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
Discrete Structures CISC 2315 FALL 2010 Graphs & Trees.
Chapter 9: Graphs.
Introduction to Graph Theory By: Arun Kumar (Asst. Professor) (Asst. Professor)
Great Theoretical Ideas in Computer Science for Some.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
COMPSCI 102 Introduction to Discrete Mathematics.
Graph Theory Graph Theory - History Leonhard Euler's paper on “Seven Bridges of Königsberg”, published in 1736.
Grade 11 AP Mathematics Graph Theory Definition: A graph, G, is a set of vertices v(G) = {v 1, v 2, v 3, …, v n } and edges e(G) = {v i v j where 1 ≤ i,
Chap 7 Graph Def 1: Simple graph G=(V,E) V : nonempty set of vertices E : set of unordered pairs of distinct elements of V called edges Def 2: Multigraph.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
1 Data Structures and Algorithms Graphs. 2 Graphs Basic Definitions Paths and Cycles Connectivity Other Properties Representation Examples of Graph Algorithms:
Trees.
Chapter Chapter Summary Graphs and Graph Models Graph Terminology and Special Types of Graphs Representing Graphs and Graph Isomorphism Connectivity.
An Introduction to Graph Theory
Homework 8 Graph G is given by the figure below.
Chapter 9 (Part 2): Graphs
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
Graph Theory CSRU1400, Fall 2007 Ellen Zhang.
Graph theory Definitions Trees, cycles, directed graphs.
Agenda Lecture Content: Introduction to Graph Path and Cycle
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Graphs Slides are adopted from “Discrete.
Graph.
CS100: Discrete structures
Graphs Discrete Structure CS203.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Lecture 10: Graphs Graph Terminology Special Types of Graphs
Chapter 5 Graphs the puzzle of the seven bridge in the Königsberg,
Introduction to Graph Theory
Agenda Review Lecture Content: Shortest Path Algorithm
Presentation transcript:

Graph Theory Unit: 4

General Information Exam. Scheme: Online(MCQ) : 50 Marks. Offline(Problems) : 50 Marks. Total number of lecture allocated = 08. Methodology: Traditional (Chalk-Board). Books : C.L.Liu

Graph Theory A graph G is an ordered pair (V,E) where V is the set of vertices and E is the set of edges. Each edge is associated with an unordered pair (vi , vj). The vertices Vi & vj are called the end vertices or the terminal vertices of the edge Eij.

Basic Terminology Incident : An edge is said to be incident with the vertices it joins. Adjacent : Two vertices are said to be adjacent if they are joined by an edge. Two edges are said to be adjacent if they are joined by common vertices. Degree of Vertices: No. of edges incident on a particular vertex are called degree of that vertex. Indegree & Outdegree: Number of edges incident on to a vertex & number of vertex incident out of a vertex.

Basic….. Loop: If the initial vertex vi and the terminal vertex vj are same for an edge eij, then eij are called self loop or simply loop. Parallel edges: If there are more than one edges associated with a given pair of vertices then those edges are called parallel edges or multiple edges. Isolated Vertex: A vertex is said to be isolated vertex if no edge is incident on it. Pendant vertex: A vertex with degree 1 is called a Pendant vertex.

Representation of graph Adjacent matrix. Incidence Matrix.

Adjacent Matrix A B C D E A 0 1 1 1 0 B 1 0 1 1 0 C 1 1 0 0 1 D 1 1 0 0 1 E 0 0 1 1 0 A B C D E a b c d e f g

Incidence Matrix a b c d e ----------------------------- A 1 1 0 1 0 B 0 1 1 0 0 C 1 0 1 0 1 D 0 0 0 1 0 E 0 0 0 0 1 A B C D E a b c d e f g

Types of Graph Directed Graph: A directed graph G is defined as an ordered pair (V,E) ,where V is the set of vertices and E is the set of edges. Each edge or arc ek ={vi,vj} is represented by an arrow ,starting from initial point vi to the terminal point vj.

Types… Weighted Graph: A graph G is said to be a weighted graph if each edge of the graph is assigned with some positive real number (w),called the weight.

Types.. Simple Graph: A graph is said to be a simple graph if it does not contain neither the self loops nor the parallel edges. Finite & Infinite graph : A graph with finite number of edges & vertices and a graph with infinite number of edges & vertices.

Null Graph: If the edge set of any graph G with n vertices is an empty set then the graph is called a null graph. Complete graph: A graph G is called a complete graph if every vertex in G is connected with every other vertex ie degree of each vertex should be n-1. Denoted by Kn Total no of edges =n(n-1)/2

Regular graph: If degree of all the vertex of a graph G is same say”d” then it is called regular graph. Every Complete graph Kn is a regular graph of degree n-1 but vice versa is not true

Multi graph A graph having self loop & Parallel edges are called multi graph or Multiple graph.

Bipartite Graph :A graph G with vertices V and edges E are called bipartite graph if its vertex set can be partitioned in two set such that V1 U V2= V V1 Π V2= ф Each edge should join from V1 to V2. Complete bipartite Graph : if each vertex of V1 is joined to every vertex of V2by an unique edge. Denoted by Kmn Total number of edges =m*n , Regular graph if m=n

Acyclic Graph : A graph without cycle is called acyclic. Trivial Graph : A graph with single vertex and no edges are called trivial graph.

Isomorphic Graph Two graphs are said to be isomorphic if there is one to one correspondence between their vertices and their edges such that incidencies & adjacency are preserved. Must have condition for isomorphism: Same no. of vertices Same no. of edges Same no. of vertices with a given degree.

Example f(a) = 1 f(b) = 6 f(c) = 8 f(d) = 3 f(g) = 5 f(h) = 2 f(i) = 4 f(j) = 7 Q: Find whether K6 & K3,3 are isomorphic or not ?

Subgraph If G(V,E) be any graph then a graph G’(V’,E’) is said to be a subgraph of G if E’ ⊆ E and V’ ⊆ V. Complement of a subgraph G’(V’,E’) with respect to the graph G is another G’’(V’’,E’’) such that E’’=E-E’ and V’’ contains only those vertices with which the edges in E’’ are incident. Spanning Subgraph: A subgraph which contains all the vertex of G

Edge disjoint subgraph: No common edge in two subgraph . Vertex disjoint subgraph : No common vertex in two subgraph. Factor of a graph : A k-factor of a graph is defined to be a spanning subgraph of the graph with the degree of each of its vertex being k. Exercise .

Planar graph A Graph G is said to be a planar graph if it can be drawn on a plane without intersecting the edges except at the common vertices.

Euler’s Formula. For any connected planar graph v-e+r=2 V= no. of vertices. e= no. of edges. r= no. of regions. Theorem1: If G(V,E) is a simple connected graph then e ≤ 3v-6 Theorem2: e ≤ 2v-4

Examples Are K5 , K6 and K3,3 are planar ?

Operations on Graph Union: If G1(V1,E1) and G2(V2,E2) are two graphs then union G3=G1UG2,whose vertex set is V3= V1UV2 and edge set E3 = E1UE2. Intersection: If G1(V1,E1) and G2(V2,E2) are two graphs then intersection G3=G1ΠG2,whose vertex set is V3= V1 Π V2 and edge set E3 = E1 Π E2. Ring sum: If G1(V1,E1) and G2(V2,E2) are two graphs then ringsum G3=G1⊕G2,whose vertex set is V3= V1 ⊕ V2 and edge set E3 = E1 ⊕ E2.

Complement of a graph: Complement of a graph G, denoted by G’ is the graph whose vertex set are same as the vertex set of G but two vertex are adjacent if they are not adjacent in G. Complement of a complete graph is always null graph. Self complementary graph : If it is isomorphic to its complement.

Handshaking Lemma The sum of the degree of all vertices in a graph G is twice the number of edges. or Σ d(vi)= 2e, i= 1….n

Exercise Q1. Show that the maximum degree of any vertex in a simple graph with n vertice is n-1. Q2. Show that the max. number of edges in a simple graph with n vertices is n(n-1)/2. Q3.How many nodes are require to construct a graph with exactly 6 edges in which each node is of degree 2. Q4. Is it possible to construct a graph with 12 nodes such that 2 of the nodes have degree 3 and remaining nodes have the degree 4. Q5. Is it possible to draw a simple graph with 4 vertices and 7 edges.

Paths & Circuit Path: Let G=(V,E) be any graph and let V0 and Vnbe any two vertices in V. A path of length n from V0 to Vn is a sequence of vertices & edges of the form(v0,e1,v1,e2…..envn) where each edge ej is an edge between Vj-1 & vj .The vertices Vo & Vn are called the end vertices & remaining are called interior vertices. Simple path : No repetition of edges. Elementary path: No repetition of vertices .

Circuit: A path becomes a circuit if vo=vn C=(v0 ,e1,v1,…..vn) Simple Circuit: No repetition of edges. Elementary circuit: No repetition of vertices

Eulerian paths & Ckt. A path is called an eulerian path if every edge of the graph G appears exactly once in the path. A circuit which contains every edge of the graph G exactly once is Eulerian ckt.

Theorems A graph contains an eulerian path if and only if it is connected and has either zero or two vertices of odd degree. A graph contains an eulerian ckt if and only if it is connected and its all vertices are of even degree. A directed graph contains an eulerian ckt if it is connected and the incoming degree of every vertex is equal to outgoing degree .

Verify

Exercise Under what condition Kmn(Complete bipartite graph) will have an eulerian ckt ? Case1: m=n & both are even. Case2: m=n & both are odd. Case3: m≠n & both are even. Case4: m ≠n & one is even & one is odd.

Hamilton paths & Ckt A path in a connected graph G is a hamilton path if it visit every vertex G exactly once. A ckt in a connected graph G is called a hamilton ckt if it visit every vertex of G exactly once. Theorem1: If the sum of the degree for each pair of vertex is ≥ n-1, then there exist a hamilton path. Theorem2: If the degree of each vertex in G ie d(v) ≥ n/2 , then G will contain hamilton ckt.

Verify

Exercise Find a hamilton path and a hamilton circuit in K4,3 . It has a hamilton path but not the hamilton ckt.

Shortest path algorithm Assumptions: Let G(V,E) be a simple connected graph . Let a and z be two vertices of the graph. L(x) denote the label of vertex x which represent the length of the shortest path from vertex a to vertex x. Wij denote the weight of the edge eij=(vi,vj)

Algorithm Step1: P is the set of those vertices which have the permanent labels, so P={ф} T= { all vertices of graph G} Set L(a)=0 ,L(x) =∞ ∀ x ∈ T and x ≠ a. Step 2: Select the vertices v in T which has the smallest labels. This label will be the permanent label of v. Set P=PU{v} and T =T-{v} If v=z ,then L(z) is the length of the shortest path from the vertex ato z and stop.

Step3: If v ≠ z,then revise the labels of vertices of T Step3: If v ≠ z,then revise the labels of vertices of T. The new label of a vertex x in T is given by L(x) =min{old L(x) , L(v) + w(v,x)} Where w(v,x) is the weight of the edge joining the vertex v and x.If no direct edge then w(v,x)= ∞ Step 4: Repeat step 2 & step 3 untill z gets the permanent labels.

Coloring of a Graph. One of the main way is to color the vertices of G such that no two adjacent vertices have the same color. It is called proper coloring. Chromatic number: The chromatic number of a graph G is the minimum number of colors required for the proper coloring of the graph G. In this case =3 This graph is called 3- chromatic

Chromatic no. of some commonly used graph Sr. No. Type of graph G Chromatic no. K(G) 1. Complete graph Kn n 2. Star graph Cn, n>1 2 3. Cycle graph Cn , n>1 2 for n is even 3 for n is odd 4. Wheel graph Wn, n >2 4 for n is even

Some observations A graph which has only isolated vertex has K(G)=1. A graph with one or more edges (Without a self loop) has a minimum K(G)=2. A graph consisting of simply one circuit with n≥3 vertices has K(G)=2 if n is even and K(G)=3 if n is odd. Every tree with two or more vertices has K(G)=2. If d is the maximum degree of the vertices in a graph G,then K(G)≤ d+1

Application of graph Theory Konigsberg Bridge Problem: Start from any four land area walkover the seven bridges exactly once. Vertices represent the land area and edges represent the bridge. Euler prove that solution of this problem does not exist.

Utility problem: Three houses H1 ,H2,H3 & three utilities W , G & E Utility problem: Three houses H1 ,H2,H3 & three utilities W , G & E.Is it possible to provide such a connection without any crossover. This graph can’t be drawn on a plane without crossing the edges.

Thank you