Graph Theory: Introduction Graph Theory: Introduction Pallab Dasgupta Dept. of CSE, IIT Kharagpur pallab@cse.iitkgp.ernet.in pallab@cse.iitkgp.ernet.in CSE, IIT KGP
Resources Resources • Copies of slides available at: http://www.facweb.iitkgp.ernet.in/~pallab • Book to be followed mainly: Introduction to Graph Theory -- Douglas B West CSE, IIT KGP
Graph Theory Graph Theory • A graph is a discrete structure – Mathematically, a relation • Graph theory is about studying – Properties of various types of Graphs – … and graph algorithms Why should CSE students study graph theory? Why should CSE students study graph theory? CSE, IIT KGP
Graphs can be used to model problems Graphs can be used to model problems • The following table illustrates a number of possible duties for the drivers of a bus company. • We wish to ensure at the lowest possible cost, that at least one driver is on duty for each hour of the planning period (9 AM to 5 PM). Duty 9 – 1 9 – 11 12 – 3 12 – 5 2 – 5 1 – 4 4 – 5 hours Cost 300 180 210 380 200 340 90 CSE, IIT KGP
Graphs can be used to model problems Graphs can be used to model problems 1 CSE, IIT KGP
Graph Graph • A graph G = (V,E) with n n vertices and vertices and m m edges consists of: edges consists of: A graph G = (V,E) with a vertex set vertex set V(G) = {v V(G) = {v 1 , …, v n }, and – a 1 , …, v n }, and an edge set edge set E(G) = {e E(G) = {e 1 , …, e m }, where each edge consists – an 1 , …, e m }, where each edge consists of two (possibly equal) vertices called its endpoints. endpoints. of two (possibly equal) vertices called its • We write uv uv for an edge for an edge e={u,v} e={u,v} , and say that , and say that u u and and v v are are We write adjacent adjacent • A simple graph simple graph is a graph having no loops or multiple edges is a graph having no loops or multiple edges A – What is a What is a loop loop ? ? CSE, IIT KGP
Digraph Digraph • A directed graph or digraph G consists of a vertex set V(G) and an edge set E(G), where each edge is an ordered pair of vertices. – A simple digraph is a digraph in which each ordered pair of vertices occurs at most once as an edge. – Throughout this course we shall consider undirected simple graphs, unless mentioned otherwise. CSE, IIT KGP
Complement Complement ′ of a simple graph G is • The G ′ The complement complement G of a simple graph G is the simple graph with vertex set V(G) and the simple graph with vertex set V(G) and edge set defined by: edge set defined by: ∈ E( ′ ) if and only if ∉ E(G) – uv uv ∈ G ′ uv ∉ E(G ) if and only if uv E(G) CSE, IIT KGP
Subgraph Subgraph • A A subgraph subgraph of a graph G is a graph H, such of a graph G is a graph H, such that: that: ⊆ V(G) and E(H) ⊆ E(G) – V(H) V(H) ⊆ V(G) and E(H) ⊆ E(G) • An An induced subgraph induced subgraph of G is a subgraph H of G is a subgraph H of G such that E(H) consists of all edges of of G such that E(H) consists of all edges of G whose endpoints belong to V(H) G whose endpoints belong to V(H) CSE, IIT KGP
Complete Graph / Clique Complete Graph / Clique • A A complete graph complete graph or a or a clique clique is a simple is a simple graph in which every pair of vertices is an graph in which every pair of vertices is an edge. edge. – We use the notation K We use the notation K n to denote a clique of n n n to denote a clique of vertices vertices ′ of K n ′ The complement K n of K n has no edges – The complement K n has no edges – How does an induced subgraph of a clique look How does an induced subgraph of a clique look like? like? CSE, IIT KGP
Independent set Independent set • An An independent subset independent subset in a graph G is a in a graph G is a ⊆ V(G) S ⊆ vertex subset S V(G) that contains no that contains no vertex subset edge of G edge of G CSE, IIT KGP
Bipartite Graph Bipartite Graph • A graph G is A graph G is bipartite bipartite if V(G) is the union of if V(G) is the union of two disjoint sets such that each edge of G two disjoint sets such that each edge of G consists of one vertex from each set. consists of one vertex from each set. – A complete bipartite graph is a bipartite graph A complete bipartite graph is a bipartite graph whose edge set consists of all pairs having a whose edge set consists of all pairs having a vertex from each of the two disjoint sets of vertex from each of the two disjoint sets of vertices vertices – A complete bipartite graph with partite sets of A complete bipartite graph with partite sets of sizes r r and and s s is denoted by K is denoted by K r,s sizes r,s CSE, IIT KGP
K-partite Graph K-partite Graph • A graph G is A graph G is k-partite k-partite if V(G) is the union of if V(G) is the union of k independent sets. independent sets. k CSE, IIT KGP
Chromatic number Chromatic number • A graph is A graph is k-colorable k-colorable , if we can color the , if we can color the vertices of the graph using k k colors such colors such vertices of the graph using that the endpoints of each edge have that the endpoints of each edge have different colors different colors χ (G) of a graph G is the – The , χ The chromatic number chromatic number , (G) of a graph G is the minimum number of colors required to color G. minimum number of colors required to color G. CSE, IIT KGP
Planar Graph Planar Graph • A graph is A graph is planar planar if it can be drawn in the if it can be drawn in the plane without edge crossings plane without edge crossings CSE, IIT KGP
Path & Cycle Path & Cycle • A A path path in a graph is a single vertex or an in a graph is a single vertex or an ordered list of distinct vertices v v 1 , …, v k such such ordered list of distinct vertices 1 , …, v k ≤ i ≤ k. 2 ≤ i ≤ that v v i-1 v 1 is an edge for all is an edge for all 2 k. that i-1 v 1 the ordered list is a cycle cycle if if v v k v 1 is also an edge – the ordered list is a k v 1 is also an edge – A path is an A path is an u,v-path u,v-path if if u u and and v v are respectively are respectively the first and last vertices on the path the first and last vertices on the path – A path of A path of n n vertices is denoted by vertices is denoted by P P n , and a n , and a cycle of n n vertices is denoted by vertices is denoted by C C n . cycle of n . CSE, IIT KGP
Connected Graph Connected Graph • A graph G is A graph G is connected connected if it has a if it has a u,v-path u,v-path ∈ V(G). u,v ∈ for each pair u,v V(G). for each pair CSE, IIT KGP
Walk and Trail Walk and Trail A walk walk of length of length k k is a sequence, is a sequence, v v 0 ,e 1 ,v 1 ,e 2 , • A 0 ,e 1 ,v 1 ,e 2 , …, e k ,v k of vertices and edges such that e e i = …, e k ,v k of vertices and edges such that i = v i-1 v i for all for all i i . . v i-1 v i • A A trail trail is a walk with no repeated edge. is a walk with no repeated edge. – A A path path is a walk with no repeated vertex is a walk with no repeated vertex – A walk is A walk is closed closed if it has length at least one and if it has length at least one and its endpoints are equal its endpoints are equal – A A cycle cycle is a closed trail in which “first = last” is is a closed trail in which “first = last” is the only vertex repetition the only vertex repetition – A A loop loop is a cycle of length one is a cycle of length one CSE, IIT KGP
Equivalence Relation Equivalence Relation • A A relation relation R on a set S is a collection of R on a set S is a collection of ordered pairs from S. ordered pairs from S. • An An equivalence relation equivalence relation is a relation R that is a relation R that is reflexive, symmetric and transitive. is reflexive, symmetric and transitive. CSE, IIT KGP
Graphs as Relations Graphs as Relations • A graph is an adjacency relation. For simple A graph is an adjacency relation. For simple undirected graphs the relation is symmetric, undirected graphs the relation is symmetric, and not reflexive. and not reflexive. – The adjacency relation is not necessarily an The adjacency relation is not necessarily an equivalence relation, since it is not necessarily equivalence relation, since it is not necessarily transitive. transitive. CSE, IIT KGP
Graph Isomorphism Graph Isomorphism • An An isomorphism isomorphism from G to H is a bijection from G to H is a bijection ∈ E(G) uv ∈ f:V(G) V(H) V(H) such that such that uv E(G) if and if and f:V(G) ∈ E(H). f(u)f(v) ∈ only if f(u)f(v) E(H). only if – We say that We say that G is isomorphic to H G is isomorphic to H , written as , written as ≡ H, if there is an isomorphism from G to H. G ≡ H, if there is an isomorphism from G to H. G – Is isomorphism an equivalence relation? Is isomorphism an equivalence relation? CSE, IIT KGP
Automorphism Automorphism • An An automorphism automorphism of G is a permutation of of G is a permutation of V(G) that is an isomorphism from G to G. V(G) that is an isomorphism from G to G. – A graph is called A graph is called vertex transitive vertex transitive if for every if for every ∈ V(G) u,v ∈ pair u,v V(G) there is an automorphism that there is an automorphism that pair maps u u to to v v . . maps CSE, IIT KGP
Recommend
More recommend