Hill Climbing

Definition
Hill Climbing repeatedly moves from a solution to a better neighboring solution until no improvement is found. It's simple and fast but can get stuck in local optima. Think of taking small steps uphill until the slope levels out. It differs from stochastic or global methods (like simulated annealing or genetic algorithms) because it accepts only improvements and does not explore broadly, so it's best for smooth landscapes or when combined with restarts.
Hill Climbing

How does it work?

Hill Climbing methods search a space of candidate solutions. They typically define neighbor moves or gradients, evaluate objective functions, and use schedules or memory to escape local optima or to converge reliably.

Examples

  • Local optimisation for hyperparameters — Greedy local search for small discrete hyperparameter spaces where gradients aren't available.
  • Feature selection — Iteratively add/remove features and keep moves that improve validation score.
  • Layout tuning — Iterative improvement of UI layouts or floor plans with small neighbor edits.

Problems

  • Getting trapped in local maxima
  • Plateaus where neighboring states have equal value, causing stalling
  • Ridges that require indirect moves the algorithm can't find
  • No mechanism to escape once stuck, unlike simulated annealing
  1. Wikipedia: Hill climbing