⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 18m 45s17 days 22 hours 18 minutes 45 seconds.
⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 18m 45s17 days 22 hours 18 minutes 45 seconds.

Sign in to watch this lesson
Advanced - Dynamic Programming · 4:35
When the state of a problem is a set of used items, we store it as a bitmask. We replace the (n-1)! orders of a route with Held-Karp's table over (visited set, last venue), solve the assignment problem with a DP over the mask alone, and compute sums over all submasks for every mask in n·2ⁿ steps instead of 3ⁿ by adding along one bit at a time, as on the edges of a cube.