Documente Academic
Documente Profesional
Documente Cultură
Instructors:
Overview
Uninformed search:
Assumes no knowledge about the problem. BFS, DFS, Iterative deepening
Informed search:
Use knowledge about the problem, in the form of a heuristic. Best-first search, heuristic search, A* (and extensions)
Today!
Joelle Pineau
Optimization problems
Typically characterized by: Large (continuous, combinatorial) state space. Searching all possible solutions is infeasible. A (non-uniform) cost function, which we want to optimize. We are satisfied to achieve a good solution. In some cases, constraints have to be satisfied.
Mathematical optimization is a field of its own. Here, we focus on those problems which arise most frequently in AI.
COMP-424: Artificial intelligence 3 Joelle Pineau
Example 1
Traveling salesman problem:
Often easy to find some solution to the problem. Often provably very hard (NP-complete) to find the best solution. But we still want a good solution!
Joelle Pineau
Example 2
Robot arm control:
Joelle Pineau
Example
Stochastic optimization of robotic tissue manipulation:
http://www.youtube.com/watch?v=yFbUvmsNXX4
Joelle Pineau
Iterative improvement/repair methods: Start with a solution (which may be broken / suboptimal) and improve it.
In TSP: start with a complete tour and keep swapping cities to improve cost.
Joelle Pineau
But: Cost in A* depends on final solution (i.e. path cost), not on how we got it (i.e. search cost). For many optimization problems, the cost of finding a solution is non-trivial (i.e. exorbitant!)
Joelle Pineau
Joelle Pineau
Different algorithms have different ways of generating successors and choosing among them.
COMP-424: Artificial intelligence 10 Joelle Pineau
11
Joelle Pineau
12
Joelle Pineau
Hill climbing
Algorithm: 1. Start at initial configuration S. 2. Let V be the value of S (high is good) . 3. Let Si, i=1 .. n be the set of neighboring configurations and Vi be the corresponding values. 4. Let Vmax = maxi Vi be the value of the best successor configuration and imax = argmaxi Vi be the index of the best configuration. 5. If Vmax V, return S (we are at a local optimum). 6. Let S Simax and V Vmax. Go to 3. What are the pros and cons of this algorithm?
COMP-424: Artificial intelligence 13 Joelle Pineau
14
Joelle Pineau
Relies heavily on having a good evaluation (i.e. one with an easy-tonavigate landscape).
Russell and Norvig: Resembles climbing Mount Everest in thick fog with amnesia.
COMP-424: Artificial intelligence 15 Joelle Pineau
Better fix: Instead of picking the next best move, pick any move that produces an improvement.
16
Joelle Pineau
Simulated annealing
Similar to hill climbing, but: allows some bad moves in the hope of escaping local maxima. decrease size and frequency of bad moves over time. Algorithm: 1. Start at initial configuration S. 2. Let V be the value of S (high is good). 3. Let i be a random move and Si the next configuration. 4. Let Vi be the value of Si. 5. If V < Vi then set S Si and V Vi . Else with some probability p, still accept the move: S Si and V Vi 6. Go to 3 (as long as you want.)
COMP-424: Artificial intelligence 17 Joelle Pineau
18
Joelle Pineau
19
Joelle Pineau
If T is decreased slowly enough, simulated annealing is guaranteed to reach the optimal solution.
20
Joelle Pineau
Parallel search
Run many separate searches (hill-climbing or simulated annealing) in parallel. Keep the best solution found. Search speed can be greatly improved by using many processors (including, most recently, GPUs). Especially useful when actions have non-deterministic outcomes (more on this later).
Also known as Monte Carlo search.
21
Joelle Pineau
Evolutionary computing
Refers generally to computational procedures patterned after biological evolution. Nature looks for the best individual (i.e. the fittest). Many solutions (individuals) exist in parallel. Evolutionary search procedures are also parallel, perturbing probabilistically several potential solutions.
22
Joelle Pineau
Genetic algorithms
A candidate solution is called an individual.
In a traveling salesman problem, an individual is a tour
A set of individuals is called a population. Populations change over generations, by applying operations to individuals.
operations = {selection, mutation and crossover}
23
Joelle Pineau
Elitism
The best solution can "die" during evolution In order to prevent this, the best solution ever encountered can always be "preserved" on the side If the "genes" from the best solution should always be present in the population, it can also be copied in the next generation automatically, bypassing the selection process.
25
Joelle Pineau
Tournament selection:
Pick i, j at random with uniform probability. With probability p select the fitter one. Only requires comparing two individuals.
Rank selection:
Sort all hypothesis by fitness. Probability of selection is proportional to rank.
26
Joelle Pineau
Crossover
Combine parts of individuals to create new individuals. Single-point crossover:
Choose a crossover point, cut individuals there, swap the pieces. E.g. 101|0101 011|1110 101|1110 011|0101
Implementation:
Use a crossover mask, m, which is a binary string E.g. m = 1110000
27
Joelle Pineau
Mutation
Mutation is a way of generating desirable features that are not present in the original population. Typically mutation just means changing a 0 to a 1 (and vice versa). We can allow mutation in all individuals, or just in the offspring generated after crossover.
28
Joelle Pineau
29
Joelle Pineau
30
Joelle Pineau
Example
Genetic algorithms for the multiple traveling salesman problem:
http://www.youtube.com/watch?v=OC7URrCbceA
31
Joelle Pineau
Summary
Optimization problems are widespread and important. It is unfeasible to enumerate lots of solutions. Goal is to get a reasonable (not necessarily optimal) solution. Apply a local search and move in a promising direction.
Hill climbing (a.k.a. gradient ascent/descent) always moves in the (locally) best direction. Simulated annealing allows some moves towards worse solutions. Genetic algorithms allow a parallel search in all directions.
Search for optimization is a large field, with many variants on the algorithms described today.
32
Joelle Pineau
Notes
Textbooks have been ordered, and will be in the bookstore in 2 weeks. Homework 1 will be published on Wednesday, due 1 week later. Any questions?
33
Joelle Pineau