1 / 39

Unit 2 Problem-solving and Building Smart Systems

Smart System Design and Applications. Unit 2 Problem-solving and Building Smart Systems. Prepared By: Pooja Mishra. Introduction to Problem solving process.

turnerf
Download Presentation

Unit 2 Problem-solving and Building Smart Systems

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. Smart System Design and Applications Unit 2 Problem-solving and Building Smart Systems Prepared By: Pooja Mishra

  2. Introduction to Problem solving process • Everyone must have felt at least once in his or her life how wonderful it would be if we could solve a problem at hand preferably without much difficulty or even with some difficulties. • Unfortunately the problem solving is an art at this point and there are no universal approaches one can take to solving problems

  3. PROBLEM REPRESENTATION IN AI • Define the problem precisely :like what is initial situation, what will be the final, what are acceptable solutions • Analyze the problem: various possible techniques for solving the problem • Isolate and represent the task knowledge that is necessary to solve the problem. • Choose the best problem solving technique and apply it

  4. Some example problems • Toy problems and micro-worlds • 8-Puzzle • Missionaries and Cannibals • Cryptarithmetic • Remove 5 Sticks • Water Jug Problem • Real-world problems

  5. 8-Puzzle Given an initial configuration of 8 numbered tiles on a 3 x 3 board, move the tiles in such a way so as to produce a desired goal configuration of the tiles.

  6. 8-Puzzle • State Representation: 3 x 3 array configuration of the tiles on the board. 3 x 3 array configuration of the tiles on the board. • Operators:M Move Blank Square Left, Right, Up or Down. ove Blank Square Left, Right, Up or Down. • s a more efficient encoding of the operators than one in which each of four possible moves for each of the 8 distinct tiles is used. • Initial State:A A particular configuration of the board. particular configuration of the board. • Goal:A particular configuration of the board.

  7. The 8-Queens Problem State Representation: ? Initial State: ? Operators: ? Goal: Place eight queens on a chessboard such that no queen attacks any other

  8. Missionaries and Cannibals Three missionaries and three cannibals wish to cross the river. They have a small boat that will carry up to two people. Everyone can navigate the boat. If at any time the Cannibals outnumber the Missionaries on either bank of the river, they will eat the Missionaries. Find the smallest number of crossings that will allow everyone to cross the river safely.

  9. Missionaries and Cannibals • Goal: Move all the missionaries and cannibals across the river. • Constraint: Missionaries can never be outnumbered by cannibals on either side of river, or else the missionaries are killed. • State: configuration of missionaries and cannibals and boat on each side of river. • Initial State: 3 missionaries, 3 cannibals and the boat are on the near bank • Operators: Move boat containing some set of occupants across the river (in either direction) to the other side.

  10. Missionaries and Cannibals Solution Near sideFar side 0 Initial setup: MMMCCC B - 1 Two cannibals cross over: MMMC B CC 2 One comes back: MMMCC B C 3 Two cannibals go over again: MMM B CCC 4 One comes back: MMMC B CC 5 Two missionaries cross: MC B MMCC 6 A missionary & cannibal return: MMCC B MC 7 Two missionaries cross again: CC B MMMC 8 A cannibal returns: CCC B MMM 9 Two cannibals cross: C B MMMCC 10 One returns: CC B MMMC 11 And brings over the third: - B MMMCCC

  11. 5 2 Water Jug Problem Given a full 4-gallon jug and a full 5-gallon jug, fill the 2-gallon jug with exactly 1 gallon of water. • State: ? • Initial State: ? • Operators: ? • Goal State: ?

  12. 5 2 Water Jug Problem Operator table • State = (x,y), where x is the number of gallons of water in the 5-gallon jug and y is # of gallons in the 2-gallon jug • Initial State = (5,2) • Goal State = (*,1), where * means any amount

  13. Some more real-world problems • Route finding • Touring (traveling salesman) • Logistics • VLSI layout • Robot navigation • Learning

  14. Types of Problem Spaces • Problems generally represented as graphs • Problem solving ~ searching a graph • There are several types of problem spaces: • State space • Problem Reduction Space • AND/OR Graphs

  15. State Space • The "state space" is the set of states of the problem • we can get to a state by applying operators to that state and get a new state.

  16. State Space • The states represent situations of the problem. • The operators represent actions in the world. • forward search: the root of the problem space represents the start state, and the search proceeds forward to a goal state. • backward search : the root of the problem space represents the goal state, and the search proceeds backward to the initial state.

  17. State Space • State space = Directed graph • Nodes ~ Problem situations • Arcs ~ Actions, legal moves • Problem = ( State space, Start, Goal condition) • Note: several nodes may satisfy goal condition • Solving a problem ~ Finding a path • Problem solving ~ Graph search • Problem solution ~ Path from start to a goal node

  18. A problem from blocks world Find a sequence of robot moves to re-arrange blocks

  19. Blocks world state space Start Goal

  20. Examples of representing problems in state space • Blocks world planning • 8-puzzle, 15-puzzle • 8 queens • Travelling salesman • Set covering How can these problems be represented by graphs? Propose corresponding state spaces

  21. 8-puzzle

  22. State spaces for optimisation problems • Optimisation: minimise cost of solution • In blocks world: actions may have different costs (blocks have different weights, ...) • Assign costs to arcs • Cost of solution = cost of solution path

  23. A B C A B C Problem Reduction Space • In a problem reduction space, the nodes represent problems to be solved or goals to be achieved, and the edges represent the decomposition of the problem into subproblems. • This is best illustrated by the example of the Towers of Hanoi problem.

  24. 3AC 2AB 1AC 2BC 1AC 1BA 1AB 1CB 1BC 1AC Problem Reduction Space • The root node, labeled “3AC” represents the original problem of transferring all 3 disks from peg A to peg C. • The goal can be decomposed into three subgoals: 2AB, 1AC, 2BC. In order to achieve the goal, all 3 subgoals must be achieved.

  25. A B C 3AC Problem Reduction Space

  26. A B C 3AC 2AB 1AC Problem Reduction Space

  27. A B C 3AC 2AB 1AC 1AB Problem Reduction Space

  28. A B C 3AC 2AB 1AC 1CB 1AB Problem Reduction Space

  29. A B C 3AC 2AB 1AC 1AC 1CB 1AB Problem Reduction Space

  30. A B C 3AC 2AB 1AC 2BC 1BA 1AC 1CB 1AB Problem Reduction Space

  31. A B C 3AC 2AB 1AC 2BC 1BC 1BA 1AC 1CB 1AB Problem Reduction Space

  32. A B C 3AC 2AB 1AC 2BC 1BC 1BA 1AC 1AC 1CB 1AB Problem Reduction Space

  33. AND/OR Graphs • An AND/OR graph consists of both AND nodes and OR nodes. • One source of AND/OR graphs is a problem where the effect of an action cannot be predicted in advanced, as in an interaction with the physical world.

  34. represents the search space for solving the problem P, • using the goal-reduction methods: • P if Q and R • P if S • Q if T • Q if U And–Or Graph

  35. AND/OR Graphs • An AND graph consists entirely of AND nodes, and in order to solve a problem represented by it, you need to solve the problems represented by all of his children (Hanoi towers example). • An OR graph consists entirely of OR nodes, and in order to solve the problem represented by it, you only need to solve the problem represented by one of his children (Eight Puzzle Tree example).

  36. Solution subgraph for AND/OR trees • In general, a solution to an AND/OR graph is a subgraph with the following properties: • It contains the root node. For every OR node included in the solution subgraph, one child is included. • For every AND node included in the solution subgraph, all the children are included. • Every terminal node in the solution subgraph is a solved node.

  37. Example:Matrix Multiplication

  38. Example:Matrix Multiplication

More Related