Past exam of the mathematics course of the University of Cambridge 2005 ib Paper 3 20D b Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 38 2 a Solution Created 2026-10-03 Updated 2026-10-07
Write the primal in the form with and . Its dual linear program is with and . Indeed, nonnegative combinations of the primal inequalities give , which is weak duality. The specific dual isThe four dual inequalities correspond, in order, to the four primal variables.
Past exam of the mathematics course of the University of Cambridge 2016 ib Paper 2 9H Solution Created 2026-09-24 Updated 2026-10-06
Introduce nonnegative slack variables and start the simplex algorithm at , with slacks . The objective's largest positive entering coefficient belongs to . Its ratio test is , , , so leaves and enters.
Solve that pivot row for and substitute into the other rows and the objective :This is a feasible simplex dictionary at nonbasic variables . All their objective coefficients are negative, so no feasible increase can improve the objective. ThusThe negative reduced coefficients also prove uniqueness of this optimum.
The dual linear program, with nonnegative variables , isThe feasible choice has objective . Weak duality proves that it and the primal point are optimal. Complementary slackness also forces because the first two primal slacks are positive, and then the positive forces .
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 212 3 Solution Created 2026-10-03 Updated 2026-10-06
Use a directed bipartite graph with one vertex for each job and one for each agent. Job vertices have supply and agent vertices demand . An arc from job to agent has cost and nonnegative flow ; an upper bound may be added, but is already implied by the balances. The minimum-cost flow formulation of the assignment problem isInteger supplies and demands give an integral optimum by integrality of the transportation problem. Its positive arcs form a perfect matching, hence give one job per agent.
A network simplex algorithm basis for this connected -vertex network has tree arcs, whereas an integral assignment has only positive flows. For , at least basic tree arcs therefore carry zero flow. This unavoidable degeneracy in linear programming can cause zero-step pivots, extra bookkeeping and cycling unless an appropriate pivot rule is used. The Hungarian algorithm exploits the assignment structure directly rather than maintaining many zero-flow basic arcs.
Suppose the assignment dual potentials satisfy . For every feasible assignment ,If the selected assignment uses only arcs with , its cost equals this lower bound. Weak duality and complementary slackness certify optimality. The PDF correctly denotes the feasible assignment by ; the TeX aid mistakenly replaces it with .
The Hungarian algorithm maintains feasible assignment dual potentials and a matching in a graph of zero reduced cost edges, where . Search for an augmenting path in a matching in this equality graph. If there is none, let be the reachable jobs and the reachable agents in the alternating search from unmatched jobs. Every agent in is matched to a job in . SetReduced costs from to its complement decrease by , those from outside into increase, and the remaining ones do not change. Thus feasibility and current matching equalities are preserved, while at least one new equality edge appears. Continue until an augmenting path in a matching increases the matching size. A perfect matching in the equality graph then has the same value as the dual linear program and is optimal.
For the example, start with the row minima and . The reduced cost matrix isMatch job to agent . Searching from both unmatched jobs gives and ; the minimum cost to an agent outside is . Update to and :The new equality edge augments the matching. From unmatched job , the next alternating search reaches agent and its matched job , giving and . Now . The updated feasible assignment dual potentials and reduced costs areThe augmenting path in a matching uses job to agent , the reversed matched edge to job , then the new edge to agent . It gives the optimal assignmentThe dual linear program value is , an independent optimality certificate.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 339 1 d Solution Created 2026-10-03 Updated 2026-10-05
Substitute the dual linear program from the previous part and optimize jointly over . The result isThe objective is linear, and the constraints are equalities or inequalities between affine functions, so this is a linear program. For each fixed feasible , minimizing over gives exactly by the threshold formula for the sum of the largest components; hence the reformulation preserves the optimal value and optimal whenever an optimum exists.
Past exam of the mathematics course of the University of Cambridge 2021 ib Paper 2 7H Solution Created 2026-09-24 Updated 2026-09-25
Introduce slack variables . In the initial simplex algorithm dictionary, has the largest positive objective coefficient. The ratio test givesso enters and leaves. Solving the third constraint for givesThe objective becomesEvery reduced cost is now nonpositive, so the simplex optimality criterion givesThe other two slacks both equal one.
The dual linear program isThe vectoris dual feasible and has objective value . By weak duality, it and the displayed primal point are optimal; they also satisfy complementary slackness.