Ordering a cubic multigraph by median edge scores #
Give every edge of a multigraph a real score, and let every vertex have exactly three edges.
Each vertex then has a median score (Multigraph.exists_isMedian, from median3), and
listing the vertices by their medians is a layout. This file bounds the frontiers of that layout
by how the scores fall around a grid of thresholds a, a + δ, ..., a + M δ. A vertex
straddles a threshold t when one of its edges scores below t and another at least t
(Multigraph.EdgeStraddles).
The cut of a prefix (Multigraph.ncard_edgeCut_le_of_isMedian). Let P be a set of
vertices whose medians are at most some m, while the medians outside P are at least m.
- An edge leaving
Pthat scores below a thresholdt ≤ mis charged to its endpoint outsideP. That endpoint straddlest, and it is charged at most once, since at most one of its three edges scores below its median. - An edge leaving
Pthat scores at least a thresholdt' > mis charged to its endpoint insideP, again at most once. That endpoint has an edge scoring at most its median≤ m: if this edge scores belowt, the endpoint straddlest; otherwise the edge scores in the window[t, t').
So if a + i δ ≤ m < a + (i + 1) δ, the cut of P has at most
#(vertices straddling a + i δ) + 3 #(edges scoring in the window [a + i δ, a + (i + 1) δ))
edges. If m lies below the grid, or above it, the cut has at most three times as many edges
as score in the lower tail, or in the upper tail.
The layout (Multigraph.exists_width_le_of_edgeScore). Every prefix of the layout by medians
has the property above, so a single bound on the tails, the straddling vertices and the windows
bounds the width.
Main definitions #
Cslib.Circuits.Frontier.Multigraph.EdgeStraddles: a vertex straddles a threshold.Cslib.Circuits.Frontier.Multigraph.IsMedian: a median of the scores of the edges at a vertex.
Main results #
Cslib.Circuits.Frontier.Multigraph.exists_isMedian: medians exist at vertices with three edges.Cslib.Circuits.Frontier.Multigraph.ncard_edgeCut_le_of_isMedian: the cut of a prefix.Cslib.Circuits.Frontier.Multigraph.exists_width_le_of_edgeScore: the layout by median scores.
The vertex v straddles the threshold t under the edge scores score: an edge at v
scores below t and another scores at least t.
Instances For
m is a median of the scores of the edges at v: at least two edges at v score at most
m, and at least two score at least m.
Instances For
Whether v straddles t depends only on the scores of the edges at v.
Medians exist. At a vertex with three edges, the median of their three scores is a median.
Some edge at v scores at most a median.
Some edge at v scores at least a median.
At a vertex with three edges, at most one edge scores below a median.
At a vertex with three edges, at most one edge scores above a median.
The cut of a prefix #
Charging low edges. If the medians outside P are at least m, the edges leaving P
that score below a threshold t ≤ m are no more than the vertices outside P that straddle
t.
Charging high edges. If the medians inside P are at most m, the edges leaving P
that score at least a threshold t > m are no more than the vertices inside P with an edge
scoring at least t.
The cut of a prefix. Let the vertices of P have medians at most m, and the others
medians at least m. If three times the edges scoring in each tail, and the vertices straddling
each grid threshold plus three times the edges scoring in the following window, are at most
B, then at most B edges leave P.
The layout #
The layout by median scores. Let every vertex have three edges, score the edges, and fix
a grid a, a + δ, ..., a + M δ. If three times the edges scoring in each tail, and the vertices
straddling each grid threshold plus three times the edges scoring in the following window, are
at most B, then listing the vertices by the medians of their scores gives a layout of width at
most B.