AlgoViz

Hill Climbing Optimization

Speed:
Climbers:
3
Landscape Type:
Show Color Gradient
Show Contour Lines
Show Trajectories
Current Step
0
Local Maxima Found
0/3
Best Value
0.00
Starting Point
Current Position
Local Maximum

How It Works

Hill climbing is a mathematical optimization technique that belongs to the local search family of algorithms:

  1. It starts at a random position in the search space (landscape)
  2. Evaluates all neighboring positions and moves to the one with the highest value
  3. Continues this process until no neighbor has a higher value, indicating a local maximum
  4. The algorithm is greedy and simple, but can get trapped in local optima
  5. Multiple random restarts are often used to find better solutions

Interactive Features

  • Generate different landscapes: unimodal (one peak) or multimodal (multiple peaks)
  • Place multiple hill climbers to see how they converge to different local maxima
  • Step through the optimization process or watch it animate automatically
  • Toggle visualization options to better understand the search space
  • Compare how different starting points lead to different solutions