1 / 93

CS347 – Introduction to Artificial Intelligence

CS347 – Introduction to Artificial Intelligence. CS347 course website: http://web.mst.edu/~tauritzd/courses/cs347/. Dr. Daniel Tauritz (Dr. T) Department of Computer Science tauritzd@mst.edu http://web.mst.edu/~tauritzd/. What is AI?. Systems that… act like humans (Turing Test)

genero
Télécharger la présentation

CS347 – Introduction to Artificial Intelligence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS347 – Introduction toArtificial Intelligence CS347 course website: http://web.mst.edu/~tauritzd/courses/cs347/ Dr. Daniel Tauritz (Dr. T) Department of Computer Science tauritzd@mst.edu http://web.mst.edu/~tauritzd/

  2. What is AI? Systems that… • act like humans (Turing Test) • think like humans • think rationally • act rationally Play Ultimatum Game

  3. How difficult is it to achieve AI? • Three Sisters Puzzle

  4. Problem-solving agents A definition: Problem-solving agents are goal based agents that decide what to do based on an action sequence leading to a goal state.

  5. Environment Assumptions • Fully Observable • Single Agent • Discrete • Sequential • Known & Deterministic

  6. Open-loop problem-solving steps • Problem-formulation (actions & states) • Goal-formulation (states) • Search (action sequences) • Execute solution

  7. Well-defined problems • Initial state • Action set: ACTIONS(s) • Transition model: RESULT(s,a) • Goal test • Step cost: c(s,a,s’) • Path cost • Solution / optimal solution

  8. Example problems • Vacuum world • Tic-tac-toe • 8-puzzle • 8-queens problem

  9. Search trees • Root corresponds with initial state • Vacuum state space vs. search tree • Search algorithms iterate through goal testing and expanding a state until goal found • Order of state expansion is critical!

  10. function TREE-SEARCH(problem) returns solution/fail initialize frontier using initial problem state loop do if empty(frontier) then return fail choose leaf node and remove it from frontier if chosen node contains goal state then return corresponding solution expand chosen node and add resulting nodes to frontier

  11. Redundant paths • Loopy paths • Repeated states • Redundant paths

  12. function GRAPH-SEARCH(problem) returns solution/fail initialize frontier using initial problem state initialize explored set to be empty loop do if empty(frontier) then return fail choose leaf node and remove it from frontier if chosen node contains goal state then return corresponding solution add chosen node to explored set expand chosen node and add resulting nodes to frontier only if not yet in frontier or explored set

  13. Search node datastructure • n.STATE • n.PARENT-NODE • n.ACTION • n.PATH-COST States are NOT search nodes!

  14. Frontier • Frontier = Set of leaf nodes • Implemented as a queue with ops: • EMPTY?(queue) • POP(queue) • INSERT(element,queue) • Queue types: FIFO, LIFO (stack), and priority queue

  15. Problem-solving performance • Completeness • Optimality • Time complexity • Space complexity

  16. Complexity in AI • b – branching factor • d – depth of shallowest goal node • m – max path length in state space • Time complexity: # generated nodes • Space complexity: max # nodes stored • Search cost: time + space complexity • Total cost: search + path cost

  17. Tree Search • Breadth First Tree Search (BFTS) • Uniform Cost Tree Search (UCTS) • Depth-First Tree Search (DFTS) • Depth-Limited Tree Search (DLTS) • Iterative-Deepening Depth-First Tree Search (ID-DFTS)

  18. Example state space #1

  19. Breadth First Tree Search (BFTS) • Frontier: FIFO queue • Complete: if b and d are finite • Optimal: if path-cost is non-decreasing function of depth • Time complexity: O(b^d) • Space complexity: O(b^d)

  20. Uniform Cost Search (UCS) • g(n) = lowest path-cost from start node to node n • Frontier: priority queue ordered by g(n)

  21. Depth First Tree Search (DFTS) • Frontier: LIFO queue (a.k.a. stack) • Complete: no • Optimal: no • Time complexity: O(bm) • Space complexity: O(bm) • Backtracking version of DFTS has a space complexity of: O(m)

  22. Depth-Limited Tree Search (DLTS) • Frontier: LIFO queue (a.k.a. stack) • Complete: not when l < d • Optimal: no • Time complexity: O(b^l) • Space complexity: O(bl) • Diameter: min # steps to get from any state to any other state

  23. Diameter example 1

  24. Diameter example 2

  25. Iterative-Deepening Depth-First Tree Search (ID-DFTS) function ID-DFS(problem) returns solution/fail for depth = 0 to ∞ do result ← DLS(problem,depth) ifresult ≠ cutoff then return result • Complete: Yes, if b is finite • Optimal: Yes, if path-cost is nondecreasing function of depth • Time complexity: O(b^d) • Space complexity: O(bd)

  26. Bidirectional Search BiBFTS • Complete: Yes, if b is finite • Optimal: Not “out of the box” • Time & Space complexity: O(bd/2)

  27. Example state space #2

  28. Best First Search (BeFS) • Select node to expand based on evaluation function f(n) • Typically node with lowest f(n) selected because f(n) correlated with path-cost • Represent frontier with priority queue sorted in ascending order of f-values

  29. Path-cost functions • g(n) = lowest path-cost from start node to node n • h(n) = estimated non-negative path-cost of cheapest path from node n to a goal node [with h(goal)=0]

  30. Heuristics • h(n) is a heuristic function • Heuristics incorporate problem-specific knowledge • Heuristics need to be relatively efficient to compute

  31. Important BeFS algorithms • UCS: f(n) = g(n) • GBeFS: f(n) = h(n) • A*S: f(n) = g(n)+h(n)

  32. GBeFTS • Incomplete (so also not optimal) • Worst-case time and space complexity: O(bm) • Actual complexity depends on accuracy of h(n)

  33. A*S • f(n) = g(n) + h(n) • f(n): estimated cost of optimal solution through node n • if h(n) satisfies certain conditions, A*S is complete & optimal

  34. Example state space # 3

  35. Admissible heuristics • h(n) admissible if: Example: straight line distance A*TS optimal if h(n) admissible

  36. Consistent heuristics • h(n) consistent if: Consistency implies admissibility A*GS optimal if h(n) consistent

  37. A* search notes • Optimally efficient for consistent heuristics • Run-time is a function of the heuristic error • Suboptimal variants • Not strictly admissible heuristics • A* Graph Search not scalable due to memory requirements

  38. Memory-bounded heuristic search • Iterative Deepening A* (IDA*) • Recursive Best-First Search (RBFS) • IDA* and RBFS don’t use all avail. memory • Memory-bounded A* (MA*) • Simplified MA* (SMA*) • Meta-level learning aims to minimize total problem solving cost

  39. Heuristic Functions • Effective branching factor • Domination • Composite heuristics • Generating admissible heuristics from relaxed problems

  40. Sample relaxed problem • n-puzzle legal actions: Move from A to B if horizontally or vertically adjacent and B is blank Relaxed problems: • Move from A to B if adjacent • Move from A to B if B is blank • Move from A to B

  41. Generating admissible heuristics The cost of an optimal solution to a relaxed problem is an admissible heuristic for the original problem.

  42. Adversarial Search Environments characterized by: • Competitive multi-agent • Turn-taking Simplest type: Discrete, deterministic, two-player, zero-sum games of perfect information

  43. Search problem formulation • S0: Initial state (initial board setup) • Player(s): which player has the move • Actions(s): set of legal moves • Result(s,a): defines transitional model • Terminal test: game over! • Utility function: associates player-dependent values with terminal states

  44. Minimax

  45. Example game tree 1

  46. Depth-Limited Minimax • State Evaluation Heuristic estimates Minimax value of a node • Note that the Minimax value of a node is always calculated for the Max player, even when the Min player is at move in that node!

  47. Heuristic Depth-Limited Minimax

  48. State Eval Heuristic Qualities A good State Eval Heuristic should: • order the terminal states in the same way as the utility function • be relatively quick to compute • strongly correlate nonterminal states with chance of winning

  49. Weighted Linear State Eval Heuristic

  50. Heuristic Iterative-Deepening Minimax • IDM(s,d) calls DLM(s,1), DLM(s,2), …, DLM(s,d) • Advantages: • Solution availability when time is critical • Guiding information for deeper searches

More Related