Solve the maximum-weight assignment problem forbidding fixed points, obtaining a cycle cover of a directed graph whose weight bounds every Hamiltonian cycle above. Remove a lightest edge from each graph cycle. Each graph cycle has at least two edges, so at least half its nonnegative weight survives. Connect the resulting disjoint graph paths cyclically; completeness supplies the connectors and their nonnegative weights cannot reduce the retained sum. The Hungarian algorithm and linear-time patching give a polynomial time approximation algorithm. Negative weights invalidate a universal multiplicative half guarantee: when every weight is , every tour has weight .
Past exam of the mathematics course of the University of Cambridge 2003 iii Paper 37 3 Solution Created 2026-10-03 Updated 2026-10-14
Write for the partial assignment problem solution sending person to job . The prescribed assignment lower bound from independent task minima isEvery completion must pay at least the minimum in each remaining column, so this is a valid lower bound, even if the minima use the same person several times. At , the one remaining job must go to person 4, and the bound is the exact completed cost.
Use branch and bound with the smallest open bound expanded first. The initial bounds areFor example, . Expand , givingExpand . Its children are with bound 64 and with bound 65. Completing the first gives at cost 64, our first incumbent. The second cannot improve it. We may also discard , , and , since their lower bounds are at least 64; equality may be pruned when seeking one optimum.
The remaining open prefix is , whose children have boundsOnly can improve the incumbent. Its children and have exact completed costs 69 and 61, respectively. The latter completes to and replaces the incumbent. Every other branch has already been bounded above this value. Thus the optimal assignment isThis branch and bound computation produces fourteen partial nodes: four initial nodes, three below , two below , three below and two below . The last person is assigned automatically at a depth-three node.
For the travelling salesman problem, let mean that the tour goes directly from city to city . Retain only the constraintsThis is an assignment problem between cities as departure points and cities as arrival points, solvable by the Hungarian algorithm. Its optimum is a cycle cover of a directed graph, possibly with several disjoint cycles. Since every tour is such a cover, its cost is a lower bound on the best tour cost. This is the assignment relaxation of the travelling salesman problem.
If the minimizing cover is a single Hamiltonian cycle, it supplies a tour and can update the incumbent. Otherwise choose one proper subtour . No tour can contain all edges of , since that would close a cycle before visiting the remaining cities. Make one child subproblem for each edge of , forbidding that edge, and solve its modified assignment problem. These branches may overlap but together retain every possible tour. Prune a child if it is infeasible or its assignment bound is at least the incumbent cost. Further subtours cause further branching. Each branch adds a new forbidden edge, so the search is finite, and the covering property plus the valid lower bounds proves optimality when no open branch remains. This enforces the effect of subtour elimination constraints through branch and bound.
Past exam of the mathematics course of the University of Cambridge 2004 iii Paper 33 5 Solution 2026-10-14
The total processing time is constant for a single machine, so only the initial setup and changeover sum depends on the order. Use the dummy-job reduction for sequence-dependent setup times. Add vertex , and setLet the binary variable indicate that follows in the augmented tour. A Hamiltonian cycle through specifies exactly one schedule, read starting after . An exact integer programming formulation isThe degree equations alone describe a cycle cover of a directed graph, possibly several separate graph cycles. The subtour elimination constraints exclude every proper directed graph cycle; the cover is therefore a single tour through all jobs. Conversely every schedule supplies a feasible tour with exactly its completion time as objective. Exponentially many written inequalities are permitted in this exact formulation; an implementation may add them only when violated.
For three parallel machines, the relevant objective is the parallel-machine makespan with sequence-dependent setups, not simply total setup cost. Partition jobs into three ordered lists . For a nonempty list definean empty machine has . Minimize subject to for each machine and each job assigned once. This can be written as a mixed-integer extension with assignment variables, one dummy tour per machine and conditional subtour cuts.
A practical strategy starts with a balanced assignment, sequences each machine using the single-machine methods, and improves by relocating or swapping jobs between machines together with within-machine 2-opt moves. Score each move by its change in . Branch and bound can combine machine-assignment decisions with within-machine assignment bounds. For nonnegative times, the total processing time divided by three and the largest individual processing time are valid lower bounds, supplemented by setup-dependent route bounds. Balancing processing and changeovers jointly is essential; independently minimizing the three tour costs does not by itself minimize completion time.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 38 5 Solution Created 2026-10-03 Updated 2026-10-14
Use a complete directed graph on cities, with integral arc costs and a threshold . A symmetric cost matrix also represents the undirected travelling salesman problem by orienting a tour. Let the binary variable indicate that city follows city , and forbid self-arcs. The decision integer programming formulation asks whether the following system has a solution:The in-degree and out-degree equations make the selected arcs a cycle cover of a directed graph. Any proper graph cycle on a city set would violate its subset inequality, so the selected arcs form one Hamiltonian cycle. Conversely, a Hamiltonian cycle obeys every inequality: a proper subset cannot contain all the successor arcs of its graph vertices. Thus the binary feasibility system is equivalent to the decision travelling salesman problem. The subset formulation has exponentially many inequalities, which is harmless for this formulation; verifying a proposed tour does not require listing them.
To call this decision problem NP-complete means two separate things. It belongs to NP: a yes-instance has a polynomial-length certificate in computational complexity, namely the cyclic ordering of the cities, and a deterministic algorithm checks distinct visits, the return to the start, and the total cost in polynomial time in the binary input length. It is also NP-hard: every decision problem in NP has a polynomial-time many-one reduction to it, preserving yes and no answers. This is a statement about worst-case computation on finite encodings, not a proof that every individual tour is hard to find or that no polynomial algorithm exists; that last conclusion would require .
For the strict-threshold decision Max-TSP, choose an integer and replace each arc cost by . Every tour uses exactly arcs, soSet the new threshold to . Its encoding length, the transformed matrix's encoding length and the computation time are all polynomial in the original input length. If thresholds are required to be nonnegative, take ; the same identity works. Symmetry of costs is preserved. This is a polynomial-time many-one reduction from decision travelling salesman problem to decision Max-TSP, so the latter is NP-hard. A tour is again a polynomially verifiable certificate in computational complexity, now checking strict excess over , soFor the approximation algorithm, use the standard nonnegative-length setting on a complete graph; no triangle inequality is required. Solve the maximum-weight assignment problem with diagonal assignments forbidden, for example by applying the Hungarian algorithm to the negative weights. The resulting cycle cover of a directed graph has weight with , since every tour is an allowed assignment.
If it already has a single graph cycle, it is an optimal tour. Otherwise remove a least-weight arc from each graph cycle. A graph cycle of arcs and weight loses at most . The remaining arcs form vertex-disjoint graph paths covering all cities. Join the endpoint of each graph path to the start of the next, cyclically. The required arcs exist by completeness, and their nonnegative weights cannot diminish the retained weight. The resulting single Hamiltonian cycle therefore satisfiesThe Hungarian algorithm takes arithmetic operations, and finding the graph cycles, cutting them and patching the graph paths takes further operations. For rational or integer weights these operations have polynomial encoding length, giving polynomial time. With symmetric costs, the same directed construction is a valid undirected tour after forgetting its orientation. This is the cycle-cover patching half-approximation for Max-TSP.
Nonnegativity is essential to this multiplicative guarantee. If arbitrary signed weights were allowed, giving every arc cost would make every tour have weight , while half the optimum is . No tour could achieve the requested bound. Thus “length” has its usual nonnegative meaning in the approximation assertion.
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 124 4 i Solution 2026-09-28
Interpret the permanent of a matrix as the total weight of the cycle covers of its weighted directed graph. Valiant's reduction builds a graph from three constant-size components.
- A Variable gadget in Valiant's permanent reduction has exactly two relevant cycle-cover states, representing true and false, and exposes occurrence ports consistent with the selected state.
- A Clause gadget in Valiant's permanent reduction has external ports for its three literals and contributes a fixed total weight exactly when at least one selected literal satisfies the clause.
- An Exclusive-or gadget in Valiant's permanent reduction joins occurrence ports while allowing exactly one of two corresponding external edges. Its edges have weights in ; unwanted cycle covers occur in sign-reversing pairs and cancel.
Wire one variable port to every literal occurrence and one clause port to each literal. The balanced-occurrence hypothesis lets the true and false tracks of each variable be paired without extra weighting. A routine gadget case analysis shows that cycle covers surviving cancellation correspond to satisfying assignments, each with the same fixed multiplicity and sign. A small normalization gadget removes that fixed factor, or it can be tracked explicitly. The construction has constant size per variable, clause, and occurrence, so it is a polynomial-time counting reduction from Balanced number 3-SAT to the permanent of a matrix.
Spanning circuit family 2026-10-14
A spanning circuit family is a collection of directed cycles whose union contains every vertex of the directed graph. Different circuits may overlap. This is distinct from a cycle cover of a directed graph, which requires vertex-disjoint cycles.
Subtour elimination constraints 2026-10-14
Binary arc variables with one outgoing and one incoming arc at each vertex describe a cycle cover of a directed graph. For every nonempty proper vertex subset , the displayed inequality forbids a directed cycle confined to . Together these inequalities make the cycle cover one Hamiltonian cycle. They can be generated as violated cuts or used in branch and bound, rather than all being stored initially.
Valiant's permanent reduction 2026-09-28
Valiant's permanent reduction encodes satisfying assignments as cycle covers so that their weighted sum is the permanent of a matrix. Local gadgets enforce variable consistency and clause satisfaction, while signed contributions cancel invalid covers.
Vertex cycle cover 2026-10-14
A vertex cycle cover is a collection of cycles whose union contains every vertex of a graph; its cycles can overlap. A cycle cover of a directed graph additionally requires directed, vertex-disjoint cycles, and a spanning circuit family can allow overlaps.