Skip to content
BENIBIX Learn

Heuristics and Evolutionary AI

Level 2 · AI built from rules

How a rule of thumb finds a good answer fast, and how copying evolution finds good designs. What each one gives up to save time.

Course contentsLesson 4 of 10

After this lesson you can

  • Explain what a heuristic gives up
  • Describe one round of an evolutionary algorithm
  • Say when a good answer beats the best one

11 mincovers 2 glossary entries

Worth reading first: Rule-Based and Expert Systems

How AI finds a good answer without checking them all

Some problems have too many answers to check one by one. A van with 20 stops can visit them in over two billion billion orders. A heuristic is a rule of thumb that finds a good answer fast, without trying them all. It gives up the promise of the best answer to save time.

One simple heuristic for the van is: always drive to the nearest stop you have not been to yet. It plans a route in a blink. The route is often good, though rarely perfect. On one small map of seven stops, it comes out 8% longer than the best route.

Chess programs lean on heuristics too. In 1950, Claude Shannon worked out that chess has about 10 to the power of 120 possible games. No computer can play them all out. So a program looks a few moves ahead, then scores each board with a rule of thumb, such as counting the pieces left.

An evolutionary algorithm borrows its idea from nature. It starts with a big group of random answers. A score says how good each one is. The best are kept, mixed with each other and changed a little at random. That makes a new group, and the steps repeat for many rounds.

Over hundreds of rounds the answers get better, the way a breed of dog changes over many lifetimes. Nobody tells the program what a good answer looks like. It only needs a way to score one. That makes it handy for odd design jobs where no one knows the shape of the best answer.

NASA used one to design a small radio antenna for three tiny satellites. The program tried many bent wire shapes and kept the best ones, round after round. The winner looked like a twisted paper clip, and it flew in space in 2006.

Both methods share one catch. They find a good answer, not the best one, and a second run may find a different one. That is fine when good is good enough, like a delivery route. It is risky when one miss costs a lot, so people check the result before they trust it.

The rule of thumb gives up a bit of distance to skip a huge pile of checks.

Worked example

Jack plans his delivery van

Jack's van has 25 stops each morning. Checking every order would take longer than the age of the universe.

His app always heads to the nearest stop not yet visited. It plans the route in under a second, and the drive takes him about 3 hours.

The words for this lesson2

Check yourself

What does a heuristic give up so it can work fast?

Finished this lesson?

Marking it complete also marks its 2 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.