# Local Search vs Classical Search

I have some questions regarding local search / optimization as explained in chapter 4 of the book : http://aima.cs.berkeley.edu/

In classical search (Chap 3), the search starts from an initial node, then the search continues based on strategies of BFS, DFS, etc. What I am unsure of is the process of local search (Chap 4).

1. Does the local search algorithm start from one node in state space? Check if constraints are satisfied? If Yes, this is goal? If not, move to neighbours?

2. Is the entire state space considered goal state? Even nodes that don't satisfy the constraints?

3. In optimization, the search is conducted in a part of search space where all constraints are met, but tries to find a better solution. In that case, what if the search algorithm moves to nodes where they don't satisfy the constraints?

Classical local search works as follows. We're trying to optimize some function under some constraints. We start with some feasible point (a point satisfying all constraints). At each step, we consider small changes to the current point which (1) keep it feasible, (2) improve the objective function. If we find such a small change, we modify the point accordingly. Eventually, we reach a local optimum, and we hope that it's not too bad relative to the global optimum.

A classical example is the simplex algorithm for linear programming. The algorithm starts with some feasible point (it's not immediately obvious how to do it; a trick is required). At each step, we try to modify the point by switching one tight constraint with another in a way that improves the objective function while keeping the point feasible. Eventually we reach a local optimum, which turns out to be a global optimum (in this particular case).

The interior-point algorithm for linear programming work differently. They start at some point, and move in a direction that (1) makes the point more feasible, and (2) improves the objective function. In the end, you get close to a feasible local optimum, which turns out to be a global optimum. This is not local search, but it's an example of an algorithm which does not maintain a feasible solution.

Non-oblivious local search is a variant on the theme of local search, in which instead of trying to optimize the actual objective function, you direct the local search using an auxiliary objective function. Sometimes this improves the quality of the local optimum. You can read all about it in a recent PhD thesis by Justin Ward.

• Thanks for the detailed reply. You mentioned that we are trying to optimize, so we start from some point satisfying all constraint. But in 8-queens, we start from a position that does not satisfy the constraint, and we want to apply local search to get there. could you explain? – Martin H. L. Mar 15 '13 at 13:24
• 8-queens is not an optimization problem, and you're not using local search. Rather, you're using the technique of backtracking. – Yuval Filmus Mar 15 '13 at 13:57
• I see ... I am confused since in chapter 4 of the book, they describe using hill cilmbing (page 122) and genetic algorithm (page 127). Are they local search alg? – Martin H. L. Mar 15 '13 at 21:19
• Hill climbing is gradient ascent, which is the continuous version of local search. Genetic algorithms are really their own thing, though similar in some aspects to local search. – Yuval Filmus Mar 15 '13 at 21:27
• I see, thanks. So in cases of Hill Climbing and Genetic algorithms, is the state space considered the goal state? Do we try find solution to 8-queen by moving to next states? – Martin H. L. Mar 16 '13 at 1:12

Does the local search algorithm start from one node in state space? Check if constraints are satisfied? If Yes, this is goal? If not, move to neighbours?

A local search would typically start from an arbitrary solution. For example in the case of SAT, each variable could be assigned either a 0 or a 1 with independent equal 1/2 probability. What you describe next is not related to what you start with. But yes, you could then follow a general strategy of checking whether or not you have a feasible solution, and perhaps move on to the neighboring states following some strategy.

Is the entire state space considered goal state? Even nodes that don't satisfy the constraints?

A goal state is a state which satisfies your constraints. For example in the case of 8-queens, a goal state would be any placement of the queens so that they don't attack each other. All other states are not goal states.

In optimization, the search is conducted in a part of search space where all constraints are met, but tries to find a better solution. In that case, what if the search algorithm moves to nodes where they don't satisfy the constraints?

In general, it would be more accurate to say that the search is conducted in the whole search space, which includes all possible states. The rest of your question depends totally on the search method used. For example, you could try to greedily improve on the solution found so far. If you then encounter a solution that is not better anymore, or as you say not even a valid solution, you would return the last known best solution.