Concepts36

⚙️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
⚙️AlgorithmAdvanced

Sum over Subsets (SOS) DP

Sum over Subsets (SOS) DP lets you compute F[mask] = sum of A[submask] over all submasks in O(n 2^n) instead of O(3^n).

#sos dp#subset zeta transform#mobius inversion+11
⚙️AlgorithmAdvanced

DP with Expected Value

Dynamic programming with expected value solves problems where each state transitions randomly and we seek the expected cost, time, or steps to reach a goal.

#expected value dp#linearity of expectation#indicator variables+11
⚙️AlgorithmAdvanced

Block-Cut Tree

A Block-Cut Tree decomposes an undirected graph into biconnected components (blocks) and articulation points, forming a bipartite tree.

#block-cut tree#biconnected components#articulation points+11
⚙️AlgorithmAdvanced

Hungarian Algorithm

The Hungarian algorithm solves the square assignment problem (matching n workers to n jobs) in O(n^{3}) time using a clever potential (label) function on vertices.

#hungarian algorithm#assignment problem#bipartite matching+11
⚙️AlgorithmAdvanced

General Matching - Blossom Algorithm

Edmonds' Blossom Algorithm finds a maximum matching in any undirected graph, not just bipartite ones.

#blossom algorithm#edmonds matching#general graph matching+12
⚙️AlgorithmAdvanced

Minimum Cost Maximum Flow

Minimum Cost Maximum Flow (MCMF) finds the maximum possible flow from a source to a sink while minimizing the total cost paid per unit of flow along edges.

#minimum cost maximum flow#successive shortest augmenting path#reduced cost+11
⚙️AlgorithmAdvanced

Biconnected Components

A biconnected component (block) is a maximal subgraph where removing any single vertex keeps it connected.

#biconnected components#blocks#articulation points+12
⚙️AlgorithmAdvanced

Virtual Tree (Auxiliary Tree)

A Virtual Tree (Auxiliary Tree) compresses a large tree into a much smaller tree that contains only the k important nodes and the LCAs needed to keep them connected.

#virtual tree#auxiliary tree#lca+12
⚙️AlgorithmAdvanced

Johnson's Algorithm

Johnson's Algorithm computes all-pairs shortest paths on sparse graphs by first removing negative edges via reweighting, then running Dijkstra from every vertex.

#johnson's algorithm#all pairs shortest paths#apsp+12