Proofs: Lipton-Tarjan separator algorithm
These are the human proofs of Lipton-Tarjan separator algorithm, at full length.
The Lipton-Tarjan algorithm returns a balanced separator of size at most 2 sqrt(2) sqrt(n) full
This proof shows: correctness, termination.
Let be a simple planar graph with vertices and a planar rotation system . We show that LT-SEPARATOR stops and returns a partition of with no edge between and , , and . Every loop of the algorithm runs over a finite set and every search visits each vertex once, so the algorithm stops. We prove the three properties.
Step 1 (it suffices that every component of has at most vertices). Line L13 groups the components. If one component has at least vertices, it alone forms , which has at most vertices, and has at most . Otherwise, components are added to while ; each has fewer than vertices, so at the end, and , if nonempty, is formed only after , so . No edge joins two components, so no edge joins and .
Step 2 (line L1). If the largest component has at most vertices, then satisfies Step 1. Otherwise all later lines work in , with . Every other component has fewer than vertices. So it suffices that every component of has at most vertices and that .
Step 3 (levels). In a breadth-first search every edge joins two vertices whose levels differ by at most 1. So after removing all vertices of a level , no edge joins a vertex below to a vertex above it. By the choice of , the levels below hold fewer than vertices and the levels above hold . If line L3 stops, has at most vertices, and every component of lies on one side of , so it has at most vertices.
Step 4 (lines L4 and L5 find levels). The claim in the proof of the planar separator theorem shows that some satisfies the test of line L4, and that some satisfies the test of line L5, with as the last resort. So both scans stop, and
because is largest at . After removing , each component of lies in the levels below (fewer than vertices, since ), or above (at most , since ), or in . If line L6 stops, , and the bound on follows from (1).
Step 5 (line L7 builds a plane graph with a tree of small radius). Let be the levels . The search tree restricted to is a tree rooted at . Contracting one edge of a plane graph merges and , and the rotation of the merged vertex is with replaced by the neighbours of in the order of , starting after and stopping before ; the result is again a plane graph, possibly with parallel edges and loops. Contracting the edges of one at a time, children into parents, gives exactly the order of the Euler tour of line L7: at each vertex, scan its rotation counterclockwise starting after the parent, and descend into each child where it occurs. Edges inside become loops and are dropped, edges to levels and above are deleted with those vertices, and of each set of parallel edges at one is kept. Deleting edges and vertices keeps a plane graph plane. So is a simple plane graph with rotation .
is connected: each vertex of has a search-tree path down to level , and from there one edge to (or, if , the path down to ). Let be these paths. Every vertex of has depth at most in .
Step 6 (line L8 gives a triangulation). For each face of with walk of darts , the corner of at the tail of is the counterclockwise side of , because is on the left of . Adding inside and an edge from to each corner, in the order of the walk, splits into the triangles . These have three distinct vertices, since has no loops. Inserting the new edge right after in the rotation of its tail, and listing the new edges at in walk order, which is counterclockwise around , describes this drawing. So the result is a plane graph with no loops in which every face is a triangle on three distinct vertices. The proof of the lemma of the planar separator theorem uses only these facts, the cycle and bond duality, the tree-cotree property and the Jordan curve theorem, all of which hold for such graphs with parallel edges.
Step 7 (line L9 gives a spanning tree). consists of and, for each , the edge to the corner of . Each is a leaf of . A tree path between two vertices never passes through a leaf except at its ends. So a fundamental cycle contains at most the two ends of among the new vertices, and its vertices of form a path in . If passes through , it has at most vertices of , two branches of depth at most below . If it does not, its top vertex has depth at least 1 and the bound is . If , is the root and the vertices of have depth at most , which gives at most . In each case, with (1),
Step 8 (line L11 computes the weights). Root at the face . For a non-tree edge , let be the end of farther from and the dart of with on its left. As shown in the proof of the lemma, the faces in the subtree of , , are exactly the faces inside , the side without .
For each vertex , the owner face is the face on the left of the dart from to its parent (for the root, the face of its first dart). A vertex strictly inside has all its faces inside, so ; a vertex strictly outside has . So
Orient as , then up the tree from to , then down to . The face is on the left of the first dart, and the inside is on one side of the whole oriented cycle, so the inside is on the left everywhere. For on the branch from , the cycle uses the dart from to its parent, whose left face is inside. For on the branch from , the cycle uses the dart from the parent to ; its left face is inside, and is the face on the other side of the same edge, so it is outside. The owner of is tested directly by its position in . Hence
where is the weight of the tree path from up to the root, and sums the two branches and once. These are the formulas of line L11.
Step 9 (line L11 finds a balanced cycle). The weights are 1 on and 0 on and the new vertices, with total . By the lemma of the planar separator theorem, applied to , and , a candidate exists, and the candidate with the fewest faces inside has weight at most strictly inside , and weight strictly outside. By the Jordan curve theorem, no edge of , hence no edge of between vertices of , joins the two sides. Line L12 adds the vertices of on to . Every component of inside lies on one side of and has at most vertices, and the components outside were bounded in Step 4.
Conclusion. In every case every component of has at most vertices and . By Step 1, the output is a separator with the stated properties.