During Breadth-first search of let count unseen vertices, active vertices, and explored vertices. When start a new unseen root, recorded by ; otherwise . The newly discovered count is conditionally . Subtract its conditional mean to obtain a martingale difference . With , and , iteration givesThe last sum is a martingale. Positive over an interval means that the graph component under exploration does not finish there. Independently adding phantom children couples each component exploration below a binomial branching process with offspring law .
Edmonds–Karp algorithm 2026-10-06
This maximum flow algorithm repeatedly augments along a shortest residual path found by Breadth-first search. Residual distances from the source never decrease. If the same arc becomes saturated again after being restored by a reverse augmentation, the distance to its tail has increased by at least two. Thus each arc is critical only times, yielding augmentations. Each search costs , so the total time is . Termination with no residual source-sink path supplies a max-flow min-cut theorem certificate.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 38 4 b Solution Created 2026-10-03 Updated 2026-10-06
Run Breadth-first search separately in every component of the undirected graph. Give a starting vertex colour zero and each newly discovered neighbour the opposite colour. Reject if an edge joins two vertices with the same assigned colour; otherwise accept after all components have been explored.
If the algorithm accepts, its assignments constitute a graph colouring with two colours. If it rejects, the two search-tree paths and the conflicting edge contain an odd cycle, on which alternating two colours cannot close consistently. Equivalently, a valid graph colouring with two colours fixes the parity of every path from a component's root, so the detected conflict is impossible in a two-colourable graph. The Breadth-first search work is with adjacency lists. ThereforeThis is also the two-colourability criterion for bipartite graphs.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 120 1 d Solution Created 2026-10-03 Updated 2026-10-06
The regular language is nonempty because it represents every element of the group. Find any accepted word using Breadth-first search in its finite-state automaton. If is the empty word, it already represents the identity.
Otherwise begin with and repeatedly apply the linear-time multiplication in an automatic structure to the lettersThese letters belong to by symmetry of the alphabet. All intermediate words lie in , and the final word representsHence an identity representative can be constructed effectively:This is a finite preliminary computation depending only on the fixed automatic structure for a group; it uses no test for whether an arbitrary word represents the identity.
Past exam of the mathematics course of the University of Cambridge 2021 ii Paper 2 17G b Solution Created 2026-09-24 Updated 2026-09-25
Past exam of the mathematics course of the University of Cambridge 2026 iii Paper 122 1 a Solution Created 2026-09-24 Updated 2026-09-25
Explore the connected component of a graph containing a fixed vertex by Breadth-first search. If the exploration discovers at least vertices, then before its th discovery at least of at most tested potential edges must be present. The tests are independent Bernoulli trials with parameter , soThe binomial distribution on the right has mean . For , the exponential Markov bound givesfor an absolute constant . The union bound over the choices of now givesTaking with makes this probability tend to zero. This proves the subcritical component bound for a binomial random graph.