liveBook · Manning

Hillclimbing

As explained in Advanced Algorithms and Data Structures

Hill climbing is an iterative local-search technique that moves from a candidate solution to a neighboring solution with an improved objective value.

Hill climbing is an iterative local-search technique: start with a candidate solution, inspect nearby alternatives, and move to one with a better objective value. For minimization, the same approach is called hill descent. It improves solutions without requiring a differentiable cost function, provided the cost can be computed. section 16.0 section 17.1

A practical iteration follows this pattern:

  • Choose a current solution and explore a small neighborhood around it. section 16.2.3
  • Try random directions or parameter changes, including increases and decreases when the useful direction is unknown. section 16.2.3
  • Compute the objective for each trial and move only when the result improves. section 16.2.3 section 17.1
  • Stop improving when the neighborhood offers no better position, recognizing that local minima and plateaus can prevent global optimality. section 16.2.3

Reducing edge crossings

Represent a graph drawing as a candidate solution, then move vertices slightly and recalculate its crossing number. Keep a move when it reduces crossings; otherwise retain the current arrangement and try another nearby move. section 16.0 section 16.2.3

Figure 16.12 How a generic randomized heuristic with local optimization works, explained using the marble analogy. Notice that we need to try to update x in both directions and check if we get an improvement.

Compare nearby updates in both directions and check whether either produces an improvement. section 16.2.3

How Advanced Algorithms and Data Structures covers it

How deep it goes
Defines neighborhood exploration and improvement-based updates, then explains failure on local minima and plateaus.
Examples
Uses vertex movements in graph embeddings and a marble moving across a cost landscape.
What it assumes
Assumes a candidate solution, neighboring changes, and a computable cost or objective function.
What you can do after
Apply it to improve a computable objective when differentiability is unavailable, while recognizing approximate results.
How it connects
Contrasts random sampling and gradient descent, and motivates simulated annealing as a response to local minima.

Also explained in

Compare how 2 books explain hillclimbing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Advanced Algorithms and Data Structures. The section links point to the parts of the book it draws on.