Maximum cuts
Lax762056.MaxCut · concepts/Lax762056/MaxCut.lean · lax-762056
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
For a graph on an ordered vertex set, each edge is represented once, by its endpoints . A cut is specified by a subset of vertices; its size is the number of edges with exactly one endpoint in . is the largest such size, with value zero for an edgeless graph.
Concept map
In the paper
- page 3 of this submission's paper
Lean source view on GitHub
| 1 | import Lax762056.GraphEncoding |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Maximum cuts |
| 6 | type: definition |
| 7 | --- |
| 8 | For a graph on an ordered vertex set, each edge is represented once, by |
| 9 | its endpoints . A cut is specified by a subset of vertices; its size |
| 10 | is the number of edges with exactly one endpoint in . |
| 11 | is the largest such size, with value zero for an |
| 12 | edgeless graph. |
| 13 | -/ |
| 14 | |
| 15 | namespace Lax762056.MaxCut |
| 16 | |
| 17 | open Finset |
| 18 | |
| 19 | noncomputable def edges {n : ℕ} (F : SimpleGraph (Fin n)) : |
| 20 | Finset (Fin n × Fin n) := by |
| 21 | classical |
| 22 | exact univ.filter fun e => e.1 < e.2 ∧ F.Adj e.1 e.2 |
| 23 | |
| 24 | noncomputable def cutSize {n : ℕ} (F : SimpleGraph (Fin n)) |
| 25 | (S : Finset (Fin n)) : ℕ := by |
| 26 | classical |
| 27 | exact ((edges F).filter fun e => |
| 28 | (e.1 ∈ S ∧ e.2 ∉ S) ∨ (e.1 ∉ S ∧ e.2 ∈ S)).card |
| 29 | |
| 30 | noncomputable def maxCut {n : ℕ} (F : SimpleGraph (Fin n)) : ℕ := |
| 31 | (univ : Finset (Fin n)).powerset.sup (cutSize F) |
| 32 | |
| 33 | end Lax762056.MaxCut |
| 34 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments