Planar Graphs
A graph is called planar if it can be drawn in the plane in such a way that no two edges cross. Example of a planar graph: The clique on 4 nodes.
A graph is called planar if it can be drawn in the plane in such a way that no two edges cross. Example of a planar graph: The clique on 4 nodes.
Is K 5 planar ?
What about K 3,3 ?
The problem of drawing a graph in the plane arises frequently in VLSI layout problems.
Definition: When a graph is drawn in the plane with no crossed edges, this particular embedding of the graph in the plane, it is called a plane graph. A plane graph cuts the plane into regions that we call faces. one face two faces
Question: Can you redraw this graph as a plane graph so as to alter the number of its faces?
This graph has 6 vertices 8 edges and 4 faces vertices – edges + faces = 2
This graph has 7 vertices 12 edges and 7 faces vertices – edges + faces = 2
Euler 1752 If G is a connected plane graph, then vertices – edges + faces = 2 Let v = # of vertices e = # of edges f = # of faces
Proof: By induction on the # of cycles of G. Base case: G has no cycles. G is connected so it must be a tree. Thus, e = v - 1 and f = 1.
Suppose G has at least one cycle C containing edge e. G is connected since e was on a cycle. f = f-1 and G has fewer cycles than G. v= v e= e-1 By induction hypothesis: v= # of vertices, e = # of edges, f = # of faces exterior e interior Let
Corollary: No matter how we redraw a plane graph it will have the same # of faces. Proof: f = 2 – v + e is determined by v and e, neither of which change when we redraw the graph.
Platonic Solids A Platonic solid has congruent regular polygons as faces and has the same number of edges meeting at each corner. Each one can be flattened into a planar graph: With constant degree: k and the same number of edges bounding each face: l
= # of edges coming from x vertex x Each edge belongs to 2 faces: By Euler’s formula: and k,l 3 for physical reasons
The only solutions: tetrahedron cube octahedron dodecahedron icosahedron
Theorem: Every (simple) n -node planar graph G has at most 3n-6 edges. Proof: n = 3 : Clearly true. n 3 : consider a graph G with a maximal number of edges. Thus G must be connected or else we could add an edge. Every face has at least 3 edges on its boundary. Every edge lies on the boundary of at most 2 faces. Thus
The Kuratowski Graphs
Corollary: K 5 is not planar. A planar graph on n = 5 nodes can have at most 3n-6 = 9 edges. Thus: K 5 is not planar.
Fact: K 3,3 is not planar either. a c b z y x When we redraw K 3,3, the yellow cycle will be laid out: a b c x y z
For K 3,3, each region has at least 4 edges, Hence 4f <= 2e. If K 3,3 is planar, f = e - n + 2 = 9 – = 5. So 20=4f <= 2e=18, a contradiction. Fact: K 3,3 is not planar either.
Insight 1. If we replace edges in a Kuratowski graph by paths of whatever length, they remain non-planar.
Insight 2 If a graph G contains a subgraph obtained by starting with K 5 or K 3,3 and replacing edges with paths, then G is non-planar.
Elementary subdivision (homeomorphic operation) uwuvw G 1 and G 2 are called homeomorphic if they are isomorphic or if they can both be obtained from the same loop-free undirected graph H by a sequence of elementary subdivisions. ab c de ab c de ab c de ab c de Two homeomorphic graphs are simultaneously planar or nonplanar.
Kuratowski’s Theorem [1930] A graph is planar if and only if it contains no subgraph obtainable from K 5 or K 3,3 by replacing edges with paths.
Appel-Haken Four-Color Theorem [1976] The vertices of any planar graph can be 4-colored in such a way that no two adjacent vertices receive the same color.
Five Color Theorem Any planar graph can be colored with five colors.
Lemma: Every Planar Graph Contains a Node of Degree · 5 If every node has degree at least 6, then the number of edges would be 3n, which would contradict our upper bound of 3n-6 edges in an n-node planar graph.
Proof of 5-color theorem Let G be a node-minimal counter- example to the theorem, i.e., a planar graph that requires 6 colors. By Lemma, G must have a node q with degree · 5. Let the nodes adjacent to q be named v 1, v 2, v 3, v 4, and v 5.
V 1, V 2, V 3, V 4, V 5 can’t form a K 5 Some two neighbors v a, and v b of q must not have an edge between them. va vava va vb vbvb vb
Edge Contraction Contract the edges and of G to obtain a planar graph G’. G’ is 5 colorable since it has fewer nodes than G. va vava va vb vbvb vb v a, v b, and q become a single node in G’
Using G’ to 5-color G. Color v a and v b the same as . Color each node besides q, as it is colored in G’. Color q whatever color is not used on its 5 neighbors. va vava va vb vbvb vb v a, v b, and q become a single node in G’
11.5 Hamilton Paths and Cycles a path or cycle that contain every vertex Unlike Euler circuit, there is no known necessary and sufficient condition for a graph to be Hamiltonian. Ex ab c d e f g h i There is a Hamilton path, but no Hamilton cycle. an NP-complete problem
11.5 Hamilton Paths and Cycles Ex x yy y y xx x y y start labeling from here 4x's and 6y's, since x and y must interleave in a Hamilton path (or cycle), the graph is not Hamiltonian The method works only for bipartite graphs. The Hamilton path problem is still NP-complete when restricted to bipartite graphs.
11.5 Hamilton Paths and Cycles Ex students sit at a circular table, how many sittings are there such that one has two different neighbors each time? Consider K 17, a Hamilton cycle in K 17 corresponds to a seating arrangements. Each cycle has 17 edges, so we can have (1/17)17(17-1)/2=8 different sittings ,2,3,4,5,6,...,17, ,3,5,2,7,4,...,17,14,16, ,5,7,3,9,2,...,16,12,14,1 14
11.5 Hamilton Paths and Cycles case 1.v v 1 v 2...v m case 2. v 1 v 2...v k v v k+1...v m case 3. v 1 v 2...v m v
11.5 Hamilton Paths and Cycles Ex In a round-robin tournament each player plays every other player exactly once. We want to somehow rank the players according to the result of the tournament. not always possible to have a ranking where a player in a certain position has beaten all of the opponents in later positions a b c but by Theorem 11.7, it is possible to list the players such that each has beaten the next player on the list
11.5 Hamilton Paths and Cycles Proof: First prove that G is connected. If not, xy n 1 vertices n 2 vertices a contradiction
11.5 Hamilton Paths and Cycles Assume a path p m with m verticesv 1 v 2 v 3... v m case 1. either v v 1 or v m v case 2. v 1,v 2,...,v m construct a cycle either v 1 v 2 v 3... v m or v 1 v 2 v 3...v t-1 v t... v m otherwise assume deg(v 1 )=k, then deg(v m )<m-k. deg(v 1 )+deg(v m )<m<n-1, a contradiction Therefore, v can be added to the cycle. v
11.5 Hamilton Paths and Cycles Proof: Assume G does not contain a Hamilton cycle. We add edges to G until we arrive a subgraph H of K n where H has no Hamilton cycle, but for any edge e not in H, H+e has a Hamilton cycle. For vertices a,b wher (a,b) is not an edge of H. H+(a,b) has a Hamilton cycle and (a,b) is part of it.
11.5 Hamilton Paths and Cycles a(=v 1 ) b(=v 2 ) v 3... v n If (b,v i ) is in H, then (a,v i-1 ) cannot be in H. Otherwise, b v i v n a v i-1 v i-2 v 3 is a Hamilton cycle in H.
11.5 Hamilton Paths and Cycles
A related problem: the traveling salesman problem a b c d e Find a Hamilton cycle of shortest total distance. 2 graph problem vs. Euclidean plane problem (computational geometry) Certain geometry properties (for example, the triangle inequality) sometimes (but not always) make it simpler. For example, a-b-e-c-d-a with total cost= =12.
11.5 Hamilton Paths and Cycles Two famous computational geometry problems. 1. closest pair problem: which two points are nearest 2. convex hull problem the convex hull
11.6 Graph Coloring and Chromatic Polynomials Def If G=(V,E) is an undirected graph, a proper coloring of G occurs when we color the vertices of G so that if (a,b) is an edge in G, then a and b are colored with different colors. The minimum number of colors needed to properly color G is called the chromatic number of G and is written (G). b c d e a 3 colors are needed. a: Red b: Green c: Red d: Blue e: Red In general, it's a very difficult problem (NP-complete). (K n )=n (bipartite graph)=2
11.6 Graph Coloring and Chromatic Polynomials A related problem: color the map where two regions are colored with different colors if they have same boundaries. G R e B B R Y Four colors are enough for any map. Remain a mystery for a century. Proved with the aid of computer analysis in a b c d f a b c d e f
11.6 Graph Coloring and Chromatic Polynomials P(G, ): the chromatic polynomial of G=the number of ways to color G with colors. Ex (a) G=n isolated points, P(G, )= n. (b) G=K n, P(G, )= ( -1)( -2)...( -n+1)= (n) (c) G=a path of n vertices, P(G, )= ( -1) n-1. (d) If G is made up of components G 1, G 2,..., G k, then P(G, )=P(G 1, )P(G 2, )...P(G k, ). Ex e G e G e G' coalescing the vertices
11.6 Graph Coloring and Chromatic Polynomials Theorem Decomposition Theorem for Chromatic Polynomials. If G=(V,E) is a connected graph and e is an edge, then P(G e, )=P(G, )+P(G' e, ). e G e G e G' coalescing the vertices a b In a proper coloring of G e : case 1. a and b have the same color: a proper coloring of G' e case 2. a and b have different colors: a proper coloring of G. Hence, P(G e, )=P(G, )+P(G' e, ).
Chapter 11 An Introduction to Graph Theory 11.6 Graph Coloring and Chromatic Polynomials Ex e=- P(G e, )P(G, ) P(G' e, ) P(G, )= ( -1) 3 - ( -1)( -2)= Since P(G,1)=0 while P(G,2)=2>0, we know that (G)=2. Ex =-=-2 ee P(G, )= (4) -2 (4) = ( -1)( -2) 2 ( -3) (G)=4
User Interface How many objects appear in the pink window? (real-time response required) 4 2 3
Idea: View each rectangle as a mesh. interior faces (mesh is planar)
Objects are placed on an n n grid. Data structure will contain: for each grid node # objects containing node for each grid edge # objects containing edge for each (interior) face #objects containing face window border touches no nodes
Partial Overlap of Window and Object ignore object’s nodes and edges outside window
edge counts in node counts in face counts in # of objects intersecting