1
CS486/686 Lecture Slides (c) 2005 K. Larson and P.Poupart
1
Solving Problems by Searching
CS486/686 University of Waterloo May 5th, 2005
CS486/686 Lecture Slides (c) 2005 K. Larson and P.Poupart
2
Outline
- Problem solving agents and search
- Examples
- Properties of search algorithms
- Uninformed search
– Breadth first – Depth first – Iterative Deepening
CS486/686 Lecture Slides (c) 2005 K. Larson and P.Poupart
3
Introduction
- Search was one of the first topics studied
in AI
– Newell and Simon (1961) General Problem Solver
- Central component to many AI systems
– Automated reasoning, theorem proving, robot navigation, VLSI layout, scheduling, game playing,…
CS486/686 Lecture Slides (c) 2005 K. Larson and P.Poupart
4
Problem-solving agents
CS486/686 Lecture Slides (c) 2005 K. Larson and P.Poupart
5
Example: Traveling in Romania
Giurgiu Urziceni Hirsova Eforie Neamt Oradea Zerind Arad Timisoara Lugoj Mehadia Dobreta Craiova Sibiu Fagaras Pitesti Vaslui Iasi Rimnicu Vilcea Bucharest 71 75 118 111 70 75 120 151 140 99 80 97 101 211 138 146 85 90 98 142 92 87 86
Start End Formulat e Goal Get t o Bucharest Formulat e P roblem I nit ial st at e: I n(Ar ad) Act ions: Drive bet ween cit ies Goal Test : I n(Bucharest )? P at h cost : Dist ance bet ween cit ies Find a solut ion Sequence of cit ies: Ar ad, Sibiu, Fagar as, Buchar est
CS486/686 Lecture Slides (c) 2005 K. Larson and P.Poupart
6
Examples of Search Problems
2
Start State Goal State
1 3 4 6 7 5 1 2 3 4 6 7 8 5 8 States: Locat ions of 8 t iles and blank I nitial State: Any st at e Succ Func: Gener at es legal st at es t hat r esult f rom t r ying 4 act ions (blank up, down, lef t , r ight ) Goal test: Does st at e mat ch desir ed conf igur at ion Path cost: Number of st eps States: Arr angement of 0 t o 8 queens on t he boar d I nitial State: No queens on t he boar d Succ Func: Add a queen t o an empt y space Goal test: 8 queens on boar d, none at t acked Path cost: