Most hard problems are a known problem in disguise. Modeling is the skill of stripping the story and seeing the structure: what are the objects, what are the choices, what is being optimized, and which known problem has exactly that shape.

The questions that reveal the model

AskIf yes, think of
Are there objects and pairwise relations?a graph: vertices = objects, edges = relations
Is each choice “pick one of two” with pairwise constraints?2-SAT
Are we pairing items from two sides?bipartite matching / assignment
Are we choosing a subset with “if A then B” and profits/costs?project selection = minimum cut
Is something “sent” from sources to sinks with capacities?max flow, min-cost flow
Is it a sequence of decisions with a small state?DP; or shortest path on the state graph
Is the answer monotone in a parameter?binary search on the answer
Do we need a longest chain under a partial order?LIS / Dilworth
Is the cost convex in a count?Aliens trick, slope trick, min-cost flow
Are the operations reversible and composable?group / permutation cycles, matrix power

Reduction catalog

Looks likeIs actuallyNote
assign workers to jobs, one each, minimum costassignment problem (Hungarian / min-cost flow)Assignment
place non-attacking rooks / cover rows and columnsbipartite matching, KönigBipartite Matching
choose a subset with dependencies to maximize profitmaximum closure = min cutFlow Modeling
separate two groups with minimum cost of cut pairsminimum - cutMin Cut
minimum number of chains to cover a poset maximum matching (Dilworth)Bipartite Matching
longest chain of nested envelopes / boxesLIS after sortingSequence DP
minimum moves in a puzzle / grid with keys / statesBFS on the implicit state graphBFS and DFS
cheapest way with “free” or 0-cost moves0-1 BFS / Dijkstra on statesShortest Paths
system of shortest paths (difference constraints)Shortest Path Techniques
each variable true/false, clauses of two literals2-SAT via SCC2-SAT
connect everything at minimum costMSTMST
traverse every edge onceEuler path / circuitEuler Tours
schedule tasks with prerequisitestopological sort, DAG DPDAGs
count ways with a sum of sizespolynomial multiplication / generating functionsGenerating Functions
sum over pairs of or convolution (FFT)FFT
xor of a subset equal to / maximallinear algebra over GF(2)XOR Basis
two players, last move wins, sum of independent gamesSprague–GrundySprague–Grundy
intervals: max non-overlapping, min points to stabgreedy by right endInterval Problems
repeated function application functional graph, binary liftingFunctional Graphs

Transforming the input

TransformationEffect
sort the itemsorder-independent problems become prefix / two-pointer problems
reverse timedeletions become insertions (DSU), “last” becomes “first”
complementcount the bad objects instead of the good ones
prefix sums / differencesrange conditions become point conditions
rotate coordinates Manhattan becomes Chebyshev
contract equivalent statesSCC condensation, DSU merging, canonical forms
binary search on the answeroptimization becomes a yes/no feasibility check
process offline in a clever ordersort queries, divide and conquer on time, Mo’s order

Related: Attacking a Problem, 🐬 Before Contest.