What is NP-hard?

NP-hard is like having a super complicated puzzle that gets harder and harder as you grow up, and no one knows how to solve it quickly.

Imagine you have a big box of different toys, and your job is to find the fastest way to put them all together in a fun shape. That’s what NP-hard problems are like, they’re puzzles we know how to solve, but finding the best answer quickly feels impossible, even for grown-ups with lots of help.

The Toy Box Example

Let’s say you have 10 toys, and you want to arrange them in a line so that each toy touches the next one. It sounds easy, right? But if you have 100 toys, suddenly it's like trying to find your way through a maze with 100 doors, there are so many possibilities!

NP-hard problems are like those mazes. We know how to solve them, we just might need to try every path until we find the right one. That’s fine for small puzzles, but when things get big, it takes way too long.

So even though you're not a robot or a wizard, you can still say: "I understand what NP-hard means!"

Take the quiz →

Examples

  1. Trying to find the fastest route for a delivery truck when every possible path needs checking.
  2. Solving a Sudoku puzzle by trying out every number in every cell until you get it right.
  3. Figuring out if one of your friends is cheating on you, but you have to check each friend individually.

Ask a question

See also

Discussion

Recent activity