To establish strong NP-completeness, use an explicit adjacency matrix encoding for a finite simple graph, with enough length information to recover its number of vertices. Let be the canonical binary numeral system representation of the nonnegative integer . Defineand, using the unary numeral system for ,The surrounding pairing syntax delimits the two components, so the empty unary field can encode if zero is included in the convention for natural numbers. Malformed descriptions are excluded from both formal languages.
Fix a unary no-instance , for example one isolated vertex with requested size . The polynomial-time many-one reduction isMap malformed inputs to too. When , only the numerical representation changes, so the existence of a -clique is unchanged. When , the original instance is false, since a subset of vertices cannot be larger than the whole vertex set; is false as required.
The important size bound is in the branch that writes . The original explicit graph description already has length at least , so the output has polynomial length and can be written in polynomial time. If a huge binary numeral system value is supplied, compare it with using its digit length and, when needed, a digit comparison; do not first allocate or print symbols. Merely replacing an unrestricted binary by would not be a valid polynomial-time reduction.
Thus . The unary version is in NP by the same clique complexity certificate verification, and is NP-hard by this polynomial-time many-one reduction and part (e). ThereforeThis conclusion uses the conventional explicit graph encoding; a succinct circuit description of a graph would be a different input representation and a different problem.
Consider any edge of the simple graph. One endpoint comes first in the permutation ; suppose it is . Then has a graph neighbour preceding it, namely , so . Therefore no edge has both endpoints in :This argument uses only the order of the endpoints, with no random choice required.
Past exam of the computer science course of the University of Oxford 2018 Algorithms 3 b Solution 2026-10-31
Let be the set of isolated vertices of the finite simple graph . Introduce a nonnegative integer for every vertex. Use the integer programEvery nonisolated vertex belongs to an edge, whose inequality and the other endpoint's nonnegativity already imply . The explicit bounds on therefore make all variables binary. For an integer feasible point, is an independent set, and its cardinality is the objective. Conversely the indicator vector of any independent set is feasible. Thus the optimal value is the maximum independent set size. Including the isolated-vertex bounds is essential for an arbitrary graph; without them the formulation would be unbounded whenever an isolated vertex is present.
Past exam of the computer science course of the University of Oxford 2019 Algorithms 3 b Solution 2026-10-25
The vertex cover decision problem takes a finite simple graph and a nonnegative integer , and asks whether there is a vertex cover of cardinality at most . The optimization problem asks for a minimum vertex cover, with cost equal to its cardinality.
For the decision problem, if there are no edges, accept; if there is an edge but , reject. Otherwise choose an edge and branch: either include and recurse on with budget , or include and recurse on with budget . Accept if either branch accepts. Every vertex cover contains at least one endpoint of , so every possible solution is retained by at least one branch. Conversely, adding the selected endpoint to a vertex cover returned by the smaller instance covers all original edges. This proves correctness by induction on the remaining budget.
The search tree has depth at most and at most leaves. Processing each node in time gives running time, establishing fixed-parameter tractability.
For optimization, greedily build a maximal matching : repeatedly select an edge and discard every edge touching either endpoint. Return the set of all endpoints of . Any edge with neither endpoint in could be added to , contradicting maximality; thus is a vertex cover. Since the edges of a matching in a graph have pairwise disjoint endpoint sets, every vertex cover must contain at least one different vertex for each of them. ThereforeThe greedy construction takes polynomial time, and can be implemented in with adjacency lists. It needs only a maximal matching, not a maximum matching.
Past exam of the computer science course of the University of Oxford 2023 Combinatorial optimisation 2026-10-25
Worked solutions to all three questions of the Oxford examination held on 25 May 2023. Source release: released examination archive, member
2022/T/a18330w1.pdf; the cover identifies the examination as Trinity Term 2023. Numbering follows the source PDF, pages 2–4. The examination asks candidates to choose two questions; all three are solved here.We use finite simple graphs throughout the graph arguments. In Question 1(c), must be nonempty for the stated minimum to exist. In Question 3(d), an edge cover exists only when there is no isolated vertex; for a nonempty connected graph this excludes the one-vertex graph. These minor domain qualifications are made explicit in the affected solutions.
Choose a perfect matching from (i). Every vertex has exactly two incident edges in , so this spanning subgraph is a disjoint union of graph cycles. Orient each graph cycle cyclically, and let be the next vertex after along its oriented graph cycle.
For each , take the three-edge sequenceIts four vertices are distinct. Each and because the graph is a simple graph. Also and , since belongs to , rather than . Finally because the successor map is a bijection on the disjoint graph cycles. Thus this is a graph path of length exactly three.
Every edge of is used once as a middle edge. Every edge of is used once as the outgoing edge of its tail, whose unique edge of determines which graph path contains it. Hence these graph paths are pairwise edge-disjoint and cover . This is the three-edge path decomposition from a perfect matching.
On a triangular prism, orient the two remaining graph cycles and extend each perfect matching edge by its endpoints' outgoing edges; the three colors partition all nine edges into length-three graph paths
. Details. The simplicial intersection conditions prohibit loops and multiple edges between the same pair of vertices, so the one-skeleton is a simple graph andUsing the preceding identity gives . A closed surface has and a simplicial triangulation has . The smaller root is at most three, so this inequality forces to lie above the larger root:For completeness, fewer than four vertices could give at most one triangle under the intersection rules, which cannot form a closed surface.
Solutions to all three questions of the graph theory course of the University of Oxford Part B examination, sat on 15 June 2023. Source: original released PDF, bundle pages 243–244; paper pages 1–2. Throughout, graphs are finite simple graphs unless a construction explicitly permits parallel edges.
A proper edge colouring assigns colours to the edges of a graph so that distinct edges sharing a vertex have different colours. The edge chromatic number is the least number of colours in such an assignment. Equivalently, it is the least number of matchings in a graph whose disjoint union is the entire collection of edges.
Vizing's theorem states that a finite simple graph of maximum degree satisfiesThe lower bound holds because all edges incident with a vertex of vertex degree require different colours.
Hall's marriage theorem states that a finite bipartite graph with vertex sets has a matching in a graph saturating if and only ifwhere is the graph neighbourhood of . Here matching saturation means that each vertex of is incident with an edge of the matching in a graph; it does not require every vertex of to be met.
For even , take the complete graph . It is an -regular graph on an odd number of vertices. Every matching in a graph has at most edges, so colours in a proper edge colouring could cover at most edges. ButTherefore ; Vizing's theorem gives . This includes the graph triangle when .
For odd , first construct a graph on vertices. Start with the complete graph onand delete the edges , , and . The pairing is possible because is even. In the initial complete graph, every vertex has vertex degree . The distinguished vertex loses two edges and every other vertex loses exactly one, givingTake two disjoint copies of , with distinguished vertices , and add the edge . The resulting simple graph is an -regular graph. The added edge is the only edge between the two copies; each copy has the odd number of vertices.
Suppose an -colour proper edge colouring existed. At each vertex, the incident edges would use all colours. Thus each colour would form a perfect matching. Any perfect matching must use : without it, each odd-sized copy would have to be covered by internal pairs, which is impossible by parity. Therefore all colour classes would have to contain the same edge , a contradiction. Hence Vizing's theorem again givesThese constructions give class two regular graphs for every . The odd- construction exhibits the bridge obstruction to regular edge colouring; is a connected graph because every vertex other than is adjacent to , while are adjacent to those vertices.
Let the nonempty connected components of a graph of be . A proper vertex colouring can be chosen separately on each connected component of a graph, since no edge joins different connected components of a graph. The multiplication principle gives, first at positive integers and then as a polynomial identity,It remains to justify that every factor has zero constant term. More generally, for every nonempty simple graph , prove by mathematical induction on the number of edges. If there are no edges, then with . Otherwise choose an edge . Both and the simplified edge contraction are nonempty graphs with fewer edges. The deletion-contraction recurrence for the chromatic polynomial and mathematical induction giveThus for a polynomial , andFor the empty graph, and , so the conclusion also holds. This is the chromatic polynomial product over components.
For the Erdős-Rényi model , choose the number of vertices and an edge probability . Visit every unordered pair of distinct vertices once and include its edge independently with probability . This construction gives a simple graph with expected edge count and mean vertex degree .
Increasing at fixed makes the graph denser, increases typical vertex degree and local clustering coefficient, and tends to shorten graph distances and improve connectivity. Increasing at fixed also increases the mean vertex degree; to retain a sparse comparison one instead decreases approximately as .
Its degree distribution is binomial distribution, approximately Poisson distribution in the sparse large- regime, so it is not a scale-free network. Connected realizations can have short average shortest path length, but their clustering coefficients are not elevated above the random baseline they themselves define. Thus they are not small-world networks under the high-clustering convention, although “small world” is sometimes used more loosely to mean only short distances.
The supplied adjacency matrix describes a four-vertex cycle graph, with every vertex degree equal to two. Degree-preserving edge rewiring is random, so it does not determine one unique labelled output adjacency matrix. For example, replace edges and by and , retaining and . This valid switch gives, in order ,Each row still sums to two. Under the simple graph convention, all allowed outputs have the same unlabelled four-cycle topology: there are three possible labelled four-cycles. A rejected switch or later return can also leave the original adjacency matrix.
It is not a scale-free network. Its degree distribution is concentrated entirely at degree two, with no power-law tail; degree-preserving edge rewiring cannot change that.
Use degree-preserving edge rewiring, often called a double-edge swap. Select two edges and with four distinct endpoints, then replace them by and , choosing the reconnection symmetrically. Reject a proposal that would create a self-loop or an already present edge if the target is a simple graph. Each endpoint loses one edge and gains one, so every degree of a vertex, as well as the numbers of vertices and edges, is preserved exactly.
Repeat many such random proposals to generate reference networks. With symmetric proposals, retaining rejected steps as self-transitions, the uniform distribution on the reachable degree-preserving realizations is stationary. Adequate mixing must be checked; a few successful swaps do not establish an independent random sample. Degree preservation alone does not preserve connectedness, so impose and check that extra restriction if the graph distance comparison requires connected networks.
Past exam of the mathematics course of the University of Cambridge 2003 iii Paper 12 3 i Solution Created 2026-10-03 Updated 2026-10-14
Put and . Use the configuration model: give vertex exactly labelled half-edges and choose a uniform perfect matching of all half-edges. There arepairings, with denoting a falling factorial. Each allowed simple graph has exactly representations: at every vertex, assign its incident graph edges bijectively to its labelled half-edges. Therefore its enumeration reduces to the probability that a pairing is simple and avoids .
Count three kinds of prescribed bad patterns. A loop pattern consists of a pair of half-edges at one vertex. A double-edge pattern consists of two half-edges at each of two distinct vertices and one of their two cross-pairings. A forbidden-edge pattern consists of one half-edge at each endpoint of an edge of . Let their respective counts in the random pairing be . Simplicity and avoidance are equivalent to , including exclusion of triple edges because those contain double-edge patterns.
A prescribed collection of disjoint half-edge pairs occurs with probabilityConsequently the bad-pattern expected values areHere and , as in the PDF. Since and has bounded maximum degree, and all three means are uniformly bounded. For the double-edge estimate, , so its contribution after division by is .
We now give the moment-counting step rather than assume independence. For each fixed , expand the factorial moment as the sum over ordered distinct bad patterns. Collections on disjoint vertex sets have, by the displayed pairing probability, joint probabilities equal to the product probabilities times . Their total contribution isDeleting collections with a shared vertex changes the independent-product sum by , since all ordinary and forbidden vertex degrees are bounded.
For actual joint probabilities of overlapping patterns, incompatible uses of a half-edge give zero. Compatible collections with no shared paired edge lose at least one free vertex choice, without reducing the number of required pairs, so contribute . A shared paired edge can occur only between two double-edge patterns or between a double-edge pattern and a forbidden-edge pattern. In the first case their union requires at least three parallel paired edges: there are endpoint choices and probability . In the second case the endpoint pair must be an edge of : there are only choices and at least two required pairs, giving . Adding further patterns in a fixed collection does not remove this deficit: a disjoint addition contributes bounded order, while an addition to an existing cluster has only bounded half-edge choices unless it supplies new free vertices, compensated by its new required pairs. Summing the finitely many overlap types for fixed therefore gives . Thus, with ,The Bonferroni inequalities bracket by the odd and even partial sums of . The means are bounded, so the corresponding exponential-series remainders vanish uniformly as the truncation increases. Taking and then the truncation to infinity proves the bounded-degree pairing avoidance estimate . This does not require or to converge. The exponential is bounded away from zero, so the additive error is also a relative error.
Past exam of the mathematics course of the University of Cambridge 2003 iii Paper 12 4 ii Solution Created 2026-10-03 Updated 2026-10-14
The lower bound cannot hold at as printed: a simple graph on three vertices has at most three edges, so . We prove the intended bound for every , and hence its stated asymptotic order.
Delete leaves from a connected graph of graph excess one to obtain its nonempty 2-core. Deleting a leaf and its incident edge preserves edges minus vertices. The deleted part is a forest rooted at the core vertices: it cannot contain a cycle, which would survive deletion, and it cannot join two core vertices, since the joining path would itself survive. The 2-core remains connected. Suppress its maximal paths with degree-two internal vertices, allowing coincident endpoints for a cycle based at a branching vertex. The resulting graph kernel is a connected multigraph of minimum degree at least three, retaining loops and parallel edges, with the same excess one.
In that kernel,Thus it has either one degree-four vertex or two degree-three vertices. In the first case its two edges are loops. In the second, let be the number of edges between the two vertices and the loop counts. Connectivity gives , and , leaving or . This proves the bicyclic kernel classification: the two-loop bouquet graph, the three-edge Theta graph, and the two-loop dumbbell graph. Original simple cores are graph subdivisions of these kernels; loops must subdivide to cycles of length at least three, and at most one of the three theta paths can be an unsubdivided edge.
The two-loop bouquet, theta and dumbbell kernels of connected bicyclic graphs
. Details. Let count labelled bicyclic cores on a fixed -vertex set. The classification gives an absolute constant withTo see the bound concretely, order the one or two branching labels, choose one of the three kernel types, and distribute the other labels as ordered internal vertices of its two or three edges. There are at most weak compositions of their lengths, and at most ordered assignments of all labels. This overcounts orientations and edge permutations and ignores simplicity restrictions, both harmless for an upper bound.
For a lower bound, use only theta cores whose three paths each have at least one internal vertex. For , choose an ordered pair of branching vertices and an ordered list of the other labels, then cut that list into three nonempty ordered paths. There are encodings. Every resulting simple theta core is encoded exactly times, by swapping the branching vertices and permuting the three paths. Hence
Choose the core's vertices and attach the forest counted in part (i). The decomposition is unique, soPutting , the two estimates on reduce the labelled bicyclic graph count to the sum of divided by .
For the upper bound, givesThe corresponding sum is . For example, divide the positive integers into blocks : the sum in block is at most a constant times , and the series over converges. Including the finitely small indices makes no difference. Therefore .
For the lower bound, take sufficiently large and . Then , and throughout the product. Since on ,There are at least such integer indices, each with . The lower core bound therefore givesThis proves the two-sided bounds for all sufficiently large . They extend to every by adjusting the constants over the remaining finite set: there, since minus one edge is connected with five edges, and adding a pendant path supplies an example at every larger order. Consequently the correctly qualified conclusion isThe exceptional is a genuine defect in the printed quantifier, not a missing case of the proof.
Past exam of the mathematics course of the University of Cambridge 2003 iii Paper 12 4 i Solution Created 2026-10-03 Updated 2026-10-14
We first establish the labelled forest count with prescribed roots. For a prescribed root set of size , orient each tree toward its unique root. Repeatedly delete the smallest remaining nonroot leaf, recording its parent. There are deletions, and the final recorded parent belongs to . Conversely, start with any code of length whose last entry lies in . At each step select the smallest remaining nonroot absent from the remaining code, connect it to the code's first entry, and delete that vertex and entry. Such a vertex exists: among remaining nonroots, the remaining code has entries but at least its last entry is a root, so at most nonroots occur in it. Previously deleted vertices never recur in the code, so the selected parent is still present. Every edge goes from a vertex being deleted to one retained, excluding a cycle. The resulting forest has one root in each graph component, and the two constructions are inverse. Its count is thereforefor , interpret this as one, the empty forest.
A connected simple graph with edges has exactly one cycle: a spanning tree uses edges, and the remaining edge creates its unique cycle. If that graph cycle has length , choose its vertex set in ways and its unoriented cyclic order in ways. All other edges form a forest rooted at those vertices, with exactly one cycle vertex per forest component; two roots in one attached component would create an additional cycle. Conversely every such cycle and rooted forest gives a unique unicyclic component. ThusThis is the labelled unicyclic graph count. The term correctly counts a cycle with no attached nonroot vertices.
Past exam of the mathematics course of the University of Cambridge 2004 iii Paper 13 3 Solution Created 2026-10-03 Updated 2026-10-14
Let be the maximum number of positive Euclidean distances from one of the points to the others. It suffices to prove the stronger Székely distinct-distance bound, . Here ; enlarge constants to handle bounded .
First prove the crossing lemma for multigraphs. In an optimal drawing of a loopless multigraph with vertices, edges and maximum parallel multiplicity , crossings of incident edges can be removed by interchanging initial segments, so each remaining crossing involves four distinct vertices. In each parallel class choose one of its edges with probability per edge, selecting none with the remaining probability. Independently keep each vertex with probability . The resulting simple graph has expected edge count , expected vertex count , and expected crossings , where is the original crossing count. Deleting one edge per crossing and using the allowed planar graph edge bound yieldsIf , take to obtainThe case is the ordinary crossing lemma.
We also need the rich line bound. Given lines, connect consecutive incidence points on each line by straight edges. This simple graph has at least edges, where is the total number of incidences, and at most crossings. The crossing lemma gives , proving the Szemerédi–Trotter theorem here rather than assuming it. For lines containing at least points, , and absorbing the additive term givesFor bounded , counting point pairs gives the same estimate with a larger absolute constant. Grouping rich lines into occupancy ranges and summing the resulting geometric series proves
Now form the circular-arc graph for distinct distances. Around every point draw each positive-distance circle centred there; there are at most such circles. A circle with at least three of the original points contributes one edge between each consecutive pair around it. Discard the circles with at most two points. Since the total number of centre-to-point incidences is , the remaining loopless multigraph hasIts circular-arc drawing has crossings: two distinct circles have at most two intersections, and small perturbations remove tangencies and multiple crossings without changing this order.
The apparent difficulty is unbounded parallel multiplicity. The rich-bisector deletion bound controls it. Every centre supporting an arc between fixed endpoints lies on their perpendicular bisector. Distinct parallel arcs come from distinct centres, since their common endpoints determine the radius once the centre is fixed. Thus multiplicity at least makes that line contain at least of the points. For a line with centres, each of its at most circles has at most two consecutive-point arcs symmetric about that line, one at each end of its diameter along the line. The occupancy sum above therefore bounds the number of high-multiplicity arcs by
If there is nothing to prove. Otherwise and . Choose with a sufficiently large absolute constant . The first deletion term is at most a small fixed fraction of and the second is . A remaining multigraph therefore has edges and multiplicity at most . For large , , so the crossing lemma for multigraphs givesRearranging,The whole distinct-distance set contains those distances from the selected point, proving the requested bound. The circular-arc method and the stronger one-point conclusion are due to Székely.
Solutions to all eight questions of the Oxford Preliminary Examination held on 15 June 2023. Source release: released examination archive, member
2022/T/a10101w1.pdf. The cover identifies Trinity Term 2023. The three section headings and all question labels below follow this historical paper; its grouping is independent of subsequent course changes. Although candidates were asked to attempt at most five questions, every marked subpart is solved here.In 8(b), the source's parenthetical definition describes a dominating set, while its name suggests a vertex cover. Both readings are treated explicitly. In 8(c)–(d), we make the scopes of the printed quantifiers explicit; in particular, the opening universal quantifiers in 8(c) govern both irreflexivity and transitivity. As usual in first-order logic, domains are nonempty, and graphs are finite simple graphs unless an infinite domain is specified.
The nonempty simple graphs having an independent vertex cover of size at most two. The witnesses select the cover. The clause makes the selected vertices nonadjacent; the universal clause forbids every edge whose two endpoints both lie outside the selected set.
The witnesses need not be distinct, so a one-vertex cover is permitted by choosing . A nonempty edgeless graph also satisfies the formula. The empty graph does not, because the existential quantifiers have no witnesses. Here independent vertex cover has its standard vertex cover meaning; 8(b)'s differing parenthetical definition is addressed separately below.

