Lecture 10
More divide and conquer (runtimes, matrix multiplication)
CSE 421 Autumn 2025
1
Previously…
2
The Divide and Conquer paradigm
3
A classic divide and conquer problem
Mergesort
4
A classic divide and conquer problem
Mergesort
5
A classic divide and conquer problem
Mergesort
6
A classic divide and conquer problem
Mergesort
7
A classic divide and conquer problem
Mergesort
8
A classic divide and conquer problem
Mergesort
9
and
Time to sort two instances of half the size
Time to merge
A classic divide and conquer problem
Mergesort
10
and
2D Euclidean closest pair
11
The entire algorithm
The entire algorithm
Main takeaway
14
To make divide and conquer efficient/worth it, your conquer step must be faster than your baseline algorithm.
Today
15
More Divide and Conquer:
Divide and conquer runtimes
The master theorem
16
Divide and conquer runtimes
The master theorem
17
Intuition for the master theorem
18
Due to recursion, the problem has a tree like structure
Proof strategy:
Divide and conquer runtimes
The master theorem
19
Divide and conquer runtimes
The master theorem
20
Divide and conquer runtimes
The master theorem
21
Matrix multiplication
22
Trivial algorithm for matrix multiplication
23
Can we do better?
Matrix multiplication naturally decomposes
Matrix multiplication decomposes into smaller matrix multiplications!�
24
Divide and conquer algorithm idea:
Runtime:
Matrix multiplication naturally decomposes
Matrix multiplication decomposes into smaller matrix multiplications!�
25
Divide and conquer algorithm idea:
Runtime:
Matrix multiplication naturally decomposes
Matrix multiplication decomposes into smaller matrix multiplications!�
26
Divide and conquer algorithm idea:
Runtime:
So, we didn’t gain anything..
What should we try to do to make divide and conquer work?
Strassen’s divide and conquer (1968)
27
Previously: we were directly multiplying, and then adding:
Strassen’s divide and conquer (1968)
28
Strassen’s divide and conquer (1968)
29
Strassen’s divide and conquer (1968)
30
Strassen’s divide and conquer (1968)
31
Strassen’s divide and conquer (1968)
32
Strassen’s divide and conquer (1968)
33
A decomposition from another planet
34
Wikipedia article for Strassen’s algorithm
Previously, we computed 8 small matrices (one for each green square via one multiplication), and obtained the C matrices by additions of these 8 matrices.
A decomposition from another planet
35
Wikipedia article for Strassen’s algorithm
What if I told you.. you can obtain the C matrices by adding together just 7 matrices (each obtained via one multiplication)?
A decomposition from another planet
36
Wikipedia article for Strassen’s algorithm
What if I told you.. you can obtain the C matrices by adding together just 7 matrices (each obtained via one multiplication)? These are the 7 matrices:
2
A decomposition from another planet
37
Wikipedia article for Strassen’s algorithm
What if I told you.. you can obtain the C matrices by adding together just 7 matrices (each obtained via one multiplication)? These are the 7 matrices:
A decomposition from another planet
38
Wikipedia article for Strassen’s algorithm
What if I told you.. you can obtain the C matrices by adding together just 7 matrices (each obtained via one multiplication)? These are the 7 matrices:
A decomposition from another planet
39
Wikipedia article for Strassen’s algorithm
What if I told you.. you can obtain the C matrices by adding together just 7 matrices (each obtained via one multiplication)? These are the 7 matrices:
A decomposition from another planet
40
Wikipedia article for Strassen’s algorithm
What if I told you.. you can obtain the C matrices by adding together just 7 matrices (each obtained via one multiplication)? These are the 7 matrices:
A decomposition from another planet
41
Wikipedia article for Strassen’s algorithm
What if I told you.. you can obtain the C matrices by adding together just 7 matrices (each obtained via one multiplication)? These are the 7 matrices:
A decomposition from another planet
42
Wikipedia article for Strassen’s algorithm
What if I told you.. you can obtain the C matrices by adding together just 7 matrices (each obtained via one multiplication)? These are the 7 matrices:
Wikipedia article for Strassen’s algorithm
A decomposition from another planet
43
Wikipedia article for Strassen’s algorithm
Strassen’s algorithm
44
- Volker Strassen (89 years old!) about his algorithm
“It is really very simple. I was surprised that nobody had found it before.”
Strassen’s algorithm
45