The Role of Algorithms in Everyday Life: From Google to Netflix 🤖📺
Every time you Google something, scroll through Instagram, or watch a movie…
Maximum Matching in Bipartite Graphs
In many situations we are faced with a problem of pairing elements…
The Simplex Method
We have already encountered linear programming (see Section 6.6)—the general problem of…
Iterative Improvement
The greedy strategy, considered in the preceding chapter, constructs a solution to…
Huffman Trees and Codes
Suppose we have to encode a text that comprises symbols from some n-symbol…
Dijkstra’s Algorithm
In this section, we consider the single-source shortest-paths problem: for a given vertex…
Kruskal’s Algorithm
In the previous section, we considered the greedy algorithm that “grows” a…
Prim’s Algorithm
The following problem arises naturally in many practical situations: given n points, connect them…
Greedy Technique
Let us revisit the change-making problem faced, at least subconsciously, by millions of cashiers…
The Knapsack Problem and Memory Functions
We start this section with designing a dynamic programming algorithm for the…




