Unit2d Local Search
Unit2d Local Search
• Unlike global search methods that explore the entire solution space,
local search algorithms focus on making incremental changes to
improve a current solution until they reach a locally optimal or
satisfactory solution.
• Advantages: Use very little memory and they can find reasonable
solutions in large state spaces.
• Considering the state space landscape, there is location information
(state) and elevation (value of heuristic function or objective function)
• If elevation corresponds to cost, then the aim is to find the lowest
valley—a global minimum; if elevation corresponds to an objective
function, then the aim is to find the highest peak—a global maximum.
• A complete local search algorithm always finds a goal if one exists; an
optimal algorithm always finds a global minimum/maximum.
Working
• Initialization: Start with an initial solution, which can be generated
randomly or through some heuristic method.
• Evaluation: Evaluate the quality of the initial solution using an
objective function or a fitness measure. This function quantifies how
close the solution is to the desired outcome.
• Neighbor Generation: Generate a set of neighboring solutions by
making minor changes to the current solution. These changes are
typically referred to as "moves."
• Selection: Choose one of the neighboring solutions based on a
criterion. This step determines the direction in which the search
proceeds.
• Termination: Continue the process iteratively, moving to the selected
neighboring solution, and repeating steps 2 to 4 until a termination
condition is met.
Hill climbing
• Its primary goal is to find the best solution within a given search space
by iteratively improving the current solution.
• Terminates when it reaches a peak
Initialization: Begin with an initial solution, often generated randomly
or using a heuristic method.
Evaluation: Calculate the quality of the initial solution using an
objective function or fitness measure.
Neighbor Generation: Generate neighboring solutions by making
small changes (moves) to the current solution.
Selection: Choose the neighboring solution that results in the most
significant improvement in the objective function.
Termination: Continue this process until a termination condition is
met
Features of hill climbing
• Generate and Test Approach: This feature involves generating
neighboring solutions and evaluating their effectiveness, always aiming
for an upward move in the solution space.
• Greedy Local Search: The algorithm uses a cheap strategy, opting for
immediate beneficial moves that promise local improvements.
Ridge: Occurs when there are multiple peaks having the same value.
Multiple local maxima same as the global maxima exist
This algorithm does not look at all neighbors to check if its better than
the current node, instead it randomly selects one neighboring node and
based on a pre-defined criteria it decides whether to go to the
neighboring node or select an alternate node.
Applications of hill climbing
Hill Climbing technique can be used to solve many problems, where the
current state allows for an accurate evaluation function, such as
Network-Flow, Travelling Salesman problem, 8-Queens problem,
Integrated Circuit design, Job scheduling, Game theory etc.
Simulated Annealing
• A probabilistic local search algorithm inspired by the annealing process
in metallurgy.
• It allows the algorithm to accept worse solutions with a certain
probability, which decreases over time. This randomness introduces
exploration into the search process, helping the algorithm escape local
optima and potentially find global optima.