← All problemsFree · Python · 60 min

Algorithm design / guarantees under an adversary

The Tutoring Rota

Pair tutors with students at the least total travel time, then prove no rota is shorter with potentials from the dual linear program. Write an assignment solver whose answers are checked by their certificate, not by re-solving.

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

A tutoring service sends each of its four tutors to a different one of its four students. Tutor i needs cij minutes to reach student j, as in the figure. An assignment pairs every tutor with a different student and costs the total travel time. The service wants the cheapest assignment, and it wants to prove to its tutors that no cheaper one exists, without listing all n! assignments.

student 0student 1student 2student 3tutor 05691tutor 18413tutor 22684tutor 37924
Minutes from each tutor (row) to each student (column).

The proof is a set of potentials: a number ui for each tutor and vj for each student, with ui+vj≤cijfor every tutor i and student j. Any assignment pairs each tutor with one student, so it costs at least ∑iui+∑jvj. If an assignment costs exactly that much, it is optimal, and the potentials are its certificate.

Background: LP Duality.

easy · Part A

The shortest rota

What is the shortest total travel time of any assignment for the rota in the figure? Note that sending each tutor to their nearest free student, in order, does not find it.

Explore in the sandbox

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