Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dept. Computer Science, Korea Univ. Intelligent Information System Lab A I (Artificial Intelligence) Professor I. J. Chung.

Similar presentations


Presentation on theme: "Dept. Computer Science, Korea Univ. Intelligent Information System Lab A I (Artificial Intelligence) Professor I. J. Chung."— Presentation transcript:

1 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-221 A I (Artificial Intelligence) Professor I. J. Chung

2 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence2 AI (Artificial Intelligence) Heuristic function Estimate of distance of a path from the given node to the goal node. Nearest neighbor heuristic Select the locally superior alternative at each step n! → n 2 : number of different paths among the n cities=(n-1)! ① Select a starting city ② To select the next city. Check the all cities not yet visited, and select the one close-set to the current city. Go to it next ③ Repeat ② until all cities have been visited.

3 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence3 AI (Artificial Intelligence) AND/OR Graph Problem decomposition : problem reduction HTP (Hanoi Tower Problem) Split the original problem into sub-problems until the original problem is reduced to a set of trivial primitive problems.

4 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence4 AI (Artificial Intelligence) AND/OR graph : structure to model the problem reduction

5 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence5 AI (Artificial Intelligence) Objective of problem reduction Produce eventually primitive problems whose solutions are obvious. To solve the problem A, we have 3 alternative paths : (B&C) or (D&E) or (F)

6 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence6 AI (Artificial Intelligence) e.g

7 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence7 AI (Artificial Intelligence) AND/OR graph with problem reduction Objective of problem reduction Produce eventually primitive problem whose solutions are obvious

8 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence8 AI (Artificial Intelligence) AND/OR graph Structure modeling of the problem reduction One of the nodes in the graph, called the s.n., corresponding to the original problem Those nodes in the graph corresponding to the primitive description Algorithm of AND/OR graph shows that the structure node is solved

9 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence9 AI (Artificial Intelligence) The nonterminal node which has no successors in an AND/OR graph: unsolvable node If a nonterminal has OR successor, it ’ s unsolvable if and only if all of its successors are unsolvable. If a nonterminal has AND successor, it ’ s unsolvable if and only if at least one of its successors is unsolvable. e.g. : AND/OR graph & problem reduction

10 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence10 AI (Artificial Intelligence) Algorithm for Heuristic Search Best First Search Simplest way to implement heuristic search : hill climbing H/C : expand the current node & evaluate its children. : the best child is selected for further expansion. : neither its siblings nor its parent are retained. : search halts when it reaches a state that is better than any of its children. : 1) erroneous heuristic -> ∞ paths that fail ( ∵ it keeps no history,  recovery) 2) local minima Combination of DFS and BFS (follow a single path at a time with switching paths whenever some alternative path looks more promising than the current one.)

11 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence11 AI (Artificial Intelligence) algorithm 1)OPEN ← {initial state} 2)Until (a goal is found |OPEN = ) 2.1) pick a best node E in OPEN 2.2) generate the children & E 2.3) for ∀ children do : a)if it is the first node never generated before, add it to OPEN and record its parent. b)if it has been generated before, change the parent if this new path is better than the previous one

12 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence12 AI (Artificial Intelligence) Evaluation function f(n) = g(n) + h(n) g(n) : length of the path from the initial state to the state(node) n. h(n) : heuristic estimate of the distance from state n to a goal.

13 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence13 AI (Artificial Intelligence) A * -algorithm. A search algorithm is admissible if it ’ s guaranteed to find a optimal path whenever such a path exist . e.g BFS: admissible search strategy. (but too inefficient) f(n) = g(n) + h(n) f : evaluation function g : cost of node n from the initial state h : heuristic estimate of the cost from n to goal If this evaluation function f is used with the best first search, the result is called algorithm A. ^ ^ f = g + h ^ : estimator actual cost

14 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence14 AI (Artificial Intelligence) algorithm A * If algorithm A is used with an evaluation function where h(n) ≤ cost of the minimal path from n to the goal. Note : 1)BFS is A * algorithm. Where f(n) = g(n) + O ie. h(n) = O. 2)set of nodes in A * ⊆ states examined in BFS. 3)if g=h=O ; random search For 2 A * algorithm h 1 & h 2 if h 1 (n) ≤ h 2 (n) for n ∈ S.S. heuristic h 2 is more informed than h 1

15 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence15 AI (Artificial Intelligence) Best First Search Combination of DFS & BFS. DFS : without all competing branches having to be expanded BFS : no dead-end path Follow a path at a time, but switch paths whenever some competing path looks more promising than the current one. e.g step 1 step2 A A B C D 3 5 1

16 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence16 AI (Artificial Intelligence) e.g step 3 step4 A A B C D B C D Step 5 3 5 5 A E F G H E F 4 6 6 5 4 6 B C D 5 G H E F 6 5 6 I J 2 1

17 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence17 AI (Artificial Intelligence) BFS algorithm. 1)OPEN ← {initial state} 2)loop until (goal state is formed or OPEN == ) 2.1) Select the most promising node from OPEN 2.2) Generate its successors 2.3) for ∀ success s do: 2.3.1) If s has not been generated before, add to OPEN ← OPEN ∪ {s}, and record its parent. 2.3.2) If s has been generated before, change the parent if this new path is more promising than before. Best FS : special case of A * algorithm

18 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence18 AI (Artificial Intelligence) Game playing (search 의 연장 ) Chess, go, TTT, … Structured task to measure Success / Failure Not necessary for large amount of knowledge

19 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence19 AI (Artificial Intelligence) Maxmin search Depth – first /depth – limited search procedure Start at the current position → apply the plausible – move generator one goal : max. the value of E.F. opponent goal : min the value of E.F. One path is explored as far as time allows The static evaluation function is applied to the game position at the last step of the path, and the value be passed up the path.

20 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence20 AI (Artificial Intelligence) A -2 max -6 B C -2 D -4 min E F G H I J K 9 -6 0 0 -2 -4 -3

21 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence21 AI (Artificial Intelligence) / pruning Partial solution can be abandoned early. : lower bound on max. node : upper bound on min. node A 3 (>3) max 3 B C -5 (<-5) min D E F G max 3 5 – 5 G 의 값에 관계없이 C 노드의 e.f. 의 값은 – 5 따라서 we don ’ t have to generate the node G.

22 Dept. Computer Science, Korea Univ. Intelligent Information System Lab. 2016-11-22Artificial Intelligence22 AI (Artificial Intelligence) A >3 max 3 B C 4 min 3 D 5 E F 5 G 8 H 4 max 0 I J M N min 5 7 8 K L max 0 7


Download ppt "Dept. Computer Science, Korea Univ. Intelligent Information System Lab A I (Artificial Intelligence) Professor I. J. Chung."

Similar presentations


Ads by Google