270 likes | 475 Views
Planarity Testing. Overview. Definitions Menger’s Theorem Ear Decomposition Lemma Pieces Planarity Testing Algorithm Complexity O(n ). 3. * We’ll only discuss connected undirected graphs. Definitions. Cut vertex Cut edge Block Two blocks share at most one vertex – cut-vertex.
E N D
Overview • Definitions • Menger’s Theorem • Ear Decomposition Lemma • Pieces • Planarity Testing Algorithm • Complexity O(n ) 3 * We’ll only discuss connected undirected graphs
Definitions • Cut vertex • Cut edge • Block • Two blocks share at most one vertex – cut-vertex Connected Components: 1 3 Connected Components: 1 2
DFS • Depth First Search • Use the DFS tree to find Blocks 2 1 5 3 4 7 6 7 G DFS tree
Menger’s Theorem (1927) • k-connected – deleting (k-1) vertices cannot disconnect it (|V(G)| >= k). • Corollary (Dirac 1960) – • G is 2-connected G consists of a single block G is k-connected Any pair u, v V(G) can be connected by k vertex-disjoint paths. Any k vertices of G lie on a simple cycle G is k-connected
ST-Ordering • Numbering - v1, v2, ... , vnof V(G) so that • (v1, vn) E(G) • vi has a neighbor vjwhere j < i • vi also has a neighbor vkwhere i < k (for every i , 1 < i < n) • G admits an st-ordering G is 2-connected We’ll prove it soon
Ear Decomposition Lemma • Every 2-connected graph can be obtained from a cycle by adding paths • For each path: • Both end points are on the current graph • But otherwise it is disjoint from it • Proof • Gi G, Gi ≠ G the current graph. • Pick u V(Gi) , v V(Gi) such that (u, v) E(G) and connect v to Gi by a shortest path.
G admits an st-ordering G is 2-connected • G is 2-connected • Use induction on |E(G)| • Show G admits st-ordering with • v1 = u, v2, ... , vn = v (u, v) E(G) • Pick a cycle C through (u, v) • Base: • G = C • trivial (v1) u v (v5) v2 v4 v3
Continued • C ≠ G (v1) u v (v5) G0 = C G
Continued • C ≠ G • Add a path to it as in the ear decomposition • Number the path’s vertices so they form an increasing chain connecting its endpoints (v1) u v (v5) G0 = C G1 v4 v3 Shortest path
Continued • C ≠ G • Add a path to it as in the ear decomposition • Number the path’s vertices so they form an increasing chain connecting its endpoints (v1) u v (v5) G1 G2 v2 v4 v3
Pieces • G is 2-connected • C is a cycle in G • Pieces • C is Separating P2 P1 P3
Pieces • Pieces can be drawn on either side of C P2 P1 P3
Pieces • Pieces can be drawn on either side of C P2 P1 P3
Pieces • Pieces can be drawn on either side of C P2 P1 P3
Pieces • Pieces can be drawn on either side of C P2 P1 P3
Pieces • Two pieces Interlace or Conflict if they cannot be drawn on the same side of C without crossing edges • When does this happen? G G’ P2 a1 Cyclic order: a1, b1, a3, b3 P1 a2 b1 b3 P3 a3 b2
Pieces • G’ might be a planar graph P2 G’ P1 P3
Pieces • G’ might be a planar graph • If one of the conflicting pieces can be drawn on the other side of C P2 G’ P1 P3
Our Goal • Find 2 sets (S1, S2) of pieces so that: • No two pieces in the same set conflict • S1 S2 C = G ∩ ∩ P2 G S1 = {P1, P2} S2 = {P3} P1 P3
Interlacement Graph • Vertex set – the set of pieces (with respect to C) • Two vertices are connected the pieces interlace Interlacement(G, C): P2 G P1 P3
Is G planar? • G 2-connected graph with cycle C • G is planar • For each piece P (with respect to C) • P C is a planar graph • The Interlacement graph is bipartite (2-colorable) ∩
Why? P2 Interlacement(G, C): G S1 P1 S2 If Interlacement(G, C) is bipartite, we can divide the pieces to 2 sets - like we wanted P3
Why? • Each piece combined with C is a planar graph • And we can assemble all the pieces together so that they don’t interlace • So G is planar
Planarity Testing Recursive Algorithm • G 2-connected graph with • n vertices • O(n) edges • C is a cycle in G The Algorithm: • Find pieces with respect to C • Build interlace graph • Check if it is bipartite • Check planarity for C’s pieces (recursively) ( ) O(n) + * O(n ) 2 + O(n ) 2 O(n) Total Cost = O(n ) 3