Skip to content

Commit d35d438

Browse files
committed
Make edge densities ℚ≥0-valued
1 parent 137f970 commit d35d438

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
import Mathlib.Algebra.Order.Ring.Unbundled.Rat
1+
import Mathlib.Algebra.Field.Rat
22
import Mathlib.Combinatorics.SimpleGraph.Subgraph
33

4+
/-!
5+
# TODO
6+
7+
Rename `edgeDensity` to `edgeDensityBtw`
8+
-/
9+
410
open Finset
511
open scoped Classical
612

713
namespace SimpleGraph
814
variable {α : Type*} [Fintype α] (G : SimpleGraph α) [Fintype G.edgeSet]
915

10-
def fullEdgeDensity : ℚ := #G.edgeFinset / Fintype.card α
16+
/-- The edge density of a simple graph is its number of edges divided by its number of vertices.
17+
18+
In other words, it is half of its average degree. -/
19+
def edgeDensity' : ℚ≥0 := #G.edgeFinset / Fintype.card α
1120

12-
noncomputable def maxEdgeSubdensity : ℚ :=
13-
Finset.univ.sup' Finset.univ_nonempty fun G' : G.Subgraph ↦ G'.coe.fullEdgeDensity
21+
/-- The maximum edge density of a subgraph of a graph. -/
22+
noncomputable def maxEdgeSubdensity : ℚ≥0 :=
23+
Finset.univ.sup' Finset.univ_nonempty fun G' : G.Subgraph ↦ G'.coe.edgeDensity'
1424

1525
end SimpleGraph

0 commit comments

Comments
 (0)