1.54k likes | 1.88k Views
Graph Theory. Fundamental concepts. Agenda. 1 What Is a Graph? 2 Paths, Cycles, and Trails 3 Vertex Degree and Counting 4 Directed Graphs. X. W. Y. Z. The K Ö nigsberg Bridge Problem. Königsber is a city on the Pregel river in Prussia
E N D
Graph Theory Fundamental concepts Fundamental Concept
Agenda 1 What Is a Graph? 2 Paths, Cycles, and Trails 3 Vertex Degree and Counting 4 Directed Graphs Fundamental Concept
X W Y Z The KÖnigsberg Bridge Problem • Königsber is a city on the Pregel river in Prussia • The city occupied two islands plus areas on both banks • Problem: Whether they could leave home, cross every bridge exactly once, and return home. Fundamental Concept
X e1 e6 e2 X W Y e5 e4 W Y e3 e7 Z Z A Model • Avertex : a region • An edge : a path(bridge) between two regions Fundamental Concept
General Model • Avertex : an object • An edge : a relation between two objects Committee 2 Committee 1 commonmember Fundamental Concept
X e1 e6 e2 W e5 Y e4 e3 e7 Z What Is a Graph? • A graph Gis a triple consisting of: • A vertex set V(G ) • An edge set E(G ) • A relation between an edge and a pair of vertices Fundamental Concept
Loop, Multiple edges • Loop : An edge whose endpoints are equal • Multiple edges : Edges have the same pair of endpoints Multiple edges loop Fundamental Concept
Simple Graph • Simple graph : A graph has no loops or multiple edges Multiple edges loop It is a simple graph. It is notsimple. Fundamental Concept
Adjacent, neighbors • Two vertices are adjacent and are neighbors if they are the endpoints of an edge • Example: • A and B are adjacent • A and D are not adjacent B A C D Fundamental Concept
Finite Graph, Null Graph • Finite graph : an graph whose vertex set and edge set are finite • Null graph : the graph whose vertex set and edges are empty Fundamental Concept
u u v y y v G’ w w x x Complement • Complement of G: The complement G’ of a simple graphG : • A simple graph • V(G’) = V(G) • E(G’) = { uv| uvE(G) } G Fundamental Concept
Clique and Independent set • A Clique in a graph: a set of pairwise adjacent vertices (a complete subgraph) • An independent set in a graph: a set of pairwise nonadjacent vertices • Example: • {x, y, u} is a clique in G • {u, w} is an independent set u G v y w x Fundamental Concept
Bipartite Graphs • A graph Gis bipartite if V(G)is the union of two disjoint independent sets called partite sets ofG • Also: The vertices can be partitionedinto two sets such that each set is independent • Matching Problem • Job Assignment Problem Workers Boys Girls Jobs Fundamental Concept
Green Blue Blue Red Chromatic Number • The chromatic number of a graph G, writtenx(G), is the minimum number of colors needed to label the vertices so that adjacent vertices receive different colors x(G) = 3 Fundamental Concept
Maps and coloring • A map is a partition of the plane into connected regions • Can we color the regions of every map using at most four colors so that neighboring regions have different colors? • Map Coloring graph coloring • A region A vertex • Adjacency An edge Fundamental Concept
Scheduling and graph Coloring 1 • Two committees can not hold meetings at the same time if two committees have common member Committee 2 Committee 1 commonmember Fundamental Concept
Scheduling and graph Coloring 1 • Model: • One committee being represented by a vertex • An edge between two vertices if two corresponding committees have common member • Two adjacent vertices can not receive the same color Committee 2 Committee 1 commonmember Fundamental Concept
Scheduling and graph Coloring 2 • Scheduling problem is equivalent to graph coloring problem Committee 2 Common Member Different Color Common Member Committee 1 Committee 3 No Common Member Same Color OK Same time slot OK Fundamental Concept
Path and Cycle • Path : a sequence of distinct vertices such that two consecutive vertices are adjacent • Example: (a, d, c, b, e) is a path • (a, b, e, d, c, b, e, d) is not a path; it is a walk • Cycle : a closed Path • Example:(a, d, c, b, e, a) is a cycle a b c e d Fundamental Concept
Subgraphs • A subgraph of a graph Gis a graph Hsuch that: • V(H) V(G) andE(H) E(G) and • The assignment of endpoints to edges in His the same as in G. Fundamental Concept
c d Subgraphs • Example:H1, H2, andH3are subgraphs of G b a c G d e b a b a H3 c H1 H2 e d d e Fundamental Concept
b a d e b a c c d d Connected and Disconnected • Connected : There exists at least one path between two vertices • Disconnected : Otherwise • Example: • H1andH2are connected • H3is disconnected H3 H1 H2 e Fundamental Concept
ei vk vj Adjacency, Incidence, and Degree • Assumeeiis an edge whose endpoints are (vj,vk) • The vertices vjandvkare said to be adjacent • The edge ei is said to be incident uponvj • Degree of a vertex vk is the number of edges incident uponvk . It is denoted as d(vk) Fundamental Concept
w w x y z 0 1 1 0 1 0 2 0 1 2 0 1 0 0 1 0 b wxyz y z a c e d x Adjacency matrix • LetG = (V, E), |V| = nand |E|=m • The adjacency matrix of GwrittenA(G), is the n-by-nmatrix in which entry ai,jis the number of edges inGwith endpoints {vi, vj}. Fundamental Concept
Incidence Matrix • LetG = (V, E), |V| = nand |E|=m • The incidence matrixM(G) is the n-by-mmatrix in which entrymi,jis 1 ifviis an endpoint ofeiand otherwise is 0. w a b c d e 1 1 0 0 0 1 0 1 1 0 0 1 1 1 1 0 0 0 0 1 b wxyz y a z c e d x Fundamental Concept
Isomorphism • An isomorphism from a simple graph Gto a simple graphHis a bijection f:V(G)V(H) such thatuvE(G) if and only if f(u)f(v) E(H) • We say “G is isomorphic to H”, writtenGH f1: w x y z c b d a y c w d H G a z f2: w x y z a d b c x b Fundamental Concept
Complete Graph • Complete Graph : a simple graph whose vertices are pairwise adjacent Fundamental Concept
Complete Bipartite Graph or Biclique • Complete bipartite graph (biclique) is a simple bipartite graph such that two vertices are adjacent if and only if they are in different partite sets. Complete Bipartite Graph Fundamental Concept
Petersen Graph 1.1.36 • The petersen graphis the simple graph whose vertices are the 2-element subsets of a 5-element set and whose edges are pairs of disjoint 2-element subsets Fundamental Concept
12 35 34 45 25 13 24 14 15 23 Petersen Graph • Assume: the set of 5-element be (1, 2, 3, 4, 5) • Then, 2-element subsets: (1,2) (1,3) (1,4) (1,5) (2,3) (2,4) (2,5) (3,4) (3,5) (4,5) 45: (4, 5) Disjoint, so connected Fundamental Concept
Petersen Graph • Three drawings Fundamental Concept
u, v Theorem: If two vertices are non-adjacent in the Petersen Graph, then they have exactly one common neighbor. Proof: No connection, Joint, One common element. 3 elements in these vertices totally x, z x, y Since 5 elements totally, 5-3 elements left. Hence, exactly one of this kind. Fundamental Concept
Girth • Girth : the length of its shortest cycle. • If no cycles, girth is infinite Fundamental Concept
Girth and Petersen graph • Theorem: The Petersen Graph has girth 5. Proof: • Simple no loop no 1-cycle (cycle of length 1) • Simple no multiple no 2-cycle • 5 elements no three pair-disjoint 2-sets no 3-cycle • By previous theorem, two nonadjacent vertices has exactly one common neighbor no 4-cycle • 12-34-51-23-45-12 is a 5-cycle. Fundamental Concept
Walks, Trails • A walk: a list of vertices and edges v0, e1, v1, …., ek, vk such that, for 1 i k, the edge eihas endpoints vi-1 and vi . • A trail: a walk with no repeated edge. Fundamental Concept
Paths • A u,v-walk or u,v-trail has first vertex u and last vertex v; these are its endpoints. • A u,v-path: a u,v-trail with no repeated vertex. • The lengthof a walk, trail, path, or cycle is its number of edges. • A walk or trail is closed if its endpoints are the same. Fundamental Concept
Lemma: Every u,v-walk contains a u,v-path Proof: • Use induction on the length of a u, v-walk W. • Basis step: l = 0. • Having no edge, W consists of a single vertex (u=v). • This vertex is a u,v-path of length 0. • Induction step : l 1. • Suppose that the claim holds for walks of length less thanl. • IfWhas no repeated vertex, then its vertices and edges form a u,v-path. Fundamental Concept
Lemma: Every u,v-walk contains a u,v-path 1.2.5 Proof:Continue • Induction step : l 1. Continue • IfWhas a repeated vertex w, then deleting the edges and vertices between appearances of w (leaving one copy of w) yields a shorter u,v-walkW’contained in W. • By the induction hypothesis, W ’ contains au,v-path P, and this path Pis contained in W. Delete Fundamental Concept
Components • The components of a graph G are its maximal connected subgraphs • A component (or graph) is trivial if it has no edges; otherwise it is nontrivial • An isolated vertex is a vertex of degree 0 Fundamental Concept
Theorem: Every graph withnvertices and kedges has at least n-kcomponents Proof: • An n-vertex graph with no edges has n components • Each edge added reduces this by at most 1 • If k edges are added, then the number of components is at least n - k Fundamental Concept
Theorem: Every graph with n vertices and k edges has at least n-k components • Examples: n =6, k =3, 4 components n =6, k =3, 3 components n =2, k =1, 1 component n =3, k =2, 1 component Fundamental Concept
Not a Cut-vertex Cut-edge Cut-edge Cut-vertex Cut-edge, Cut-vertex • A cut-edge or cut-vertexof a graph is an edge or vertex whose deletion increases the number of components Fundamental Concept
Cut-edge, Cut-vertex • G-eorG-M : The subgraph obtained by deleting an edgeeor set of edges M • G-v orG-S : The subgraph obtained by deleting a vertexvor set of vertices S G-e G e Fundamental Concept
B A C D E B A C D Induced subgraph • An induced subgraph : • A subgraph obtained by deleting a set of vertices • We write G[T] forG-T’, whereT’ =V(G)-T • G[T] is the subgraph of Ginduced by T • Example: • Assume T:{A, B, C, D} G[T] G Fundamental Concept
C B C B D A B A D C A B C D E Induced subgraph • More Examples: • G2is the subgraph of G1induced by (A, B, C, D) • G3 is the subgraphofG1induced by (B, C) • G4is not the subgraph induced by (A, B, C, D) G3 G4 G1 G2 Fundamental Concept
B A C D E B C Induced subgraph • A set S of vertices is an independent set if and only if the subgraph induced by it has no edges. • G3 is an example. G3 G1 Fundamental Concept
Theorem: An edge e is a cut-edge if and only if e belongs to no cycles. Proof :1/2 • Let e= (x, y) be an edge in a graphGandHbe the component containinge. • Since deletion of eeffects no other component, it suffices to prove thatH-e is connected if and only ifebelongs to a cycle. • First suppose that H-eis connected. • This implies that H-econtains an x, y-path, • This path completes a cycle with e. Fundamental Concept
Theorem: An edge e is a cut-edge if and only if e belongs to no cycles. Proof :2/2 • Now suppose that elies in a cycle C. • Choose u, vV(H) • SinceHis connected, Hhas a u, v-path P • IfPdoes not contain e • Then Pexists in H-e • Otherwise(Pcontainse) • Suppose by symmetry that xis betweenuandyonP • SinceH-econtains au, x-path alongP, the transitivity of the connection relation implies that H-ehas au, v-path • We did this for all u, v V(H), soH-eis connected. Fundamental Concept
Theorem: An edge eis a cut-edge if and only if e belongs to no cycles. • An Example: Fundamental Concept
Lemma: Every closed odd walk contains an odd cycle Proof:1/3 • Use induction on the length l of a closed odd walk W. • l=1. A closed walk of length 1 traverses a cycle of length 1. • We need to prove the claim holds if it holds for closed odd walks shorter than W. Fundamental Concept