The Matching Number of a Bipartite Graph in Time O(n · |x|)
Lax117284.BipartiteKuhnTime · concepts/Lax117284/BipartiteKuhnTime.lean · lax-117284
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
There is one word RAM program and one constant such that, at every word length , given a bipartite graph split at as a word with , the program halts within instructions with the matching number of the graph as its single output entry. Since the word has length for vertices and edges, this is Kuhn's bound , hence on graphs without isolated vertices.
Concept map
Lean source view on GitHub
| 1 | import Lax117284.BipartiteGraph |
| 2 | import Lax117284.BipartiteMatching |
| 3 | import Lax808846.RamComputes |
| 4 | |
| 5 | /-! |
| 6 | --- |
| 7 | title: The Matching Number of a Bipartite Graph in Time O(n · |x|) |
| 8 | type: theorem |
| 9 | --- |
| 10 | There is one word RAM program and one constant such that, at every word length , given a |
| 11 | bipartite graph split at as a word with , the program halts within |
| 12 | instructions with the matching number of the graph as its single output |
| 13 | entry. Since the word has length for vertices and edges, this is Kuhn's |
| 14 | bound , hence on graphs without isolated vertices. |
| 15 | |
| 16 | # Formalization Notes |
| 17 | |
| 18 | The program runs one augmenting search per left vertex, in the order of the word. A search |
| 19 | marks each right vertex at most once, scans the adjacency list of each left vertex it reaches at |
| 20 | most once, and clears its marks before the next search; so a search costs a number of |
| 21 | instructions linear in the length of the word, and the searches cost . The |
| 22 | matching itself is left in memory; the output is its size, which is a function of the graph |
| 23 | alone, whereas which maximum matching is found depends on the order of the lists. |
| 24 | |
| 25 | The admissible inputs are the encodings of bipartite graphs split at their last entry that fit |
| 26 | the word length. Every value the program manipulates — a vertex, an offset into the word, a |
| 27 | counter, a step count — is below , so the one fitting condition on the word suffices. |
| 28 | The program is quantified before the word length: it is one algorithm, uniform in . |
| 29 | -/ |
| 30 | |
| 31 | namespace Lax117284.BipartiteKuhnTime |
| 32 | |
| 33 | open Lax808846.Ram Lax808846.RamComputes Lax117284.BipartiteGraph Lax117284.BipartiteMatching |
| 34 | |
| 35 | open scoped Classical in |
| 36 | /-- **The matching number is computed within `c · (n + 1) · (|x| + 1)` instructions** by one |
| 37 | word RAM program at every word length that fits the word. -/ |
| 38 | axiom computes : ∃ (prog : Program) (c : ℕ), ∀ w : ℕ, |
| 39 | ComputesInTime w prog |
| 40 | {x | (∃ (V : ℕ) (G : SimpleGraph (Fin V)) (n : ℕ), EncodesBipartite x V G n) ∧ |
| 41 | c * (x.length + 1) ≤ 2 ^ w} |
| 42 | (fun x => [matchingNumber (wordGraph x)]) |
| 43 | (fun x => c * (leftCount x + 1) * (x.length + 1)) |
| 44 | |
| 45 | end Lax117284.BipartiteKuhnTime |
| 46 |
Formalization Notes
The program runs one augmenting search per left vertex, in the order of the word. A search marks each right vertex at most once, scans the adjacency list of each left vertex it reaches at most once, and clears its marks before the next search; so a search costs a number of instructions linear in the length of the word, and the searches cost . The matching itself is left in memory; the output is its size, which is a function of the graph alone, whereas which maximum matching is found depends on the order of the lists.
The admissible inputs are the encodings of bipartite graphs split at their last entry that fit the word length. Every value the program manipulates — a vertex, an offset into the word, a counter, a step count — is below , so the one fitting condition on the word suffices. The program is quantified before the word length: it is one algorithm, uniform in .
Used by
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments