Your Problem Is NP-Complete. Now What?

Created by Abhyuday DesaiUpdated , v2Runs 4 min 38 sec
0 views

About this video

In Episode 04 of P vs NP Explained, the problem you need to solve turns out to be NP-complete, and we look at four practical responses. Search anyway when the inputs are small. Use something specific about your problem. Accept a good answer instead of the best one. Or hand the problem to a solver. For the second, we run a dynamic program that answers subset sum for thirty numbers at once, and then see why that doesn't put subset sum in P.

You'll learn how to:

  • Measure how your real inputs behave before deciding that an exponential search is too slow
  • Read a dynamic program that tracks the reachable sums, where trying subsets would mean about a billion of them
  • Understand pseudo-polynomial time: the work is polynomial in the value of the target and exponential in the number of bits it takes to write it
  • Tell an approximation algorithm, which comes with a guarantee, from a heuristic, which doesn't
  • See when to hand a problem to a SAT or integer linear programming solver, and why you still test it on your own instances
  • Choose between the four by input size, whether an approximate answer is acceptable, and the time you have

This video closes the series. The code runs from the companion repo.

What changed

  1. v204 Oct 2026abhydesai4 min 38 sec04af2da

    Re-recorded so the solver line in "Approximate and delegate" uses the narration clip that says ILP as three letters; the previous take had played a clip synthesized from the raw pronunciation mark. The reachable-sums and the-bound code scenes were recompiled, hanging a terminal highlight's label below a box that sits at the top of its panel.

    Same chapters. Transcript: 1 of 40 lines changed.

    Show the differencesHide the differences
    1. The fourth is to hand the problem to a solver. SAT solvers and integer linear programming solvers, {ILP|I-L-P} for short, have decades of engineering behind them. Translating your problem into their format is itself a reduction.

      The fourth is to hand the problem to a solver. SAT solvers and integer linear programming solvers, ILP for short, have decades of engineering behind them. Translating your problem into their format is itself a reduction.

    0 views0 likes on this version
  2. v103 Oct 2026abhydesai4 min 39 secab97bbc

    First published version.

    0 views0 likes on this version