# Lecture04 - CS440/ECE448 Intro to Articial Intelligence...

This preview shows pages 1–14. Sign up to view the full content.

Lecture 4: Heuristic search and local search Prof. Julia Hockenmaier [email protected] http://cs.illinois.edu/fa11/cs440 CS440/ECE448: Intro to Artificial Intelligence

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Tuesday ʼ s key concepts Problem solving as search: Solution = a finite sequence of actions State graphs and search trees Which one is bigger/better to search? Systematic (blind) search algorithms Breadth-first vs. depth-first; properties? 2 CS440/ECE448: Intro AI
Blind search: deterministic queuing functions Depth-first search (LIFO) Expand deepest node first QF(old, new): Append(new, old) Breadth-first (FIFO) Expand nodes level by level QF(old, new): Append(old, new); A B C D G H J I F E A B C D G H J I F E

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Graph search R R R R R R R R R R R Initial state a2 a1 a3 Explored set Frontier (Queue) Unexplored set R …. Goal state R Goal state …. R Goal state …. b3 c5 b4 b1 b2
Today ʼ s key questions How can we find the optimal solution? We need to assign values to solutions How can we find a better solution if we can only foresee the effect (=value) of the next action? This is local search. 5 CS440/ECE448: Intro AI

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Informed (heuristic) search
Considering the cost of solutions We may not just want to find any solution, but the cheapest solution , if: Each action has a (positive, finite) cost Some solutions may be cheaper than others 7 CS440/ECE448: Intro AI

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Heuristic search: priority queue Heuristic search algorithms sort the nodes on the queue according to a cost function : QF(a,b): sort (append(a,b), CostFunction ) The cost function is an estimate of the true cost. Nodes with the lowest estimated cost have the highest priority. 8
Heuristic graph search 9 SEARCH(Problem P, Queuing Function QF): local: n, q, e; q new List(Initial_State(P)); Loop: if q == () return failure; n Pop(q); if n solves P return n; add n.STATE to e for m in Expand(n): if m is not in e or q: q QF(q,{m}); /*NEW: we want to find the cheapest goal!*/ else if m.STATE in q with higher cost : q replace(q, m.STATE, m); end

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Cost from root to node: g(n) g*(n): Minimum cost from root to n g*(n) is the sum of the costs for each action from the root to node n. This requires a cost function for actions g(n): Computable approximation to g*(n) For trees: g(n) == g*(n) 10 CS440/ECE448: Intro AI
Uniform-cost search Sort the queue by path cost g(n): First expand the node with lowest g(n) QF(a,b): sort(Append(a,b), g ) 11 CS440/ECE448: Intro AI

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Uniform-cost search illustrated CS440/ECE448: Intro AI 12 S g = 0 F g = 99 B g = 278 R g=80 P g = 177 99 211 80 97 101 S:0 [ R:80, F:99 ] R:80 [F:99, P:177 ] F:99 [P:177, B:310 ] P:177 [ B:278, B:310] B:278 [B:310] 1 2 3 4 5
Properties of uniform-cost search Complete if b is finite, and each action has positive (non-zero) cost (gets stuck in loops of zero-cost actions) Optimal.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern