ThinkViz LogoThinkViz
← Back to Explorer

Hill Climbing

Hill Climbing is an iterative local search algorithm that continuously moves uphill in the direction of increasing state evaluation. It can get trapped in local maxima or plateaus.

Category:Local Search
•
Difficulty:Beginner
•
Time complexity:O(∞) / State-dependent
•
Space complexity:O(1)
Interactive VisualizationHill Climbing Visualizer
LOCAL SEARCHHill Climbing on Multimodal Deceptive Hills
Start (x):2.5

Fitness Landscape Curve

👑 Global Summit (18.2)
0/0
Step Trace & Explanation-
Action:Click 'Start Evolution' to begin simulation.
Hill Climbing Pseudocode
1.Initialize current state with starting position x
2.Evaluate objective fitness f(current)
3.Generate and evaluate adjacent state neighbors
4.If highest neighbor > f(current), move uphill to neighbor
5.Else if all neighbors <= f(current), terminate at Local Optimum

Key Evolutionary Takeaways

AI Concepts

Traveling Salesperson (TSP) is an NP-hard problem with $(N-1)! / 2$ possible circuits. For 12 cities, there are ~20 million routes!

Order Crossover (OX) splices valid partial paths between parents without duplicating any cities.

2-Opt Inversion Mutation reverses segments of the tour to directly untangle crossed highway links.

Optimization Method:TSP Order Crossover