Concepts24

⚙️AlgorithmIntermediate

State Space Reduction

State space reduction shrinks the number of dynamic programming or search states by keeping only the information that truly affects future decisions.

#state space reduction#dynamic programming#equivalence relation+12
⚙️AlgorithmAdvanced

DP on Broken Profile - Plug DP

Plug DP (DP on broken profile with plugs) sweeps a grid cell by cell while remembering how partial path segments cross the frontier as labeled “plugs.”

#plug dp#broken profile#hamiltonian path+12
⚙️AlgorithmIntermediate

Matrix Exponentiation

Matrix exponentiation turns repeated linear transitions into a single fast power of a matrix using exponentiation by squaring.

#matrix exponentiation#binary exponentiation#companion matrix+11
⚙️AlgorithmAdvanced

Broken Profile DP

Broken Profile DP is a dynamic programming technique that sweeps a grid one cell or one column at a time while encoding the boundary between processed and unprocessed cells as a compact state.

#broken profile dp#profile dp#plug dp+11
⚙️AlgorithmIntermediate

Exchange Arguments in DP

An exchange argument proves that any optimal solution can be reordered to satisfy a simple sorting rule by showing that swapping adjacent out-of-order elements never helps.

#exchange argument#adjacent swap#smith rule+12
⚙️AlgorithmAdvanced

Knuth Optimization

Knuth Optimization speeds up a class of interval dynamic programming (DP) from O(n^3) to O(n^2) by exploiting the monotonicity of optimal split points.

#knuth optimization#interval dp#quadrangle inequality+12
⚙️AlgorithmAdvanced

Digit DP - Advanced States

Digit DP counts integers in a range by scanning digits from most significant to least while maintaining compact state information.

#digit dp#tight flag#leading zeros+12
⚙️AlgorithmAdvanced

DP with Probability

DP with probability models how chance flows between states over time by repeatedly redistributing mass according to transition probabilities.

#markov chain#probability dp#absorbing state+12
⚙️AlgorithmIntermediate

Interval DP

Interval DP solves problems where the optimal answer for a segment [i, j] depends on answers of its subsegments.

#interval dp#matrix chain multiplication#burst balloons+12
⚙️AlgorithmIntermediate

Tree DP - Rerooting Technique

Rerooting (a.k.a. 换根 DP) computes a per-node answer as if each node were the root, in total O(n) time on trees.

#rerooting#tree dp#prefix suffix+11
⚙️AlgorithmIntermediate

Digit DP

Digit DP is a dynamic programming technique for counting or aggregating values over all integers in a range that satisfy a digit-based property.

#digit dp#dynamic programming#tight constraint+12
⚙️AlgorithmIntermediate

Tree DP - Matching and Covering

Tree DP solves matching, vertex cover, and independent set on trees in linear time using small state transitions per node.

#tree dp#maximum matching#vertex cover+12