
Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Principles of Ar.ficial Intelligence Vasant Honavar Ar3ficial Intelligence Research Laboratory College of Informaon Sciences and Technology Bioinformacs and Genomics Graduate Program The Huck Ins3tutes of the Life Sciences Pennsylvania State University [email protected] hHp://vhonavar.ist.psu.edu hHp://faculty.ist.psu.edu/vhonavar Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Summary of uninformed (blind) search algorithms Criterion Breadth Depth- Iterative Bi- -First First deepening directional Complete? YES NO YES YES* Time bd+1 bm bd bd/2 Space bd+1 bm bd bd/2 Admissible? YES NO YES YES* Optimal? NO NO YES NO Assuming all arc costs are equal m – max depth of search d – depth of solu7on, b – finite branching factor * Assuming forward and backward search are BFS Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Finding an op3mal solu3on • All operator applicaons may not be equally expensive • Suppose we have a cost func3on c: S x O à ℜ+ • c (q,o,r) = cost of applying operator o in state q to reach state r • Path cost is typically assumed to be the sum of costs of operator applicaons along the path • An op3mal solu3on is one with the lowest cost path from the specified start state s to a goal g ∈ G Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Finding op3mal (minimum cost) solu3ons • Branch and bound search (BBS) with dynamic programming • Maintain a list of nodes sorted by cost g(n) of cheapest known par3al paths to the respec3ve nodes • Terminate when a node picked from the open list happens to be a goal node A 1 2 ((A,0)) B C ((AB, 1) (AC, 2) 3 8 1 3 D G E F ((AC, 2) (ABD, 4)(ABG,9)) 2 1 H I ((ACE, 3) (ABD, 4)(ACF, 5) (ABG,9)) ((ACEI, 4) (ABD, 4)(ACEH, 5)(ACF, 5) (ABG,9)) Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Finding op3mal solu3ons • Branch and bound search (BBS) with dynamic programming • Maintain a list of nodes sorted by cost g(n) of cheapest known par3al paths to the respec3ve nodes • Terminate when a node picked from the open list happens to be a goal node • Quesons: – Is BBS complete? • Yes – Is BBS admissible? • Yes – Under the assump3on that each arc cost is bounded from below by some posi3ve constant δ Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Informed search • Informed search uses problem-specific knowledge • Which search strategies? – Best-first search and its variants • Heuris3c func3ons – How to design them • Local search and op3mizaon – Hill climbing, local beam search, gene3c algorithms,… • Local search in con3nuous spaces • Online search agents Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory A heuris3c funcon • [dic3onary]“A rule of thumb, simplifica7on, or educated guess that reduces or limits the search for solu7ons in domains that are difficult and poorly understood.” Heuris3cs, those rules of thumb, Oaen scorned as sloppy, dumb, Yet slowly commonsense become! – Judea Pearl, in Heuris7cs Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Why we need heuris3cs • Combinatorial explosion • Uninformed search runs out of 3me, space, or both quickly • Solu3on – incorporate heuris3cs to guide search • Perfect heuris3c would guide search directly from start state to a goal state yielding the least expensive solu3on – No need to search! • In prac3ce, we have imperfect but useful heuris3cs • A heuris3c func3on h(n), roughly speaking, es3mates the cost of comple3ng a par3al path (s..n) to obtain a solu3on, i.e., a path (s..n…g) where g is a goal state Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Why we need heuris3cs • Combinatorial explosion • Uninformed search runs out of 3me, space, or both quickly • Perfect raonality unaffordable • Can we come up with a compromise? – Use a heuris3c func3on to guide choice of ac3ons • Suppose we could es3mate the cost of the cheapest solu3on obtainable by expanding each node that could be chosen + A h : S → ℜ ∀n∈ S, h(n)≥ 0 ∀g ∈G, h g = 0 s s ( ) 1 s2 3 h(s1 ) = 0.8 h(s2 ) = 2.0 h(s3 ) =1.6 Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory A heuris3c funcon In problems requiring the cheapest path from start state to a goal state – h(n) = es3mated cost of the cheapest path from node n to a goal node – h(g1)=h(g2)=0 s h(m) m n h(n) g2 g1 Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Hill-climbing search • Choose “locally best” moves, guided by the heuris3c func3on, with random choice to break 3es • Terminates when a goal state is reached • Does not look beyond the immediate successors of the current state in deciding which move to make • Essen3ally DFS, where at each step, successors are ordered by heuris3c evaluaon • a.k.a. greedy local search Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Heuris3c func3on - Example • E.g for the 8-puzzle – Avg. solu3on cost is about 22 steps – Exhaus3ve search to depth 22 ≈ 3.1 x 1010 states – A good heuris3c func3on can reduce search Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Heuris3c func3ons Two commonly used heuriscs • h1 = the number of misplaced 3les (not coun3ng blank) relave to the goal (why?) h1(s)=8 • h2 = the sum of the distances of the 3les (not coun3ng blank) from their desired posi3ons (Manhaan distance) (why?) h2(s)=3+1+2+2+2+3+3+2=18 Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Drawbacks of hill-climbing search • Ridge – sequence of local maxima difficult for greedy algorithms to navigate • Plateau – an area of the state space where the evaluaon func3on is flat Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Hill-climbing variaons • Stochas3c hill-climbing – Random selec3on among the uphill moves – The selec3on probability can vary with the steepness of the uphill move • First-choice hill-climbing – stochas3c hill climbing by generang successors randomly un3l a beHer one is found • Random-restart hill-climbing – Tries to avoid geng stuck in local maxima Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Best-first search • General approach to informed search: – Best-first search: node is selected for expansion based on an evalua7on funcon f(n) • Idea: evaluaon func3on measures es3mated cost of comple3ng the par3al solu3on (s..n) – Choose node which appears best • Implementaon: – Open-list is a queue sorted in decreasing order of desirability – Special cases: greedy search, A* search Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Examples of Best-first search • Best first search – List of par3al paths is ordered by h values of the nodes • A* search – BBS-like search with dynamic programming – Open list nodes ordered by f (n)= g(n)+ h(n) Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory A* search f (n)= g(n)+ h(n) g(n) =2 g(m)=3 s 3 2 4 h(m)=6 3 h(n)=8 n 6 m 5 8 g2 g1 Principles of Artificial Intelligence, IST 597F, Fall 2014, (C) Vasant Honavar Pennsylvania State University College of Information Sciences and Technology Artificial Intelligence Research Laboratory Romania with step costs in km • hSLD= straight-line distance heurisc. • hSLD cannot be computed from
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages39 Page
-
File Size-