Skip to content

Module 4a ‐ Local Search Optimization

hellochishing edited this page Oct 12, 2026 · 6 revisions

1. State Search Problems and Configuration Formulation

1.1. Path Search vs. State (Configuration) Search

In traditional search algorithms (such as Breadth-First Search, Depth-First Search, or $A^*$ Search), the primary objective is to discover a sequence of state transitions—a path—from a designated initial state $s_0$ to a goal state $s_{goal}$. In these path search problems, the path itself constitutes the solution, and the total path cost $g(n)$ is a critical metric to minimize.

Conversely, a major class of optimization problems in Artificial Intelligence focuses strictly on finding a valid final state that satisfies a set of domain constraints or optimizes a given objective function. In these State Search (or Configuration Search) problems, the sequence of actions or transitions used to reach the goal state is entirely irrelevant. The search algorithm does not retain or evaluate the trajectory through the search space; it evaluates only the structural quality and validity of candidate configurations $s \in S$.

1.1.1. Path Search Paradigm

  • Solution Representation: An ordered sequence of actions $\langle a_1, a_2, \dots, a_k \rangle$ leading from initial state $s_0$ to goal state $s_g$.
  • Evaluation Metric: Path cost function $g(n) = \sum\limits_{i=1}^{k} c(s_{i-1}, a_i, s_i)$, where $c(s_{i-1}, a_i, s_i)$ represents the step cost of executing action $a_i$.
  • Primary Objective: Answering the question "How do we get to an optimal goal state from the starting state?"
  • Memory Requirement: Algorithms must maintain path histories (e.g., frontier queues or tree nodes) to reconstruct the action sequence upon termination.

1.1.2. State Search Paradigm

  • Solution Representation: A single state configuration $s \in S$ representing a complete assignment of values to system variables.
  • Evaluation Metric: Objective function $f(s)$ or heuristic evaluation function $h(s)$ assessing state quality or constraint satisfaction.
  • Primary Objective: Answering the question "What does an optimal or valid state configuration look like?"
  • Memory Requirement: Search algorithms operate directly on candidate states, typically storing only the current state (and potentially a small neighborhood), eliminating the need for search tree maintenance.

1.2. Formal Problem Formulation for Configuration Problems

To formally specify a configuration problem in local search optimization, we define the mathematical components governing the state space and evaluation criteria.

1.2.1. Core Mathematical Components

A configuration problem is formally defined by a triple $(S, G, f)$:

  1. State Space ($S$): The set of all possible complete encodings representing candidate configurations of the system.
  2. Goal Test ($G(s)$): A boolean function $G: S \to {0, 1}$ that evaluates whether a given state $s \in S$ satisfies all mandatory domain constraints:

$$ G(s) = \begin{cases} 1, & \text{if } s \text{ satisfies all constraints} \\ 0, & \text{otherwise} \end{cases} $$

  1. Objective / Heuristic Function ($f(s)$ or $h(s) $): A real-valued function $f: S \to \mathbb{R}$ mapping each state $s$ to a quantitative score. In minimization problems (such as constraint violation counting), $h(s)$ quantifies the degree of conflict in configuration $s$, where $h(s) = 0$ indicates a fully valid solution:

$$ s^* = \underset{s \in S}{\mathrm{argmax}}~h(s) $$

Unlike classical path search models, configuration formulations do not include an explicit path cost function $g(n)$, as intermediate transition steps carry no penalty or value.

1.2.2. State Space Representation & Combinatorial Explosion

The choice of state encoding directly influences the size of the state space $|S|$ and the efficiency of local search operations. A structured, compact representation can eliminate large classes of invalid configurations a priori. However, even with highly optimized encodings, configuration problems inherently suffer from combinatorial explosion.

1.2.2.1. Mathematical Analysis: The 8-Queens State Space

Consider the classic 8-Queens problem to place $8$ chess queens on an $8 \times 8$ chessboard such that no two queens attack each other—meaning no two queens share the same row, column, or diagonal. A naive representation allowing arbitrary placements of $8$ queens on an $8 \times 8$ chessboard yields a state space size of:

$$ |S_{\text{naive}}| = \binom{64}{8} = \dfrac{64!}{8! \cdot (64 - 8)!} = 4,426,165,368 \text{ states} $$

To optimize this representation, we apply domain knowledge: since no valid solution can contain two queens in the same column, we construct a compact array representation $\overrightarrow{s} = [r_1, r_2, \dots, r_8]^T$, where $r_i \in {1, 2, \dots, 8}$ denotes the row index of the queen in column $i$.

This array encoding guarantees exactly one queen per column by design, completely excluding duplicate column placements.

To compute the size of the reduced state space $|S_{\text{compact}}|$, we evaluate the number of independent choices across all $8$ columns:

$$ \begin{alignat*}{4} && |S_{\text{compact}}| &= \prod\limits_{i=1}^{8} 8 && \text{Since each column } i \text{ has } 8 \text{ possible row choices} \\ && &= 8^8 && \\ && &= 16,777,216 \text{ states} && \text{Exact number of valid array configurations} \\ \end{alignat*} $$

Complexity Intuition: Although the compact array encoding reduces the search space by a factor of over $263$ (from $\sim 4.42 \times 10^9$ down to $\sim 1.68 \times 10^7$), exploring $16.78$ million states via exhaustive enumeration remains computationally impractical for real-time systems. As problem dimensions scale (e.g., $N$-Queens where $|S| = N^N$), local search methods become essential to navigate these combinatorial state spaces without constructing full search trees.

1.3. Classic Benchmark Configuration Problems

1.3.1. 8-Queens Problem

  • Configuration Vector: $\overrightarrow{s} = [r_1, r_2, \dots, r_8]^T \in {1, \dots, 8}^8$.
  • Constraint: No two queens may attack each other along rows, columns, or diagonals.
  • Objective Function $h(s)$: Number of pairs of queens attacking each other. A pair $(i, j)$ with $1 \le i < j \le 8$ is in conflict if:

$$ r_i = r_j \quad \text{(same row)} \lor |r_i - r_j| = |i - j| \quad \text{(same diagonal)} $$

  • Goal Condition: Find $s^*$ such that $h(s^*) = 0$.

1.3.2. Graph Coloring Problem

  • Input: An undirected graph $G = (V, E)$ with vertex set $V = {v_1, v_2, \dots, v_n}$ and edge set $E$, alongside a color palette $C = {1, 2, \dots, k}$.
  • Configuration State: A mapping vector $\overrightarrow{c} = [c_1, c_2, \dots, c_n]^T \in C^n$, assigning color $c_i \in C$ to vertex $v_i$.
  • Adjacency Constraint: No two adjacent vertices may share the same color.
  • Objective Function: Count of monochromatic edges (conflict edges):

$$ h(\overrightarrow{c}) = \sum\limits_{(v_i, v_j) \in E} \mathbb{I}(c_i = c_j) $$

where $\mathbb{I}(\cdot)$ is the indicator function returning $1$ if $c_i = c_j$ and $0$ otherwise.

1.3.3. University Course Scheduling

  • Variables: Course sections $U = {u_1, u_2, \dots, u_m}$, classrooms $R = {r_1, r_2, \dots, r_p}$, and time slots $T = {t_1, t_2, \dots, t_q}$.
  • Configuration State: An assignment mapping tuple $\overrightarrow{s}_i = (r_j, t_k)$ for each course section $u_i$.
  • Constraints:
    1. Room Capacity & Non-Overlap: No two large courses assigned to the same room $r_j$ at time $t_k$.
    2. Instructor Allocation: Instructors cannot be double-booked across multiple locations simultaneously.
    3. Cohort Non-Overlap: Mandatory courses for the same student academic year must not conflict in time slot $t_k$.
  • Goal: Discover a complete schedule assignment satisfying all hard constraints ($h(s) = 0$).

1.4. Real-World Applications in AI and Computing

The abstract mathematical structure of configuration search directly mirrors major industrial optimization challenges in computer systems and operational engineering.

1.4.1. Cloud Computing Resource Allocation

In modern data centers, cloud orchestrators must assign thousands of virtual machines (VMs) and containerized microservices to physical host servers containing multi-core CPU and GPU clusters.

  • Configuration State: Mapping vector $\overrightarrow{m}$, where $m_i$ designates the physical host node assigned to task $i$.
  • Constraints & Objectives:
    • Avoid overloading physical host CPU/RAM capacity.
    • Minimize network latency by co-locating interdependent tasks.
    • Minimize overall cluster energy consumption by consolidating workloads onto fewer host nodes.

1.4.2. Vehicle Routing and Fleet Logistics

Logistics platforms optimize fleet delivery operations originating from central distribution warehouses.

  • Configuration State: Assignment matrix specifying driver-to-route pairings, package staging orders inside trucks, and distribution center staging schedules.
  • Constraints & Objectives:
    • Time-window constraints (e.g., guaranteed delivery before 12:00 PM).
    • Vehicle capacity, refrigerated cargo ordering, and driver shift hour limits.
    • Minimize multi-objective route cost, factoring in distance, traffic congestion, and fuel consumption.

1.4.3. Wireless Network Frequency Assignment

Cellular base stations and Wi-Fi access points must assign radio channel frequencies to transmitters to maximize throughput across geographical coverage regions.

  • Configuration State: Frequency channel assignment vector $\overrightarrow{f}$ mapping frequency channels to transmitters.
  • Structural Isomorphism: This problem is structurally isomorphic to the Graph Coloring Problem, where base stations correspond to vertices $V$, potential signal interference regions correspond to edges $E$, and radio frequency channels correspond to colors $C$.
  • Objective: Allocate non-interfering channel frequencies to neighboring transmitters while ensuring fair bandwidth distribution across the network.

2. Fundamentals of Hill Climbing and Local Search

2.1. Core Mechanics of Local Search

2.1.1. Memory Efficiency & Single-State Model

Traditional search algorithms (e.g., Breadth-First Search, Depth-First Search, $A^*$ Search) construct and maintain search trees or frontiers to track paths from an initial state to a goal state. Consequently, their space complexity scales with the size of the search tree or frontier—often requiring exponential memory relative to the solution depth.

In contrast, local search algorithms operate under a single-state model. Rather than expanding a search tree, local search evaluates and modifies a single complete candidate configuration $\overrightarrow{s} \in S$ stored in memory at any given time.

  • Space Complexity: The memory required is $O(1)$ relative to the search depth, as the algorithm only stores the current state $\overrightarrow{s}$ (and optionally its immediate neighbors or best-known state).
  • Path Irrelevance: Intermediate transitions used to reach a state are discarded. Search progression relies entirely on the evaluation of candidate configurations via an objective function $f(\overrightarrow{s})$ or heuristic function $h(\overrightarrow{s})$.

2.1.2. Neighborhood Functions

Local search moves through the state space by exploring the neighborhood of the current state $\overrightarrow{s}$.

2.1.2.1. Formal Definition

A neighborhood function $N: S \to \mathcal{P}(S)$ maps a given state $\overrightarrow{s}$ to a subset of states $N(\overrightarrow{s}) \subseteq S$, called the neighborhood of $\overrightarrow{s}$. Each neighboring state $\overrightarrow{s}' \in N(\overrightarrow{s})$ is generated by applying a small local modification (an operation or move operator) to $\overrightarrow{s}$.

2.1.2.2. Neighborhood Evaluation Logic

At each iteration $k$, the algorithm evaluates states in $N(\overrightarrow{s}_k)$ using the evaluation function $f(\overrightarrow{s})$ or $h(\overrightarrow{s})$:

$$\overrightarrow{s}_{k+1} = \text{Select}\left( \left\{ \overrightarrow{s}' \in N(\overrightarrow{s}_k) \mid f(\overrightarrow{s}') < f(\overrightarrow{s}_k) \right\} \right)$$

where $\text{S{}elect}(\cdot)$ represents the choice rule of the specific local search variant (e.g., greedy selection of the best neighbor, random selection of an improving neighbor, or probabilistic acceptance).

2.2. Standard Hill Climbing Algorithm

2.2.1. Algorithmic Procedure & Greedy Choice Rule

Hill Climbing (also referred to as Greedy Local Search or Steepest-Ascent / Steepest-Descent) is the foundational local search procedure. It continually moves in the direction of increasing quality (or decreasing cost).

2.2.1.1. Procedural Execution

  1. Initialization: Generate an initial complete configuration $\overrightarrow{s}_0 \in S$ (typically generated at random).

  2. Neighborhood Evaluation: Construct the full neighborhood $N(\overrightarrow{s})$. Evaluate the objective function $h(\overrightarrow{s}')$ for all $\overrightarrow{s}' \in N(\overrightarrow{s})$.

  3. Greedy Move Selection: Find the neighbor $\overrightarrow{s}^* \in N(\overrightarrow{s})$ that yields the maximum improvement over $h(\overrightarrow{s})$.

    • For a minimization problem (where $h(\overrightarrow{s})$ measures constraint violations or cost):

      $$\overrightarrow{s}^* = \underset{\overrightarrow{s}' \in N(\overrightarrow{s})} {\mathrm{argmax}}~h(\overrightarrow{s}')$$

  4. Termination Criterion:

    • If $h(\overrightarrow{s}^*) &lt; h(\overrightarrow{s}) $, set $\overrightarrow{s} \leftarrow \overrightarrow{s}^*$ and repeat from Step 2.
    • If $h(\overrightarrow{s}^*) \ge h(\overrightarrow{s}) $, terminate search and return $\overrightarrow{s}$ as a local optimum.
function HILL-CLIMBING(problem) returns a state that is a local optimum
    current = MAKE-NODE(problem.INITIAL-STATE)
    loop do
        neighbor = HIGHEST-VALUED-NEIGHBOR(current)
        if VALUE(neighbor) <= VALUE(current) then return VALUE(current)
        current = neighbor

2.2.2. Case Study 1 — 8-Queens under Hill Climbing

2.2.2.1. State Representation and Objective Function

Recall the compact array representation $\overrightarrow{s} = [r_1, r_2, \dots, r_8]^T$, where $r_i \in {1, 2, \dots, 8}$ denotes the row index of the queen in column $i$.

The evaluation metric $h(\overrightarrow{s})$ is defined as the total number of conflicting (attacking) pairs of queens. The objective is to minimize $h(\overrightarrow{s})$ until $h(\overrightarrow{s}) = 0$.

2.2.2.2. Neighborhood Operator: Single-Queen Row Move

The standard neighborhood operator for the 8-Queens problem generates a neighbor by picking a single column $i \in {1, 2, \dots, 8}$ and changing its queen's row assignment to $r_i' \neq r_i$.

For any state $\overrightarrow{s}$, each column has $7$ alternative row placements. The neighborhood size $|N(\overrightarrow{s})|$ is computed as:

$$\begin{alignat*}{4} && |N(\overrightarrow{s})| &= \sum\limits_{i=1}^{8} (8 - 1) && \text{Summing alternative row choices across all 8 columns} \\ && &= 8 \cdot 7 && \\ && &= 56 \text{ neighbors} && \text{Total evaluated configurations per step} \\ \end{alignat*}$$

2.2.2.3. Iterative Execution & Trapped at Local Optima

At each step, Hill Climbing evaluates all $56$ candidate neighbors, computes $h(\overrightarrow{s}')$ for each, and selects the neighbor that achieves the minimum conflict score.

If the current state has $h(\overrightarrow{s}) = 3$, but all $56$ neighbors have $h(\overrightarrow{s}') \ge 3$, the steepest-descent rule forces the algorithm to halt immediately—even though $h(\overrightarrow{s}) \neq 0$. The search terminates at a local minimum.

2.2.3. Case Study 2 — Traveling Salesman Problem (TSP) with Constraints

2.2.3.1. Problem Definition & Real-World Extensions

In the Traveling Salesman Problem (TSP) extended for fleet logistics, a vehicle starts and ends at a central warehouse while visiting a set of $n$ delivery stops $V = {v_1, v_2, \dots, v_n}$.

Unlike pure constraint satisfaction problems where any valid state is equivalent, TSP is a quantitative optimization problem where configurations differ in overall quality and route cost. Real-world extensions incorporate multi-objective penalties:

  • Dynamic Traffic & Travel Time: Time-dependent travel costs $c_{ij}(t)$ between location $i$ and location $j$.
  • Time Windows: Delivery must occur within specified interval $[t_{\text{start}}, t_{\text{end}}]$.
  • Road & Vehicle Constraints: One-way streets, vehicle load capacities, and perishable goods rules (e.g., refrigerated trucks delivering perishable items first).

2.2.3.2. Multi-Objective Route Cost Function

The total objective cost function $C(\overrightarrow{s})$ to minimize is modeled as a weighted linear combination of distance, travel time, and penalty functions:

$$C(\overrightarrow{s}) = w_1 \cdot \sum\limits_{i=1}^{n} d(v_{\pi(i)}, v_{\pi(i+1)}) + w_2 \cdot T_{\text{total}}(\overrightarrow{s}) + w_3 \cdot P_{\text{late}}(\overrightarrow{s}) + w_4 \cdot P_{\text{capacity}}(\overrightarrow{s})$$

where $\pi$ is a permutation of the delivery indices, $d(\cdot,\cdot)$ measures distance, $T_{\text{total}}$ represents total time including delays, and $P_{\text{late}}, P_{\text{capacity}}$ enforce constraint compliance via heavy penalties.

2.2.3.3. Route Neighborhood Operators

Given a route configuration $\overrightarrow{s} = (A, B, C, D, E, A)$:

  1. Pairwise Swap Operator (2-Opt Vertex Swap): Select two delivery stops in the route and swap their positions. $$\overrightarrow{s} = (A, B, C, D, E, A) \implies \overrightarrow{s}' = (A, E, C, D, B, A)$$
  2. Segment Reversal Operator (2-Opt Edge Sub-route Inversion): Select a contiguous sub-path and reverse the sequence of stops. $$\overrightarrow{s} = (A, B, C, D, E, A) \implies \overrightarrow{s}' = (A, D, C, B, E, A)$$
  3. Insertion Operator: Remove a stop from its current position and insert it into a different location in the sequence. $$\overrightarrow{s} = (A, B, C, D, E, A) \implies \overrightarrow{s}' = (A, C, D, B, E, A)$$

The neighbor route $\overrightarrow{s}^* \in N(\overrightarrow{s})$ that minimizes $C(\overrightarrow{s}')$ and satisfies constraint conditions replaces $\overrightarrow{s}$. If no neighborhood operation decreases $C(\overrightarrow{s})$, the algorithm terminates at a local optimum.

2.3. Search Landscape Topography and Failure Modes

The execution of local search can be conceptualized as navigating a multi-dimensional objective surface (landscape) where elevation corresponds to the evaluation function $f(\overrightarrow{s})$ or $h(\overrightarrow{s})$.

2.3.1. Local Optima

A local optimum (local maximum for maximization, local minimum for minimization) is a state $\overrightarrow{s}_{\text{local}}$ such that:

$$\forall \overrightarrow{s}' \in N(\overrightarrow{s}_{\text{local}}), \quad h(\overrightarrow{s}_{\text{local}}) \le h(\overrightarrow{s}')$$

while there exists a global optimum $\overrightarrow{s}_{\text{global}} \in S$ with $h(\overrightarrow{s}_{\text{global}}) &lt; h(\overrightarrow{s}_{\text{local}}) $.

Because standard Hill Climbing evaluates only immediate neighbors $N(\overrightarrow{s})$ (local vision), it cannot perceive higher peaks or lower valleys beyond its immediate horizon. Upon reaching $\overrightarrow{s}_{\text{local}}$, every available move worsens the evaluation metric. The greedy choice rule terminates the search, leaving the agent trapped.

2.3.2. Plateaus and Flat Regions

A plateau is a region of the search landscape where neighboring states share identical evaluation values:

$$\forall \overrightarrow{s}' \in N(\overrightarrow{s}_{\text{plateau}}), \quad h(\overrightarrow{s}') = h(\overrightarrow{s}_{\text{plateau}})$$

  • Flat Local Maxima / Minima: A plateau that sits higher or lower than surrounding regions.
  • Shoulder: A flat region that eventually connects to an ascending slope.

On a plateau, the gradient of the objective function vanishes ($\nabla f \approx 0$). Hill Climbing receives no directional guidance regarding which neighbor leads toward a global solution. As a consequence, basic Hill Climbing halts immediately or drifts aimlessly without making measurable progress.

2.3.3. Ridges

A ridge is a topography where the search landscape slopes upwards along a direction that does not align with the individual coordinate moves defined by the neighborhood operator $N(\overrightarrow{s})$.

To ascend a narrow ridge, an agent must take a sequence of non-greedy or multi-step intermediate moves—such as moving slightly downhill or sideways along one dimension before climbing along another. Because standard Hill Climbing strictly forbids moves that do not yield an immediate improvement ($h(\overrightarrow{s}') \ge h(\overrightarrow{s}) $), it cannot navigate along the ridge axis and remains stuck at an intermediate height.

3. Algorithmic Improvements and Variants of Hill Climbing

Basic hill climbing offers extreme computational and memory efficiency, operating in $O(1)$ space complexity by keeping only the current candidate state $\overrightarrow{s}$ in memory. However, its pure greediness renders it highly vulnerable to search landscape topology pitfalls—frequently halting at suboptimal local extrema, stalling on zero-gradient plateaus, or becoming paralyzed along narrow ridges. To overcome these structural limitations, algorithmic enhancements introduce strategic stochasticity, controlled non-improving transitions, memory mechanisms, and multi-state population frameworks.

3.1. Deconstructing Landscape Pitfalls

Understanding why standard hill climbing fails requires analyzing the interplay between local vision and global topography. Because local search evaluates state quality strictly within an immediate neighborhood $N(\overrightarrow{s})$, it lacks global visibility across the state space $S$.

3.1.1. The Fog Analogy for Local Maxima

A local maximum (or local minimum in conflict-minimization problems) is a state $\overrightarrow{s}^* \in S$ such that:

$$ \forall \overrightarrow{s}' \in N(\overrightarrow{s}^*), \quad f(\overrightarrow{s}^*) \ge f(\overrightarrow{s}') \quad \text{(or } h(\overrightarrow{s}^*) \le h(\overrightarrow{s}') \text{)} $$

while there exists some global optimum $\overrightarrow{s}_{\text{global}}$ where $f(\overrightarrow{s}_{\text{global}}) &gt; f(\overrightarrow{s}^*) $.

The lecture illustrates this limitation using the Fog Analogy: imagine a climber attempting to reach the highest mountain peak in a dense fog. The climber can only test terrain within a single step radius. Upon reaching the summit of a minor hill, every immediate step in all $360^\circ$ directions leads downward. Deprived of global vision, the climber concludes they have reached the global peak and stops climbing, unaware that a much taller mountain peak exists across an intervening valley.

3.1.2. Plateau Navigation Constraints

A plateau (or flat region) is a subset of states $P \subset S$ where the objective evaluation function exhibits zero gradient across neighboring configurations:

$$ \forall \overrightarrow{s}_i, \overrightarrow{s}_j \in P \text{ such that } \overrightarrow{s}_j \in N(\overrightarrow{s}_i), \quad h(\overrightarrow{s}_i) = h(\overrightarrow{s}_j) $$

Plateaus severely impair local search in two ways:

  1. Flat Local Maxima: A plateau that sits higher than all surrounding non-plateau neighbors, from which no strictly improving move exists.
  2. Shoulders: A flat region that eventually leads to an upward slope. Standard hill climbing cannot distinguish a shoulder from a flat local maximum because every adjacent state yields an identical score change ($\Delta h = 0$). As a result, standard steepest-ascent search either halts prematurely or wanders aimlessly without direction.

3.1.3. Ridge Traversal Bottlenecks

A ridge is a narrow sequence of elevated states surrounded by steep downward drops in primary coordinate directions. To navigate along a ridge toward its apex, the optimal trajectory often requires moving diagonally or making a sequence of temporary non-greedy or multi-step coordinate modifications.

Because standard single-variable neighbor generators modify one variable at a time (e.g., moving a single queen in one column or swapping two TSP stops), every immediate 1-step neighbor off the current ridge point drops strictly downhill. Basic hill climbing refuses to accept intermediate downhill moves ($\Delta h &gt; 0$), preventing the search from traversing the ridge toward the global peak.

3.2. Exploration vs. Exploitation Enhancements

To prevent search paralysis, local search algorithms balance exploitation (aggressively climbing local gradients) with exploration (sampling diverse, unexplored regions of $S$).

3.2.1. Random-Restart Hill Climbing

Random-Restart Hill Climbing conducts a series of independent hill-climbing searches, each initialized from a uniformly sampled random state $\overrightarrow{s}_0 \sim U(S)$. Each individual run climbs until it reaches a local optimum. The algorithm tracks the best overall solution found across all iterations.

3.2.1.1. Probabilistic Landscape Coverage Analysis

Let $p$ denote the probability that a single, randomly initialized hill-climbing search successfully converges to the global optimum $\overrightarrow{s}^*$:

$$ p = P(\text{converge to } \overrightarrow{s}^* \text{ from } \overrightarrow{s}_0 \sim U(S)) $$

Assuming independent and identically distributed (i.i.d.) random restarts, the probability of failing to reach the global optimum in $k$ consecutive restarts is $(1 - p)^k$. Consequently, the cumulative probability of finding the global optimum $P_{\text{success}}(k)$ after $k$ restarts is:

$$ \begin{alignat*}{4} && P_{\text{failure}}(k) &= (1 - p)^k && \text{Probability of missing global optimum in all } k \text{ runs} \\ && P_{\text{success}}(k) &= 1 - (1 - p)^k && \text{Complementary probability of at least 1 success} \\ \end{alignat*} $$

As $k \to \infty$, $P_{\text{success}}(k) \to 1$, guaranteeing asymptotic completeness provided $p &gt; 0$. The expected number of restarts $E[k]$ required to find the global optimum follows a Geometric distribution:

$$ E[k] = \dfrac{1}{p} $$

If $p$ is moderately high, Random-Restart Hill Climbing is remarkably effective, turning a simple greedy heuristic into a robust global optimizer.

3.2.2. First-Choice Hill Climbing

When the neighborhood size $|N(\overrightarrow{s})|$ is extremely large (e.g., high-dimensional continuous parameters or complex combinatorial assignments), evaluating all $m = |N(\overrightarrow{s})|$ neighbors at every step incurs prohibitive computational overhead $O(m)$.

First-Choice Hill Climbing optimizes per-iteration evaluation cost by sampling neighbors sequentially in random order. It immediately accepts and moves to the first generated neighbor $\overrightarrow{s}' \in N(\overrightarrow{s})$ that satisfies $h(\overrightarrow{s}') &lt; h(\overrightarrow{s})$ (for minimization), without evaluating the remainder of the neighborhood:

$$ \text{Accept } \overrightarrow{s}' \quad \text{iff} \quad \Delta h = h(\overrightarrow{s}') - h(\overrightarrow{s}) < 0 $$

This strategy reduces the average neighbor evaluation cost from $O(|N(\overrightarrow{s})|)$ to $O(1 / \text{density of improving moves})$, making it ideal for high-density landscape regions with large neighborhoods.

3.2.3. Stochastic Hill Climbing

Unlike standard steepest-ascent hill climbing (which deterministically picks the absolute best neighbor) or first-choice search (which takes the first improving neighbor), Stochastic Hill Climbing evaluates all improving neighbors $N^+(\overrightarrow{s}) = {\overrightarrow{s}' \in N(\overrightarrow{s}) \mid h(\overrightarrow{s}') &lt; h(\overrightarrow{s})}$ and selects one probabilistically.

The selection probability $P(\overrightarrow{s}')$ for an improving candidate $\overrightarrow{s}' \in N^+(\overrightarrow{s})$ is typically weighted proportional to the magnitude of its score improvement $\Delta h_{\text{imp}}(\overrightarrow{s}') = h(\overrightarrow{s}) - h(\overrightarrow{s}') &gt; 0$:

$$ P(\overrightarrow{s}') = \dfrac{\Delta h_{\text{imp}}(\overrightarrow{s}')}{\sum\limits_{\overrightarrow{u} \in N^+(\overrightarrow{s})} \Delta h_{\text{imp}}(\overrightarrow{u})} $$

By maintaining greedy bias toward steeper slopes while introducing selection randomness, Stochastic Hill Climbing avoids committing prematurely to a single local trajectory, improving performance on rugged terrains.

3.2.4. Sideways Moves (Flat Local Search)

To navigate plateaus and shoulders, Sideways Move Hill Climbing relaxes the strict improvement condition, permitting transitions to neighboring states with equal objective values ($\Delta h = 0$):

$$ \text{Accept } \overrightarrow{s}' \quad \text{if} \quad h(\overrightarrow{s}') \le h(\overrightarrow{s}) $$

3.2.4.1. Infinite Loop Prevention & Step Thresholding

If a plateau is a flat local maximum without any adjacent upward slopes, allowing unrestricted sideways moves causes the search to wander infinitely in an $O(\infty)$ loop.

To enforce algorithmic termination and convergence, a maximum allowable consecutive sideways step limit $M_{\text{max}}$ is established. The search increments a counter $m_{\text{sideways}}$ on each equal-cost transition ($\Delta h = 0$) and resets $m_{\text{sideways}} = 0$ whenever a strict improvement ($\Delta h &lt; 0$) is achieved:

$$ \text{Termination Condition: } m_{\text{sideways}} \ge M_{\text{max}} $$

In empirical benchmarks (e.g., 8-Queens), allowing up to $M_{\text{max}} = 100$ sideways moves increases the success rate of finding a global optimum from $\approx 14%$ (pure hill climbing) to over $94%$.

3.3. Overview of Advanced Local Search Frameworks

When local adjustments are insufficient, metaheuristic frameworks introduce advanced mechanisms such as population memory, temperature-guided stochastic acceptance, tabu memory, and parallel beam tracking.

3.3.1. Population-Based Search (Genetic Algorithms)

Rather than maintaining a single state vector $\overrightarrow{s}$, Population-Based Methods maintain a set of $K$ candidate configurations simultaneously, denoted as a population $P_t = {\overrightarrow{s}_1, \overrightarrow{s}_2, \dots, \overrightarrow{s}_K}$.

In Genetic Algorithms (GA), new candidate configurations are created by combining pieces of high-fitness parents through crossover (recombination) and applying random mutation:

  1. Selection: Parents are chosen from $P_t$ biased by fitness score $f(\overrightarrow{s})$.
  2. Crossover (Recombination): Sub-structures of two parent vectors $\overrightarrow{s}_A$ and $\overrightarrow{s}_B$ are spliced to form offspring $\overrightarrow{s}_{\text{child}}$.
  3. Mutation: Small random perturbations are applied to individual variables to maintain genetic diversity.

If one candidate branch becomes trapped in a local optimum, other population members across different landscape regions continue exploring, significantly improving overall global convergence.

3.3.2. Non-Greedy Escape Frameworks

Advanced single-state frameworks escape local optima by deliberately accepting non-improving or downhill moves under controlled conditions:

  • Simulated Annealing: Inspired by physical metallurgy, the algorithm accepts non-improving moves ($\Delta h &gt; 0$) probabilistically according to the Metropolis criterion:

    $$P(\text{accept downhill move}) = \exp\left( - \dfrac{\Delta h}{T_k} \right)$$

    where $T_k$ represents a system temperature parameter that monotonically decays over time according to a cooling schedule. At high initial temperatures $T_0$, the algorithm explores broadly; as $T_k \to 0$, it transitions into pure greedy hill climbing.

  • Tabu Search: Maintains a short-term memory structure (a Tabu List) recording recently visited states or operators, forbidding reversal moves to prevent cyclic looping on plateaus.

  • Local Beam Search: Maintains $k$ parallel search states. At each iteration, all neighbors of all $k$ states are generated, and the top $k$ overall performers across the joint pool are retained, sharing information across parallel search threads.

Clone this wiki locally