Download presentation
Presentation is loading. Please wait.
1
Planarity Testing
2
Overview Definitions Menger’s Theorem Ear Decomposition Lemma Pieces
Planarity Testing Algorithm Complexity O(n ) Connected – otherwise can show for each connected component. 3 * We’ll only discuss connected undirected graphs
3
Definitions Cut vertex Cut edge Block
Two blocks share at most one vertex – cut-vertex Connected Components: 3 1 Connected Components: 2 1 Cut vertex\edge – whose deletion increases the number of connected components. Block – maximal connected sub-graph with no cut-vertex Why? Suppose 2 or more shared vertices, then deleting one still leaves a connected graph – contradicts the maximally property of a block. Why cut vertex? If it’s the only connection, then removing it will disconnect the two blocks, adding to the number of connected components.
4
DFS Depth First Search Use the DFS tree to find Blocks G DFS tree 3 4
5 7 6 1 2 G Undirected graph – only tree or back edges. Block – if no w BELOW v has an ancestor above u – which is v’s parent, then the sub tree of v along with u is a block. DFS tree
5
Menger’s Theorem (1927) G is k-connected
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. G is k-connected Any k vertices of G lie on a simple cycle
6
ST-Ordering Numbering - v1, v2, ... , vn of V(G) so that
(v1, vn) E(G) vi has a neighbor vj where j < i vi also has a neighbor vk where i < k (for every i , 1 < i < n) G admits an st-ordering G is 2-connected Note that finding ST ordering isn’t trivial (though there are algorithms). Explain 2-connected single block. If G is 2-connected then any pair vi, vj that are adjacent can be chosen as V1 and Vn. We’ll prove it soon
7
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.
8
G admits an st-ordering 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) G is 2-connected, so there’s such cycle. Base is trivial because the ordering will be determined by a walk from u to v on the cycle (without using (u,v)). v2 v4 v3
9
Continued C ≠ G (v1) u v (v5) G0 = C G
10
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 We might need to adjust our numbering later v4 v3 Shortest path
11
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) G2 G1 v2 v4 v3
12
Pieces G is 2-connected C is a cycle in G Pieces C is Separating P2 P1
The remaining red vertices are called “Attachments”. Separating – gives rise to at least 2 pieces. Finding the pieces is linear in the number of edges P3
13
Pieces Pieces can be drawn on either side of C P2 P1 P3
14
Pieces Pieces can be drawn on either side of C P2 P1 P3
15
Pieces Pieces can be drawn on either side of C P2 P1 P3
16
Pieces Pieces can be drawn on either side of C P2 P1 P3
17
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
18
Pieces G’ might be a planar graph P2 G’ P1 P3
Because p3 can be drawn on the outside. P3
19
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
20
Our Goal Find 2 sets (S1, S2) of pieces so that: P2 G P1 P3
No two pieces in the same set conflict S S2 C = G ∩ ∩ P2 G S1 = {P1, P2} S2 = {P3} P1 P3
21
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
22
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) ∩
23
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
24
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
25
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) edges – from Euler’s Theorem corollary : E <= 3*V – 6. The number of pieces (V in the interlace graph) <= n. That’s also why there’ll be O(n) recursive calls at most (totall). Check for bipartite: Perform BFS (Broad First Search), and add the following check: Grey node (that was already discovered) v that we encounter from a new node u most be even if u is odd, or odd if u is even for the graph to be bipartite. + * O(n ) 2 + O(n ) 2 O(n) Total Cost = O(n ) 3
26
Questions?
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.