← All problemsFree · Python · 55 min

Algorithm design / guarantees under an adversary

The Lab Partners

Pair lab students when a pair may share a bench for part of the term. Find where triangles beat every real pairing, pin down a fractional vertex, cut it off with odd-set constraints, then compute a fractional matching that carries its own proof.

0 / 4 graded parts passSaved in this browser · loading saved work…
Jump to your work ↓

A lab course pairs students to share a bench for the term. Nine students have said whom they can work with: each line in the figure is a possible pair. A matching picks pairs with no student in two of them, and the best one here pairs 8 of the 9 students, 4 pairs.

0 1 2 3 4 5 6 7 8

Now relax the rules. A pair may share a bench for part of the term: give each possible pair e a share xe≥0, so that the shares at each student add up to at most one term. That is the fractional matching linear program: maximize ∑exe subject to ∑e∋vxe≤1 for every student v. For bipartite graphs, where students come from two classes and pairs only cross, this LP always has a whole-number optimum. Triangles break that, and this problem is about how.

The LP's vertices are its corners: points that no segment inside the region passes through. Simplex-style algorithms move from vertex to vertex. A point is a vertex exactly when the constraints it meets with equality, xe=0 or a full student, pin it down as the only solution.

In code, students are numbered 0 to n−1 and a pair is (u, v).

Background: Polytopes and Integrality.

easy · Part A

Shares beat pairs

For the nine students in the figure, what is the largest total share ∑exe the fractional matching LP allows?

Explore in the sandbox

Experiment here, then copy a rule into the editor and test its guarantees.