6.006
Introduction to Algorithms
Spring 2020
This course is an introduction to mathematical modeling of computational problems, as well as common algorithms, algorithmic paradigms, and data structures used to solve these problems. It emphasizes the relationship between algorithms and programming and introduces basic performance measures and analysis techniques for these problems.
Readings
Fall 2011
Topics
- Algorithmic thinking, peak finding
- Models of computation, Python cost model, document distance
- Insertion sort, merge sort
- Heaps and heap sort
- Binary search trees, BST sort
- AVL trees, AVL sort
- Counting sort, radix sort, lower bounds for sorting and searching
- Hashing with chaining
- Table doubling, Karp-Rabin
- Open addressing, cryptographic hashing
- Integer arithmetic, Karatsuba multiplication
- Square roots, Newton’s method
- Breadth-first search (BFS)
- Depth-first search (DFS), topological sorting
- Single-source shortest paths problem
- Dijkstra
- Bellman-Ford
- Speeding up Dijkstra
- Memoization, subproblems, guessing, bottom-up; Fibonacci, shortest paths
- Parent pointers; text justification, perfect-information blackjack
- String subproblems, psuedopolynomial time; parenthesization, edit distance, knapsack
- Two kinds of guessing; piano/guitar fingering, Tetris training, Super Mario Bros.
- Computational complexity
- Algorithms research topics
Readings
- Readings refer to chapters and/or sections of the course textbook:
- LEC #: 1 · TOPICS: Algorithmic thinking, peak finding · READINGS: 1, 3, D.1
- LEC #: 3 · TOPICS: Insertion sort, merge sort · READINGS: 1.2, 2.1–2.3, 4.3–4.6
- LEC #: 4 · TOPICS: Heaps and heap sort · READINGS: 6.1–6.4
- LEC #: 6 · TOPICS: AVL trees, AVL sort · READINGS: 13.2, 14
- LEC #: 7 · TOPICS: Counting sort, radix sort, lower bounds for sorting and searching · READINGS: 8.1–8.3
- LEC #: 8 · TOPICS: Hashing with chaining · READINGS: 11.1–11.3
- LEC #: 9 · TOPICS: Table doubling, Karp-Rabin · READINGS: 17
- LEC #: 10 · TOPICS: Open addressing, cryptographic hashing · READINGS: 11.4
- LEC #: 13 · TOPICS: Breadth-first search (BFS) · READINGS: 22.1–22.2, B.4
- LEC #: 14 · TOPICS: Depth-first search (DFS), topological sorting · READINGS: 22.3–22.4
- LEC #: 15 · TOPICS: Single-source shortest paths problem · READINGS: 24.0, 24.5
- LEC #: 16 · TOPICS: Dijkstra · READINGS: 24.3
- LEC #: 17 · TOPICS: Bellman-Ford · READINGS: 24.1–24.2
- LEC #: 19 · TOPICS: Memoization, subproblems, guessing, bottom-up; Fibonacci, shortest paths · READINGS: 15.1, 15.3
- LEC #: 21 · TOPICS: String subproblems, psuedopolynomial time; parenthesization, edit distance, knapsack · READINGS: 15.1, 15.2, 15.4
- LEC #: 23 · TOPICS: Computational complexity · READINGS: 34.1–34.3
Spring 2008
Topics
- Introduction and document distance
- Document distance in Python (docdist{1,2,3,4}.py)
- More document distance, mergesort
- Python cost model, review for asymptotic notation and mergesort
- Airplane scheduling, binary search trees
- Binary search trees
- Balanced binary search trees
- AVL Trees (balanced binary search trees)
- Hashing I: chaining, hash functions
- Hashing in Python, mutability
- Hashing II: table doubling, Karp-Rabin
- Karp-Rabin review, rolling hashes principles and code
- Hashing III: open addressing
- Sorting I: heaps
- Sorting II: heaps
- Sorting III: lower bounds, linear-time sorting
- Sorting IV: stable sorting, radix sort
- Counting, radix and bucket sorting, gas simulation
- Searching I: graph search, representations, and applications
- Searching II: breadth-first search and depth-first search
- Searching III: topological sort and NP-completeness
- Breadth-first search and depth-first search
- Shortest paths I: intro
- Assistance for problem set
- Shortest paths II: Bellman-Ford
- Shortest paths III: Dijkstra
- Shortest paths IV: Dijkstra speedups
- Array implementation of Dijkstra
- Dynamic programming I: memoization, Fibonacci, Crazy Eights, guessing
- Hands-on dynamic programming: big ideas, memoization in Fibonacci, crazy cards, Dijkstra and Bellman-Ford algorithm as dynamic programming
- Dynamic programming II: longest common subsequence (LCS), parent pointers
- More dynamic programming: beating Super Mario Brothers, getting points back on tests (LCS), Crazy Eights
- Dynamic programming III: text justification, parenthesization, knapsack, pseudopolynomial time, Tetris training
- Even more dynamic programming: maximum-sum sub-array, more Tetris
- Dynamic programming IV: piano fingering, structural DP (trees), vertex cover, dominating set, and beyond
- Knapsack and its variants, structural dynamic programming: covering a tree with templates, dominating set
- Numerics I
- Dynamic programming practice: live Python coding, dominating sets, structural dynamic programming: covering a tree with templates
- Numerics II
- Divide and conquer vs. dynamic programming on problems: matrix multiplication, tower, max-sum subarray, closest pair
- Numerics review, Strassen’s algorithm for matrix multiplication
- Beyond 6.006: follow-on classes, geometric folding algorithms
Readings
- The primary written reference for the course is the following textbook:
- Miller, Bradley, and David Ranum. Problem Solving with Algorithms and Data Structures Using Python . Wilsonville, OR: Franklin, Beedle and Associates, 2005. ISBN: 9781590280539.
- In the table below, readings listed as CLRS are taken from the course textbook:
- LEC #: L1 · TOPICS: Introduction and document distance · READINGS: CLRS, chapters 1-3
- LEC #: L2 · TOPICS: More document distance, mergesort · READINGS: CLRS, sections 11.1-11.2
- LEC #: L3 · TOPICS: Airplane scheduling, binary search trees · READINGS: CLRS, chapter 10 and sections 12.1-12.3
- LEC #: L4 · TOPICS: Balanced binary search trees · READINGS: CLRS, sections 13.1 and 13.2 for a different approach (red-black trees)
- LEC #: L6 · TOPICS: Hashing II: table doubling, Karp-Rabin · READINGS: CLRS, chapter 17 and section 32.2
- LEC #: L7 · TOPICS: Hashing III: open addressing · READINGS: CLRS, section 11.4 (and 11.3.3 and 11.5 if interested)
- LEC #: L8 · TOPICS: Sorting I: heaps · READINGS: CLRS, sections 2.1-2.3 and 6.1-6.2
- LEC #: L9 · TOPICS: Sorting II: heaps · READINGS: CLRS, sections 6.1-6.4
- LEC #: L10 · TOPICS: Sorting III: lower bounds, linear-time sorting · READINGS: CLRS, sections 8.1-8.4
- LEC #: L12 · TOPICS: Searching I: graph search, representations, and applications · READINGS: CLRS, sections 22.1-22.3 and B.4
- LEC #: L13 · TOPICS: Searching II: breadth-first search and depth-first search · READINGS: CLRS, sections 22.2-22.3
- LEC #: L14 · TOPICS: Searching III: topological sort and NP-completeness · READINGS: CLRS, sections 22.4 and 34.1-34.3 (at a high level)
- LEC #: L15 · TOPICS: Shortest paths I: intro · READINGS: CLRS, chapter 24 (intro)
- LEC #: L17 · TOPICS: Shortest paths III: Dijkstra · READINGS: CLRS, sections 24.2-24.3
- Wagner, Dorothea, and Thomas Willhalm. “Speed-Up Techniques for Shortest-Path Computations.” In Lecture Notes in Computer Science: Proceedings of the 24th Annual Symposium on Theoretical Aspects of Computer Science . Berlin / Heidelberg: Springer, 2007. ISBN: 9783540709176. Read up to section 3.2.
- LEC #: L19 · TOPICS: Dynamic programming I: memoization, Fibonacci, Crazy Eights, guessing · READINGS: CLRS, chapter 15
- Parncutt, Richard, et al. “An Ergonomic Model of Keyboard Fingering for Melodic Fragments.” Music Perception 14, no. 4 (1997): 341-382.
- Al Kasimi, Alia, Eric Nichols, and Christopher Raphael. “A Simple Algorithm for Automatic Generation of Polyphonic Piano Fingerings.” In Proceedings of the 8th International Conference on Music Information Retrieval , 2007, pp. 355-356.
Sources
- Course catalogue ↗Historical OpenCourseWare
- MIT OpenCourseWare ↗Spring 2020
- MIT OCW calendar ↗
- MIT OCW syllabus ↗
- MIT OCW syllabus ↗
- MIT OCW readings ↗
- MIT OCW calendar ↗
- MIT OpenCourseWare ↗Spring 2008
- MIT OCW calendar ↗
- MIT OCW syllabus ↗
- MIT OCW readings ↗
- Historical MIT OpenCourseWare offering. Named reading entries and schedule topics are automatically extracted from the linked source pages.
- Historical MIT OpenCourseWare offering. Named reading entries and schedule topics are automatically extracted from the linked source pages.
- Historical MIT OpenCourseWare offering. Named reading entries and schedule topics are automatically extracted from the linked source pages.