A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Local Search Optimization

Graduate Depth 97 in the knowledge graph I know this Set as goal
9topics build on this
605prerequisites beneath it
See this on the map →
Algorithm Design BasicsGreedy Algorithms+1 moreGenetic AlgorithmsSimulated Annealing
optimization local-search hill-climbing metaheuristics

Core Idea

Local search maintains a single current state and iteratively moves to neighboring states, useful for optimization problems where the path is irrelevant and only the goal state matters. Methods like hill climbing, simulated annealing, and tabu search balance exploration (escaping local optima) and exploitation (converging to good solutions). Local search trades completeness for efficiency, making it applicable to large combinatorial problems.

How It's Best Learned

Implement hill climbing on a landscape with multiple local optima to understand the problem, then compare with simulated annealing to see how probabilistic moves help escape local optima.

Explainer

From your work with greedy algorithms, you know the appeal of always taking the locally best option: it is fast, simple, and often surprisingly effective. Local search optimization takes this idea and applies it to problems where you do not care about the path to a solution — you only care about finding the best solution itself. Think of scheduling, circuit layout, or the traveling salesperson problem: nobody asks *how* you arrived at the route, only whether the route is short. Local search starts with some candidate solution, examines its "neighbors" (solutions reachable by a small change), and moves to a better one. Repeat until no neighbor improves the current state.

The simplest version is hill climbing: evaluate your current position, look at all neighbors, and step to the best one. It is the optimization equivalent of walking uphill in fog — you can feel the slope under your feet but cannot see the summit. The critical weakness is local optima: hilltops that are not the highest point in the landscape. Hill climbing will reach the top of whatever hill it starts on and stop, even if a much taller peak sits just across a valley. If you run hill climbing on a function with many bumps, the result depends heavily on where you start, and restarts with random initial states become essential.

The insight behind more sophisticated methods is that sometimes you must accept a *worse* move to eventually find a *better* solution. Simulated annealing borrows from metallurgy: at high "temperatures" early in the search, the algorithm frequently accepts downhill moves, allowing it to escape shallow local optima. As the temperature cools, it becomes increasingly greedy, settling into the best basin it has found. Tabu search takes a different approach: it maintains a memory of recently visited states and forbids returning to them, forcing the search to explore new territory even if that means temporarily moving to worse solutions. Both methods illustrate the fundamental tradeoff in optimization between exploration (searching broadly) and exploitation (refining what you have found so far).

Local search trades the guarantees of exhaustive methods — completeness, optimality — for the ability to handle problems far too large for systematic search. A brute-force search over all possible schedules for a university with thousands of courses is intractable, but local search can produce a good schedule in seconds by starting with a random assignment and iteratively swapping conflicting courses. The solutions are not provably optimal, but in practice they are often excellent, and the algorithms scale to problem sizes where no exact method is feasible.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsThe Distributive PropertyVariables and Expressions ReviewIntroduction to PolynomialsAdding and Subtracting PolynomialsMultiplying PolynomialsFactorialPermutationsCombinationsCounting Principles: Addition and Multiplication RulesIntroduction to Graph TheoryPropositional Logic FoundationsLogical EquivalencesBoolean AlgebraBoolean Type and Truth ValuesComparison Operators and Boolean TestsLogical Operators and Boolean AlgebraConditional StatementsDefining and Calling FunctionsFunctions: Decomposing ProblemsFunction Parameters and Argument PassingReturn ValuesVariable ScopeIntroduction to ClassesObjects and InstancesMethods and AttributesAlgorithm Design BasicsTree Structure and Node PropertiesBinary TreesTree TraversalsDepth-First Search (DFS)Depth-First Search: Implementation and ApplicationsTopological SortDynamic ProgrammingLongest Common Subsequence (LCS) ProblemEdit Distance: Levenshtein Distance and DP0/1 Knapsack Problem: Bounded Capacity DPGreedy AlgorithmsActivity Selection Problem Using Greedy AlgorithmsDijkstra's AlgorithmA* Search AlgorithmHeuristic Search FunctionsLocal Search Optimization

Longest path: 98 steps · 605 total prerequisite topics

Prerequisites (3)

Leads To (2)