ArticleslgStudy

computer science

Local search (optimization)

Local search (optimization) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Local search (optimization) rather than just read about it. In short: In computer science, local search is a heuristic method for solving computationally hard optimization problems. Local search can be used on problems that can be formulated as finding a solution that maximizes a criterion among a number of candidate solutions.

Key takeaways

  • Local search (optimization) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Local search (optimization) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Local search (optimization) from memory before moving on to harder problems.

Reference excerpt

In computer science, local search is a heuristic method for solving computationally hard optimization problems. Local search can be used on problems that can be formulated as finding a solution that maximizes a criterion among a number of candidate solutions. Local search algorithms move from solution to solution in the space of candidate solutions (the search space) by applying local changes, until a solution deemed optimal is found or a time bound is elapsed. Local search algorithms are widely applied to numerous hard computational problems, including problems from computer science (particularly artificial intelligence), mathematics, operations research, engineering, and bioinformatics. Examples of local search algorithms are WalkSAT, the 2-opt algorithm for the traveling salesman problem and the Metropolis–Hastings algorithm. While it is sometimes possible to substitute gradient descent for a local search algorithm, gradient descent is not in the same family: although it is an iterative method for local optimization, it relies on an objective function’s gradient rather than an explicit exploration of the solution space.

Examples Some problems where local search has been applied are:

The vertex cover problem, in which a solution is a vertex cover of a graph, and the target is to find a solution with a minimal number of nodes The traveling salesman problem, in which a solution is a cycle containing all nodes of the graph and the target is to minimize the total length of the cycle The Boolean satisfiability problem, in which a candidate solution is a truth assignment, and the target is to maximize the number of clauses satisfied by the assignment; in this case, the final solution is of use only if it satisfies all clauses The nurse scheduling problem where a solution is an assignment of nurses to shifts which satisfies all established constraints The k-medoid clustering problem and other related facility location problems for which local search offers the best known approximation ratios from a worst-case perspective The Hopfield Neural Networks problem involves finding stable configurations in Hopfield network.

Description Most problems can be formulated in terms of a search space and target in several different ways. For example, for the traveling salesman problem a solution can be a route visiting all cities and the goal is to find the shortest route. But a solution can also be a path, and being a cycle is part of the target. A local search algorithm starts from a candidate solution and then iteratively moves to a neighboring solution; a neighborhood being the set of all potential solutions that differ from the current solution by the minimal possible extent. This requires a neighborhood relation to be defined on the search space. As an example, the neighborhood of vertex cover is another vertex cover only differing by one node. For Boolean satisfiability, the neighbors of a Boolean assignment are those that have a single variable in an opposite state. The same problem may have multiple distinct neighborhoods defined on it; local optimization with neighborhoods that involve changing up to k components of the solution is often referred to as k-opt. Typically, every candidate solution has more than one neighbor solution; the choice of which one to select is taken using only information about the solutions in the neighborhood of the current assignment, hence the name local search. When the choice of the neighbor solution is done by taking the one locally maximizing the criterion, i.e.: a greedy search, the metaheuristic takes the name hill climbing. When no improving neighbors are present, local search is stuck at a locally optimal point. This local-optima problem can be cured by using restarts (repeated local search with different initial conditions), randomization, or more complex schemes based on iterations, like iterated local search, on memory, like reactive search optimization, on memory-less stochastic modifications, like simulated annealing. Local search does not provide a guarantee that any given solution is optimal. The search can terminate after a given time bound or when the best solution found thus far has not improved in a given number of steps. Local search is an anytime algorithm; it can return a valid solution even if it's interrupted at any time after finding the first valid solution. Local search is typically an approximation or incomplete algorithm because the search may stop even if the current best solution found is not optimal. This can happen even if termination happens because the current best solution could not be improved, as the optimal solution can lie far from the neighborhood of the solutions crossed by the algorithm. Schuurman & Southey propose three measures of effectiveness for local search (depth, mobility, and coverage):

depth: the cost of the current (best) solution; mobility: the ability to rapidly move to different areas of the search space (whilst keeping the cost low); coverage: how systematically the search covers the search space, the maximum distance between any unexplored assignment and all visited assignments. They hypothesize that local search algorithms work well, not because they have some understanding of the search space but because they quickly move to promising regions, and explore the search space at low depths as quickly, broadly, and systematically as possible.

See also Local search is a sub-field of:

Metaheuristics Stochastic optimization Optimization Fields within local search include:

Hill climbing Simulated annealing (suited for either local or global search) Tabu search Late acceptance hill climbing Reactive search optimization (combining machine learning and local search heuristics)

Real-valued search-spaces Several methods exist for performing local search of real-valued search-spaces:

Luus–Jaakola searches locally using a uniform distribution and an exponentially decreasing search-range. Random optimization searches locally using a normal distribution. Random search searches locally by sampling a hypersphere surrounding the current position. Pattern search takes steps along the axes of the search-space using exponentially decreasing step sizes.

References

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Local search (optimization)

Start with the simplest possible case. Write down what Local search (optimization) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Local search (optimization) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Local search (optimization) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Local search (optimization)

In research
Local search (optimization) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Local search (optimization) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Local search (optimization) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Metaheuristics, Optimization algorithms and methods, so understanding it makes those chapters shorter.
In everyday life
Look for Local search (optimization) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Local search (optimization) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Local search (optimization) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Local search (optimization) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Local search (optimization) in simple terms?

In computer science, local search is a heuristic method for solving computationally hard optimization problems. Local search can be used on problems that can be formulated as finding a solution that maximizes a criterion among a number of candidate solutions.

Why does Local search (optimization) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Local search (optimization)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Local search (optimization).

Tags

  • Metaheuristics
  • Optimization algorithms and methods

Keep exploring