770 likes | 788 Views
This article introduces the problem formulation process and tree search algorithms for finding solutions in fully observable, deterministic, and discrete environments. It covers examples such as route planning, maze solving, and game strategies. The article discusses state space abstraction, defining states, actions, transition models, goal tests, and cost functions. It also explores tree search algorithms like breadth-first search (BFS) and uniform-cost search (UCS).
E N D
CS3243: Introduction to Artificial Intelligence Semester 2, 2017/2018
Solving problemsby Searching for Solutions AIMA Chapter 3.1 – 3.4
Searching for Solutions • Fully observable, deterministic, discrete environment • Examples • Shortest route going through all cities • Winning sequence of moves in a game • Find path through a maze • Route planning • Solution to Boolean satisfiability problem
A solution is a sequence of actions leading from the initial state to a goal state • Is the solution unique? • Is it optimal? • Can it be efficiently found?
Defining State Space • Real world is absurdly complex: state space must be abstracted • (Abstract) state set of real states • (Abstract) action complex combination of real actions e.g.,“move steering wheel 30 degrees left, press gas pedal, avoid rocks...” • (Abstract) solution set of real paths that are solutions in the real world • Valid abstraction: e.g., for any real state “in ”, there is a real set of actions that will lead us to the next step in the solution. • Useful abstraction: executing each abstract action is “easier” than the original problem
Example: Route Planning Home NUH Work
Example: Route Planning Home NUH Work
Example: Vacuum World • States (Initial State)? • Actions? • Transition Model? • Goal Test? • Cost Function?
Example: 8 Puzzle • States (Initial State)? • Actions? • Transition Model? • Goal Test? • Cost Function? Can we find an optimal solution in poly-time?
Tree Search Algorithms • Start at the source node, keep searching until we reach a goal state. • Frontier: nodes that we have seen but haven’t explored yet (at initialization: the frontier is just the source) • At each iteration, choose a node from the frontier, explore it, and add its neighbors to the frontier.
Initial State Home NUH Goal Work
Traversal Methods • In what order to we explore the frontier nodes? Search strategy • Which neighbors do we add? All of them? “Algorithms which do not remember their (search) history are doomed to repeat it”
Graph Search • A node that’s been explored once will not be revisited. • We will need to assume TREE-SEARCH is used for some theoretical results (next lecture)
Implementation: States vs. Nodes • A state represents a physical configuration • A node is a data structure constituting part of search tree. It includes state, parent node, action, and path cost. • Two different nodes are allowed to contain same world state
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Search Strategies Any deterministic search algorithm is determined by the order of node expansion.
Breadth-First Search (BFS) • Idea: Expand shallowest unexpanded node • Implementation: Frontier is a FIFO queue, i.e., insert new successors at the end
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Properties of BFS • Yes (if is finite) • No (unless step cost ) • Max size of frontier Spaceis the bigger problem (more than time)
Uniform-Cost Search (UCS) • Idea: expand least-path-cost unexpanded node • Frontier: priority queue ordered by path cost • Equivalent to BFS if all step costs are equal
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work
Home NUH Work