Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 37s1 days 16 hours 1 minutes 37 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 37s1 days 16 hours 1 minutes 37 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.