1
Advanced Search
Iterative Methods(search plane for optima)
Constructive Methods (search tree for goals)
組合最佳化問題 基於既定的限制 or 給分條件(Combinatorial Optimization Problems)
可用傳統方法拓展樹形穩紮穩打 , 謀定而後動 也可用鄰近解漸近搜尋以戰養戰 , 先求有再求好
3
Contents
-- The eight queens problem Constraint satisfaction
problems Combinatorial optimization
problems (problem) Heuristic repair (example) Local search and Meta-
heuristics (method) Exchanging heuristics Iterated local search (Ant Colony Optimization) Taboo Search Simulated annealing Genetic algorithms
Real time A* Iterative deepening A* Parallel search Bidirectional search Nondeterministic search Nonchronological
backtrackingIterative Methods(search plane for optima)
Constructive Methods (search tree for goals)
4
Search Methods
由這兩個例子來看這些 methods
Search for Goals(8-Queens/conflict=0)
Search for Optima(TSP/ lowest cost)
Constraint Satisfaction forward checking (Dead Ends?)
Heuristic (which branch first?)
Local Search (metaheuristics)
Iterative Methods(search plane for optima)
Constructive Methods (search tree for goals)
search space
search tree search plane = untraceable branches
DFS (64 x 63 x…) DFS (n x (n-1) x…)
Most-Constrained Variables A* Algorithm
Heuristic Repair k-opt exchanging
General Metaheuristics Exchanging heuristics Iterated local search (Ant Colony Optimization) Taboo Search Simulated annealing Genetic algorithms
8! ∞
5
TSP using A* A B C D E
A 4 8 9 5B 4 3 5 1C 8 3 6 7D 9 5 6 2E 5 1 7 2
A
C1B1
A
E1D1
C2 E2D2
h(B1)=min(B-CDE)+ min(CDE-A)+min(C-D,D-E,E-C)|2
=1+5+(2+6)=14
h(C2)=min(C-DE)+ min(DE-A)+
min(D-E)|1=6+5+(2)=13
4 8 9 5
4+148+10 9+10 5+13
3 5 1
7+13
FYR
6
Search Methods
由這兩個例子來看這些 methods
Search for Goals(8-Queens/conflict=0)
Search for Optima(TSP/ lowest cost)
Constraint Satisfaction forward checking (Dead Ends?)
Heuristic (which branch first?)
Local Search (metaheuristics)
Iterative Methods(search plane for optima)
Constructive Methods (search tree for goals)
search space
search tree search plane = untraceable branches
DFS (64 x 63 x…) DFS (n x (n-1) x…)
Most-Constrained Variables A* Algorithm
Heuristic Repair k-opt exchanging
General Metaheuristics Exchanging heuristics Iterated local search (Ant Colony Optimization) Taboo Search Simulated annealing Genetic algorithms
8! ∞
Beam Search Beam Search + heuristics : #(group)
Dead end 提早發現or
8
Constraint Satisfaction Problems A constraint satisfaction problem is a
combinatorial optimization problem with a set of constraints.
Combinatorial optimization problems involve assigning values to a number of variables.
Can be solved using search. With many variables it is essential to use
heuristics.
9
The Eight Queens Problem A constraint satisfaction problem:
Place eight queens on a chess board so that no two queens are on the same row, column or diagonal.
Can be solved by search, but the search tree is large.
Heuristic repair is very efficient at solving this problem.
11
Search Methods
由這兩個例子來看這些 methods
Search for Goals(8-Queens/conflict=0)
Search for Optima(TSP/ lowest cost)
Local Search (metaheuristics)
Iterative Methods(search plane for optima)
Constructive Methods (search tree for goals)
search space
search tree search plane = untraceable branches
DFS (64 x 63 x…) DFS (n x (n-1) x…)
Most-Constrained Variables A* Algorithm
Recall:
Heuristic Repair k-opt exchanging
General Metaheuristics Exchanging heuristics Iterated local search (Ant Colony Optimization) Taboo Search Simulated annealing Genetic algorithms
Constraint Satisfaction forward checking (Dead Ends?)
Heuristic (which branch first?)
12
Heuristic Repair A heuristic method for solving
constraint satisfaction problems. Generate a possible solution, and
then make small changes to bring it closer to satisfying constraints.
13
Heuristic Repair for The Eight Queens Problem
Initial state – one queen is conflicting with another.
We’ll now move that queen to the square with the fewest conflicts.
14
Heuristic Repair for The Eight Queens Problem
Second state – now the queen on the f column is conflicting, so we’ll move it to the square with fewest conflicts.
17
Search Methods
由這兩個例子來看這些 methods
Search for Goals(8-Queens/conflict=0)
Search for Optima(TSP/ lowest cost)
Local Search (metaheuristics)
Iterative Methods(search plane for optima)
Constructive Methods (search tree for goals)
search space
search tree search plane = untraceable branches
DFS (64 x 63 x…) DFS (n x (n-1) x…)
Most-Constrained Variables A* Algorithm
Recall:
Heuristic Repair k-opt exchanging
General Metaheuristics Exchanging heuristics Iterated local search (Ant Colony Optimization) Taboo Search Simulated annealing Genetic algorithms
Constraint Satisfaction forward checking (Dead Ends?)
Heuristic (which branch first?)
18
Local Search Like heuristic repair, local search methods
start from a random state, and make small changes until a goal state is achieved.
Local search methods are known as metaheuristics.
Most local search methods are susceptible to local maxima, like hill-climbing.
19
Foothills A foothill is a local maximum.
3 issues
8-queensTSPE(w1,w2)
主翼長 w1 、尾翼寛 w2投射 {X}100 與落點 {Y}100 要求
20
Plateaus Cause difficulties for hill-climbing methods. Flat areas that make it hard to find where to
go next.
沒有方向可走要看遠一點
3 issues
21
Ridges Cause difficulties for hill-climbing methods B is higher than A.
At C, the hill-climber can’t find a higher point North, South, East or West, so it stops.
有方向可走但是窄到看不到要看廣一點
3 issues
22
Exchanging Heuristics A simple local search method. Heuristic repair is an example of an
exchanging heuristic. Involves swapping two or more variables
at each step until a solution is found. A k-exchange involves swapping the
values of k variables. Can be used to solve the traveling
salesman problem.
23
Iterated Local Search A local search is applied repeatedly from
different starting states. Attempts to avoid finding local maxima. Useful in cases where the search space is
extremely large, and exhaustive search will not be possible.
24
Taboo Search (Tabu Search) 避開禁忌區域 TSP – 某些 2-opt 會收歛過去的臨近狀態 (w1, w2) – 某些臨近值
Ant Colony Optimization Artificial Life TSP – 越快走一遍的軌跡越密 ( 要符合 TSP 限制 )
25
Simulated Annealing A method based on the way in which metal is
heated and then cooled very slowly in order to make it extremely strong.
Based on metropolis Monte Carlo Simulation. Aims at obtaining a minimum value for some
function of a large number of variables. This value is known as the energy of the system.
TSP: 先大亂掉,再小亂,最後收斂
26
Genetic Algorithms A method based on biological evolution. Create chromosomes which represent possible
solutions to a problem. The best chromosomes in each generation are
bred with each other to produce a new generation. Much more detail on this later.
詳附錄
27
What is Artificial Intelligence? A more difficult question is: What is intelligence? This question has puzzled philosophers,
biologists and psychologists for centuries. Artificial Intelligence is easier to define, although
there is no standard, accepted definition.
評判 搜尋解答 邏輯推理記憶 控制 學習 創作weak sub? strong
Fuzzy,NN,GA
In my opinion:
星艦戰將與蝸蟲的學習
Recall:
學習與創作是否是另一種形式的搜尋 ?
29
Contents
-- The eight queens problem Constraint satisfaction
problems Combinatorial optimization
problems (problem) Heuristic repair (example) Local search and Meta-
heuristics (method) Exchanging heuristics Iterated local search (Ant Colony Optimization) Taboo Search Simulated annealing Genetic algorithms
Real time A* Iterative deepening A* Parallel search Bidirectional search Nondeterministic search Nonchronological
backtrackingIterative Methods(search plane for optima)
Constructive Methods (search tree for goals)
30
Outline Problem Solving
Data-Driven (forward-chaining) Goal-Driven (back-chaining)
Brute-Force Search (exhaustive Search) Maze, Proof
Blind Search (Generate & Test) Heuristic Search (Informed Method)
DFS BFS Iterative Deepening Search Hill Climbing Best-first S. A* family
A* Alg.
Uniform Cost Search (Branch and Bound, Dijkstra)
Greedy Search
British Museum Procedure(identifying the optimal path)
Not always complete
e.g.
Beam Search
Evaluation function
Recall:
31
Outline Problem Solving
Data-Driven (forward-chaining) Goal-Driven (back-chaining)
Brute-Force Search (exhaustive Search) Maze, Proof
Blind Search (Generate & Test) Heuristic Search (Informed Method)
DFS BFS Iterative Deepening Search Hill Climbing Best-first S. A* family
A* Alg.
Uniform Cost Search (Branch and Bound, Dijkstra)
Greedy Search
e.g.
Beam Search
Real time A*, Iterative deepening A* Parallel search Bidirectional search Island-Driven Search Nondeterministic search Nonchronological backtracking
32
Iterative Deepening A* A* is applied iteratively, with incrementally
increasing limits on f(n). Works well if there are only a few possible
values for f(n). The method is complete, and has a low
memory requirement, like depth-first search. 結合 A* 與 Beam Search Methods補看更多 branches 看能否得解或得更好的解。
See also: Real-time A* --不再謀定而後動,設定時間參數,時限到,就走到目前預估的最佳中途點,改為起點,再重來。
33
Parallel Search Some search methods can be easily
split into tasks which can be solved in parallel.
Important concepts to consider are: Task distribution Load balancing Tree ordering
同時 pop N 個 nodes 出來展開宣告 OpenTmp, CloseTmp被取代者終止該分支放回 Open沒被取代的分支 抄到 Open/Close
更正:只要善用 lock 即可
34
Bidirectional Search Also known as wave search. Useful when the start and goal are both known. Starts two parallel searches – one from the root
node and the other from the goal node. Paths are expanded in a breadth-first fashion from
both points. Where the paths first meet, a complete and
optimal path has been formed.
See also: Island-Driven Search (c.f. And-or tree, i.e., goal tree)
從頭 ( 起點 ) 從尾 ( 終點 ) 兩端互找,e.g. 1 – 智慧拼盤 OPEN(CLOSE) 共同點e.g. 2 – 迷宮中留下如何到達此點的記錄Note: 目前的作法不能保證為最佳解
35
Nondeterministic Search Useful when very little is known about the
search space. Combines the depth first and breadth first
approaches randomly. Avoids the problems of both, but does not
necessarily have the advantages of either. New paths are added to the queue in
random positions, meaning the method will follow a random route through the tree until a solution is found. 亂跳式搜尋 (DFS x BFS )
在 OPEN list 隨機放前放後,也可直接以樹形搜尋,在葉節點上隨機展開。 早期的變化方法 ( 無 hueristics)可避免 DFS 與 BFS 各自的風險
36
Nonchronological backtracking Depth first search uses chronological
backtracking. Does not use any additional information to make the
backtracking more efficient. Nonchronological backtracking involves going
back to forks in the tree that are more likely to offer a successful solution, rather than simply going back to the next unexplored path.
回溯到“直系”親代任一點,該點提供最好的“旁系”路徑分支,此法可以不搭配 Open list 板凳,直接以樹形回溯 早期的變化方法 ( 有 hueristics)
37
Search Methods
由這兩個例子來看這些 methods
Search for Goals(8-Queens/conflict=0)
Search for Optima(TSP/ lowest cost)
Local Search (metaheuristics)
Iterative Methods(search plane for optima)
Constructive Methods (search tree for goals)
search space
search tree search plane = untraceable branches
DFS (64 x 63 x…) DFS (n x (n-1) x…)
Most-Constrained Variables A* Algorithm
Heuristic Repair k-opt exchanging
General Metaheuristics Exchanging heuristics Iterated local search (Ant Colony Optimization) Taboo Search Simulated annealing Genetic algorithms
Recall:
Constraint Satisfaction forward checking (Dead Ends?)
Heuristic (which branch first?)