420 likes | 561 Views
Great Theoretical Ideas In Computer Science. Planar Graphs. Lecture 22. CS 15-251. 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:.
E N D
Great Theoretical Ideas In Computer Science Planar Graphs Lecture 22 CS 15-251
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:
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.
What about the intriguing object that I brought to class today?
The problem of drawing a graph in the plane arises frequently in VLSI layout problems.
two faces one face 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.
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.
Let v= # of vertices, e= # of edges, f = # of faces exterior e interior By induction hypothesis: 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
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.
A Platonic solid has congruent regular polygons as faces and has the same number of edges meeting at each corner. Platonic Solids 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 vertexx = 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. Thus Thus Proof: n = 3: Clearly true. n 3:consider a graph G with a maximal number of edges. • 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.
Corollary: K5 is not planar. A planar graph on n = 5 nodes can have at most 3n-6 = 9 edges. Thus: K5 is not planar.
When we redraw K3,3 , the yellow cycle will be laid out: x a b z y c Fact: K3,3 is not planar either. a x y b z c
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 K5 or K3,3 and replacing edges with paths, then G is non-planar.
Kuratowski’s Theorem [1930] A graph is planar if and only if it contains no subgraph obtainable from K5 or K3,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 v1, v2, v3, v4, and v5.
V1, V2, V3, V4, V5 can’t form a K5 • Some two neighbors va, and vb of q must not have an edge between them. vb va
Edge Contraction • Contract the edges <q, va> and <q,vb> of G to obtain a planar graph G’. G’ is 5 colorable since it has fewer nodes than G. vb va va, vb, and q become a single node a in G’
Using G’ to 5-color G. • Color va and vb the same as a. Color each node besides q, as it is colored in G’. Color q whatever color is not used on its 5 neighbors. vb va va, vb, and q become a single node a in G’
2 4 3 User Interface How many objects appear in the pink window? (real-time response required)
(mesh is planar) interior faces Idea: View each rectangle as a mesh.
window border touches no nodes Objects are placed on an nn 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
ignore object’s nodes and edges outside window Partial Overlap of Window and Object
edge counts in node counts in face counts in # of objects intersecting
sum of node counts in sum of edge counts in sum of face counts in Inclusion-Exclusion Speed-up! store 3-tuple:
a c d b Node count in is a – b – c + d. c a 1 1 0 b d -1 0 0 1 0 1