Expand description
Lipton-Tarjan style planar separator (1979).
Given a (planar) graph on n vertices, computes a vertex separator S
together with a partition of the remaining vertices into A and B such
that
- there is no edge between
AandB(removingSdisconnects them), - each side is balanced:
|A| <= 2n/3and|B| <= 2n/3.
§Construction (scope)
This is a compact realisation of the Lipton-Tarjan program, built from the two ingredients the theorem relies on, chosen per input:
-
BFS levelling (the heart of Lipton-Tarjan). Run a breadth-first search from a root. Because every edge of a BFS-layered graph joins vertices in the same or adjacent levels, deleting one entire level
lseparates the strictly-lower levels from the strictly-higher levels. The median level always balances both sides belown/2 <= 2n/3; among all levels that keep both sides within2n/3we pick the smallest one as the separator. On asqrt(n) x sqrt(n)grid the BFS levels are anti-diagonals of sizeO(sqrt(n)), giving the textbookO(sqrt(n))separator. -
Tree centroid specialisation. For a tree (the degenerate planar case) the BFS-level separator can be as large as
n/2, yet a single centroid vertex already splits every branch belown/2. When the input component is a tree we therefore return the centroid (a size-1separator) and balance its branches intoA/Bwith an exact subset-sum partition.
Disconnected inputs are handled component-wise. The balance and
“no A-B edge” guarantees hold for every input; the O(sqrt(n)) size
guarantee is for the planar classes exercised in the tests (grids, trees,
paths), matching the latitude of the assignment.
Structs§
- Planar
Separator - Planar separator solver over an undirected graph.
- Separator
Result - The three parts of a separator decomposition. Together they partition
0..nwith no edge crossing betweenSeparatorResult::part_aandSeparatorResult::part_b.