For some problems the state description contains all of the information relevant for a solution. Path to the solution is unimportant.
Examples:
Start with a state configuration that violates some of the constraints for being a solution, and make gradual modifications to eliminate the violations.
One way to visualize iterative improvement algorithms is to imagine every possible state laid out on a landscape with the height of each state corresponding to its goodness. Optimal solutions will appear as the highest points. Iterative improvement works by moving around on the landscape seeking out the peaks by looking only at the local vicinity.
Algorithm:
No search tree is maintained, only the current state.
Similar to Greedy search, but only states directly reachable from the current state are considered.
Problems:
Shape of state space landscape strongly influences the success of the search process. A very spiky surface which is flat in between the spikes will be very difficult to solve.
Can be combined with nondeterministic search to recover from local maxima.
Random-restart hill-climbing is a variant in which reaching a local maximum causes the current state to be saved and the search restarted from a random point. After several restarts, return the best state found. With enough restarts, this method will find the optimal solution.
Gradient descent is an inverted version of hill-climbing in which better states are represented by lower cost values. Local minima cause problems instead of local maxima.
Instead of restarting from a random point, we can allow the search to take some downhill steps to try to escape local maxima.
Probability of downward steps is controlled by temperature parameter.
High temperature implies high chance of trying locally "bad" moves, allowing nondeterministic exploration.
Low temperature makes search more deterministic (like hill-climbing).
Temperature begins high and gradually decreases according to a predetermined annealing schedule.
Initially we are willing to try out lots of possible paths, but over time we gradually settle in on the most promising path.
If temperature is lowered slowly enough, an optimal solution will be found.
In practice, this schedule is often too slow and we have to accept suboptimal solutions.
Algorithm:
set current to start state for time = 1 to infinity { set Temperature to annealing_schedule[time] if Temperature = 0 { return current } randomly pick a next state from successors of current set ΔE to eval(next) - eval(current) if ΔE > 0 { set current to next } else { set current to next with probability eΔE/Temperature } } |
Probability of moving downhill for negative ΔE values at different temperature ranges: