Documentation

CslibFrontier.Algorithms.Lean.SteinerTree.KMB

Kou–Markowsky–Berman leaf bound and non-terminal leaf pruning for Steiner tree #

This module extends CslibFrontier.Algorithms.Lean.SteinerTree.Metric and CslibFrontier.Algorithms.Lean.SteinerTree.Graph with two results from the heuristic of Kou, Markowsky and Berman [KMB81]:

  1. The 2 (1 - 1/ℓ) leaf bound: for any Steiner tree T connecting the terminals R with ℓ = leafCount T leaves, ℓ · cost(steinerMST δ R) ≤ 2 (ℓ - 1) · cost(T) (leafCount_mul_edgeCost_steinerMST_le and _of_diag), strictly sharpening the 2 (1 - 1/|R|) bound of SteinerTree.Metric whenever some terminals are internal vertices of T (ℓ < |R|). The same leaf bound carries over to kmbEdges in edge-weighted graphs (leafCount_mul_sum_kmbEdges_le).
  2. Non-terminal leaf pruning: pruneNonTerminalLeaves R T iteratively deletes degree-1 non-terminal vertices and their incident edges. It preserves terminal connectivity (connects_pruneNonTerminalLeaves), preserves the tree structure (isTreeEdges_pruneNonTerminalLeaves), never increases edge cost (edgeCost_pruneNonTerminalLeaves_le), and leaves every remaining degree-1 vertex in R (mem_of_degree_pruneNonTerminalLeaves_eq_one), so leafCount ≤ |R.dedup| ≤ |R|.

Model #

Proof of the 2 (1 - 1/ℓ) bound #

Given a nonempty tree T connecting R with ℓ ≥ 2 leaves, double each edge of T and take an Euler circuit W starting at a leaf l₀. Every leaf has degree 2 in the doubled tree, so W visits each leaf exactly once (with l₀ repeated at the end) and splits into ℓ edge-disjoint leaf-to-leaf segments whose costs sum to 2 · cost(T). Deleting the heaviest segment leaves an open walk W' of cost at most 2 (1 - 1/ℓ) · cost(T) that still visits all ℓ leaves of T. Because T is a tree, removing any internal vertex disconnects its neighbors into components each containing a leaf of T, so W' must visit every vertex of T — hence every terminal in R. Shortcutting the open walk W' to R yields a Hamiltonian path on R costing at most W', which upper-bounds steinerMST δ R.

Limitations #

The statements are purely about solution cost and structure, with no machine-level running-time certificate. Primary-source details for [KMB81] come from the abstract and secondary sources; the full text was not inspected directly.

Main definitions #

Main results #

References #

Open-walk shortcutting and block splitting (decidability-free helpers) #

Vertices, leaves, and tree edge lists #

The duplicate-free list of endpoints of edges in T.

The degree-1 vertices (leaves) of the edge list T.

The number of leaves (degree-1 vertices) of the edge list T.

T is a finite tree: either empty, or connected on its endpoints with |E| + 1 = |V|.

theorem Cslib.Algorithms.Lean.SteinerTree.mem_vertices {α : Type u_1} [DecidableEq α] {T : List (α × α)} {v : α} :
v ∈ vertices T ↔ ∃ e ∈ T, v = e.1 ∨ v = e.2
theorem Cslib.Algorithms.Lean.SteinerTree.mem_leaves {α : Type u_1} [DecidableEq α] {T : List (α × α)} {v : α} :

Every nonempty finite tree has at least two leaves.

KMB non-terminal leaf pruning #

def Cslib.Algorithms.Lean.SteinerTree.isPrunableEdge {α : Type u_1} [DecidableEq α] (R : List α) (T : List (α × α)) (e : α × α) :

Whether e is incident to a degree-1 vertex of T outside the terminal list R.

def Cslib.Algorithms.Lean.SteinerTree.pruneLoop {α : Type u_1} [DecidableEq α] :
ℕ → List α → List (α × α) → List (α × α)

Iterative pruning loop with fuel k.

def Cslib.Algorithms.Lean.SteinerTree.pruneNonTerminalLeaves {α : Type u_1} [DecidableEq α] (R : List α) (T : List (α × α)) :
List (α × α)

Kou–Markowsky–Berman non-terminal leaf pruning: iteratively remove edges incident to degree-1 vertices outside R.

theorem Cslib.Algorithms.Lean.SteinerTree.edgeCost_pruneNonTerminalLeaves_le {α : Type u_1} [DecidableEq α] (δ : α → α → ℕ) (R : List α) (T : List (α × α)) :

Non-terminal leaf pruning never increases the edge cost.

Non-terminal leaf pruning preserves terminal connectivity.

Non-terminal leaf pruning preserves the tree structure.

After KMB pruning, every remaining degree-1 vertex is a terminal in R.

After KMB pruning, the number of leaves is at most the number of distinct terminals.

Tree reindexing and the leaf-segment coverage lemma #

The 2 (1 - 1/ℓ) Kou–Markowsky–Berman leaf bound #

theorem Cslib.Algorithms.Lean.SteinerTree.leafCount_mul_edgeCost_steinerMST_le {α : Type u_1} [DecidableEq α] {δ : α → α → ℕ} (hsymm : ∀ (x y : α), δ x y = δ y x) (htri : ∀ (x y z : α), δ x z ≤ δ x y + δ y z) {R : List α} (hR : R.Nodup) {T : List (α × α)} (hT_tree : IsTreeEdges T) (hT_conn : Connects T R) :
leafCount T * edgeCost δ (steinerMST δ R) ≤ 2 * (leafCount T - 1) * edgeCost δ T

The Kou–Markowsky–Berman 2 (1 - 1/ℓ) leaf bound for metric Steiner tree ([KMB81]): for symmetric δ with the triangle inequality, duplicate-free terminals R, and any tree T connecting R, leafCount T · cost(steinerMST δ R) ≤ 2 (leafCount T - 1) · cost(T).

theorem Cslib.Algorithms.Lean.SteinerTree.leafCount_mul_edgeCost_steinerMST_le_of_diag {α : Type u_1} [DecidableEq α] {δ : α → α → ℕ} (hdiag : ∀ (x : α), δ x x = 0) (hsymm : ∀ (x y : α), δ x y = δ y x) (htri : ∀ (x y z : α), δ x z ≤ δ x y + δ y z) {R : List α} {T : List (α × α)} (hT_tree : IsTreeEdges T) (hT_conn : Connects T R) :
leafCount T * edgeCost δ (steinerMST δ R) ≤ 2 * (leafCount T - 1) * edgeCost δ T

The Kou–Markowsky–Berman 2 (1 - 1/ℓ) leaf bound with zero diagonal: when ∀ x, δ x x = 0, the leaf bound holds for arbitrary terminal lists R without assuming R.Nodup.

theorem Cslib.Algorithms.Lean.SteinerTree.exists_pruned_tree_of_connects {α : Type u_1} [DecidableEq α] {δ : α → α → ℕ} {R : List α} {T : List (α × α)} (hT : Connects T R) :
∃ (T' : List (α × α)), IsTreeEdges T' ∧ Connects T' R ∧ edgeCost δ T' ≤ edgeCost δ T ∧ ∀ (v : α), Euler.degree T' v = 1 → v ∈ R

Any connecting edge list T contains a pruned tree T' connecting R with all leaves in R and cost at most edgeCost δ T.

theorem Cslib.Algorithms.Lean.SteinerTree.exists_optimal_pruned_steinerTree {α : Type u_1} [DecidableEq α] {δ : α → α → ℕ} (hdiag : ∀ (x : α), δ x x = 0) (hsymm : ∀ (x y : α), δ x y = δ y x) (htri : ∀ (x y z : α), δ x z ≤ δ x y + δ y z) (R : List α) :
∃ (T : List (α × α)), IsTreeEdges T ∧ Connects T R ∧ edgeCost δ T = steinerOpt δ R ∧ (∀ (v : α), Euler.degree T v = 1 → v ∈ R) ∧ leafCount T ≤ R.dedup.length ∧ leafCount T * edgeCost δ (steinerMST δ R) ≤ 2 * (leafCount T - 1) * steinerOpt δ R

There exists an optimal pruned Steiner tree attaining steinerOpt δ R whose leaves all lie in R and which satisfies the 2 (1 - 1/ℓ) Kou–Markowsky–Berman leaf bound.

theorem Cslib.Algorithms.Lean.SteinerTree.leafCount_mul_sum_kmbEdges_le {V : Type u_2} [DecidableEq V] {G : SimpleGraph V} {w : Sym2 V → ℕ} {P : (u v : V) → G.Walk u v} (hP : IsShortestWalkOracle w G P) (R : List V) {T : List (V × V)} (hT_edges : ∀ e ∈ T, G.Adj e.1 e.2) (hT_tree : IsTreeEdges T) (hT_conn : Connects T R) :
leafCount T * (kmbEdges w P R).sum w ≤ 2 * (leafCount T - 1) * (List.map (fun (e : V × V) => w s(e.1, e.2)) T).sum

The Kou–Markowsky–Berman 2 (1 - 1/ℓ) leaf bound in edge-weighted graphs: for any shortest-walk oracle P and any tree edge list T of G connecting R, leafCount T · cost(kmbEdges w P R) ≤ 2 (leafCount T - 1) · cost_w(T).