Skip to content
Lex Fridman PodcastLex Fridman Podcast

Richard Karp: Algorithms and Computational Complexity | Lex Fridman Podcast #111

Richard Karp is a professor at Berkeley and one of the key figures in the history of theoretical computer science. In 1985, he received the Turing Award for his research in the theory of algorithms, including the development of the Edmonds–Karp algorithm for solving the maximum flow problem on networks, Hopcroft–Karp algorithm for finding maximum cardinality matchings in bipartite graphs, and his landmark paper in complexity theory called "Reducibility Among Combinatorial Problems", in which he proved 21 problems to be NP-complete. This paper was probably the most important catalyst in the explosion of interest in the study of NP-completeness and the P vs NP problem. Support this podcast by signing up with these sponsors: - Eight Sleep: https://eightsleep.com/lex - Cash App - use code "LexPodcast" and download: - Cash App (App Store): https://apple.co/2sPrUHe - Cash App (Google Play): https://bit.ly/2MlvP5w EPISODE LINKS: Richard's wikipedia: https://en.wikipedia.org/wiki/Richard_M._Karp PODCAST INFO: Podcast website: https://lexfridman.com/podcast Apple Podcasts: https://apple.co/2lwqZIr Spotify: https://spoti.fi/2nEwCF8 RSS: https://lexfridman.com/feed/podcast/ Full episodes playlist: https://www.youtube.com/playlist?list=PLrAXtmErZgOdP_8GztsuKi9nrraNbKKp4 Clips playlist: https://www.youtube.com/playlist?list=PLrAXtmErZgOeciFP3CBCIEElOJeitOr41 OUTLINE: 0:00 - Introduction 3:50 - Geometry 9:46 - Visualizing an algorithm 13:00 - A beautiful algorithm 18:06 - Don Knuth and geeks 22:06 - Early days of computers 25:53 - Turing Test 30:05 - Consciousness 33:22 - Combinatorial algorithms 37:42 - Edmonds-Karp algorithm 40:22 - Algorithmic complexity 50:25 - P=NP 54:25 - NP-Complete problems 1:10:29 - Proving P=NP 1:12:57 - Stable marriage problem 1:20:32 - Randomized algorithms 1:33:23 - Can a hard problem be easy in practice? 1:43:57 - Open problems in theoretical computer science 1:46:21 - A strange idea in complexity theory 1:50:49 - Machine learning 1:56:26 - Bioinformatics 2:00:37 - Memory of Richard's father CONNECT: - Subscribe to this YouTube channel - Twitter: https://twitter.com/lexfridman - LinkedIn: https://www.linkedin.com/in/lexfridman - Facebook: https://www.facebook.com/LexFridmanPage - Instagram: https://www.instagram.com/lexfridman - Medium: https://medium.com/@lexfridman - Support on Patreon: https://www.patreon.com/lexfridman

Lex FridmanhostRichard Karpguest
Jul 25, 20202h 7mWatch on YouTube ↗

At a glance

WHAT IT’S REALLY ABOUT

Richard Karp Explores Algorithms, NP-Completeness, and Human Intelligence Limits

  1. Richard Karp discusses his early love of geometry and formal proofs, then builds up the core ideas of algorithms, polynomial-time complexity, and the P vs NP problem. He explains NP-completeness, reductions between classic combinatorial problems, and why most experts believe P ≠ NP despite lacking a proof. Karp highlights elegant algorithms such as the Hungarian method, stable matching, and Rabin–Karp string search, and reflects on randomized algorithms, average-case behavior, and the gap between theory and practice. He also shares skeptical views on superhuman AI, thoughts on machine learning’s limits, applications of algorithms in biology, and personal reflections on teaching and his intellectual development.

IDEAS WORTH REMEMBERING

5 ideas

Understanding P vs NP reshapes expectations about what problems are efficiently solvable.

Karp explains that P is the class of problems solvable in polynomial time, while NP includes problems whose solutions can be verified quickly; if P ≠ NP, as most suspect, many central optimization and decision problems likely have no universally efficient exact algorithms.

Reductions show that many seemingly different hard problems are fundamentally equivalent.

Building on Cook’s work, Karp showed that problems like satisfiability, clique, integer programming, and many others can simulate each other via polynomial-time reductions, meaning either all these NP-complete problems are efficiently solvable or none are.

Randomization can yield simple, powerful algorithms with small, controllable error.

Algorithms like Rabin–Karp for string search and randomized primality testing leverage random sampling and hash-like fingerprints to run fast on large inputs, accepting a tiny probability of error that can often be bounded or checked afterward.

Worst-case complexity can be pessimistic; many NP-complete problems are often easy in practice.

Karp notes that SAT solvers and TSP solvers routinely handle huge real-world instances despite worst-case hardness, illustrating that empirical performance and instance structure can matter more than worst-case theory for many applications.

The stable matching problem exemplifies how elegant algorithms connect theory and practice.

The Gale–Shapley algorithm, which produces stable matchings between two groups (e.g., students and schools), is conceptually simple, provably correct, and underlies real systems like medical residency matching, showing the practical impact of theoretical insights.

WORDS WORTH SAVING

5 quotes

It’s a nice escape from the messiness of the real world where nothing can be proved.

Richard Karp

I would bet that P is unequal to NP, simply because there are problems that have been around for centuries and no polynomial time algorithms have been found.

Richard Karp

Either all of these problems or none of them are solvable in polynomial time.

Richard Karp

I don’t think there’s any computer program which surpasses a six‑month‑old child in terms of comprehension of the world.

Richard Karp

The top three [secrets of teaching] would be preparation, preparation, and preparation.

Richard Karp

Early fascination with geometry, proofs, and mathematical eleganceFoundations of algorithms, polynomial time, and complexity classes (P, NP, NP-complete, NP-hard)NP-completeness, Cook’s theorem, and Karp’s 21 NP-complete problemsClassic combinatorial algorithms: max flow, assignment problem, stable matching, Rabin–KarpRandomized algorithms and probabilistic analysis versus worst-case complexityLimits of current AI and machine learning, and skepticism about superintelligenceApplications of algorithms in bioinformatics and reflections on teaching and mentorship

High quality AI-generated summary created from speaker-labeled transcript.

Get more out of YouTube videos.

High quality summaries for YouTube videos. Accurate transcripts to search & find moments. Powered by ChatGPT & Claude AI.

Add to Chrome