Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 38 5 c Solution Created 2026-10-03 Updated 2026-10-06
For an explicit algorithm, keep an unnormalized residual , initially , whose row and column sums all equal a common mass , initially one. While , find a perfect matching in its positive support, form its permutation matrix , and subtract , where is the smallest selected entry. Record and replace by .
If the residual mass is positive, the same proof of the Hall marriage theorem condition applies after division by . Every subtraction removes at least one positive entry and creates no new positive entries. Before the last subtraction, any positive-mass residual has at least positive entries; the last step removes all its entries. If is the initial number of positive entries, thenSince the residual ultimately vanishes, summing the recorded subtractions gives , and the row sums give .
A perfect matching can be found by at most searches for an augmenting path in a matching, each costing in a graph with at most edges. Thus each iteration costs , including forming the support and updating the residual, and there are iterations. HenceThis bound uses exact real arithmetic. For rational input, a common denominator lets all residual subtractions be performed on integers of polynomial bit length, giving a polynomial bit-time implementation as well.
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 2017 ii Paper 2 15H Solution Created 2026-09-24 Updated 2026-10-05
For a finite bipartite graph with left vertex set , Hall marriage theorem says that a matching in a graph covering exists exactly when for every . Necessity follows because distinct matched neighbors of lie in .
For sufficiency, induct on , the empty case being immediate. If a nonempty proper subset has , apply the induction hypothesis to the graph on . For the remaining graph, every satisfiesso induction matches the remaining vertices too. If there is no such tight subset and , every nonempty proper subset has at least one extra neighbor. Select an edge and remove its endpoints. Each subset of the remaining left vertices loses at most one neighbor, so it still satisfies the required condition; induction supplies the rest of the matching in a graph. The case follows directly from the condition.
For a doubly stochastic matrix , make a bipartite graph joining row to column when . For a row subset ,Hall marriage theorem therefore gives a perfect matching, or a permutation , with .
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 4 17G Solution Created 2026-09-24 Updated 2026-09-29
Vizing theorem states that every finite simple graph of maximum degree haswhere is its edge chromatic number. The lower bound follows because all edges incident with a vertex of degree need different colours.
For the upper bound, induct on the number of edges. Delete an edge and colour the remaining graph with the palette . We use the Vizing fan lemma: in a partial proper edge colouring with one uncoloured edge , if the palette has one more colour than the maximum degree, a sequence of fan rotations and two-colour Kempe-chain interchanges makes some colour missing at both ends of the uncoloured edge.
Here is the fan argument. Build a maximal sequence of distinct neighbours of such that, for , the colour on is missing at an earlier fan vertex. Rotating an initial fan segment means moving each colour on to the preceding edge where it is missing; this preserves properness and moves the uncoloured edge to the end of that segment. Choose a colour missing at and a colour missing at . On the maximal - alternating path from , interchange and . If the path does not reach , is then missing at both and , so rotate the fan and colour its final uncoloured edge . If it reaches , its last edge at has colour . Maximality of the fan forces the other endpoint of that edge to be a fan vertex; rotate up to that vertex first. This breaks the alternating path before , reducing to the preceding case. This proves the fan lemma and extends the colouring to , completing the induction.
For , label both vertex classes by and colour edge by . Each colour is a perfect matching, so this is an -edge-colouring. Since , . If , embed into and restrict its -edge-colouring. The degree lower bound then gives
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 4 17H c Solution Created 2026-09-24 Updated 2026-09-25
Construct a bipartite graph with left vertices , right vertices , and an edge exactly when . For , every point of lies in some adjacent to one of those . ThusUsing finite additivity of Lebesgue measure and the equal-volume hypotheses,Hence for every . The Hall marriage theorem supplies a perfect matching, which has the form for a permutation of . Every matched edge means precisely that .
Past exam of the mathematics course of the University of Cambridge 2026 iii Paper 215 3 c Solution Created 2026-09-24 Updated 2026-09-25
Under the standard intended reading that the added edges form a perfect matching between and , the claim follows as follows. Degrees in remain bounded in terms of . For , write and . The matching contributes at least boundary edges, while expansion inside contributes a constant multiple of . A case split according as or showsThus has a uniform Cheeger constant. Cheeger inequality gives a uniformly bounded relaxation time, while . The usual spectral mixing estimate, or part (b), then gives .
If “adding edges” permits all vertices to attach to the same vertex of , the assertion is false as written. Take to be a path and attach every vertex of the expander to one endpoint. A walk started at the other endpoint needs order time to reach the attachment endpoint, so its mixing time is not . The perfect-matching interpretation is therefore necessary.