Presentation is loading. Please wait.

Presentation is loading. Please wait.

State space search Represented by a four-tuple [N,A,S,GD], where: N is the problem space A is the set of arcs (or links) between nodes. These correspond.

Similar presentations


Presentation on theme: "State space search Represented by a four-tuple [N,A,S,GD], where: N is the problem space A is the set of arcs (or links) between nodes. These correspond."— Presentation transcript:

1 State space search Represented by a four-tuple [N,A,S,GD], where: N is the problem space A is the set of arcs (or links) between nodes. These correspond to the operators. S is a nonempty subset of N. It represents the start state(s) of the problem.

2 State Space Search continued GD is a nonempty subset of N. It represents the goal state(s) of the problem. The states in GD are described using either: a measurable property of the states a property of the path developed in the search (a solution path is a path from node S to a node in GD )

3 The 8-puzzle problem as state space search states: possible board positions operators: one for sliding each square in each of four directions, or, better, one for moving the blank square in each of four directions initial state: some given board position goal state: some given board position Note: the “solution” is not interesting here, we need the path.

4 Eight Puzzle 143 76 582 143 762 58

5 State space of the 8-puzzle generated by “move blank” operations

6 Eight Puzzle States Representation – The squares of the eight puzzle can be represented by integers 1.. 8 and 9 represents empty square. A state of the puzzle is a permutation of 1..9 where 1 st three represent top row, 2 nd three represent middle row, and 3 rd three represent bottom row.

7 Eight puzzle transitions An eight puzzle transition consists of moving a square numbered 1..8 into the adjacent vacant square which can only be done if it is adjacent to the numbered square. Representation of a board configuration is a permutation of 1..9 where 9 represents vacant square. Example – 132496758 represents 1 st row 132, 2 nd row 4 b lnk 6, 3 rd row 748. Since the blank is in the middle position, 3 can be moved down, or 4 to the right, or 6 to the left, or 5 moved up. These transitions make 132496758 have neighbors 192436758, 132946758, 132469758, and 132456798.

8 Best First Search Let X be an eight puzzle state Let Y 1 … Y k be the neighbors of X Let G be the eight puzzle goal state Let h(Y i,G) be a lower bound to the distance of Y i to G. – h(Y i,G) = 0 (uninformed search) –h(Y i,G) = # squares in Y i out of place with respect to G Best First Search (based on h) selects Y i for which h(Y i,G) is minimum.

9 Traveling salesperson problem as state space search The salesperson has n cities to visit and must then return home. Find the shortest path to travel. state space: operators: initial state: goal state:


Download ppt "State space search Represented by a four-tuple [N,A,S,GD], where: N is the problem space A is the set of arcs (or links) between nodes. These correspond."

Similar presentations


Ads by Google