0% found this document useful (0 votes)
292 views14 pages

Branch and Bound

1. The 15 puzzle problem involves arranging 15 numbered tiles in a 4x4 grid into the desired order with the minimum number of moves, where only the empty space can be moved into neighboring tiles. 2. Solving the problem by trying all possible arrangements is infeasible due to the huge search space. Heuristics are used to guide the search of the state space tree. 3. The heuristic estimates the cost of a node as the sum of the path length and number of misplaced tiles, and prioritizes exploring branches with lower estimated cost first to find the solution requiring minimum moves.

Uploaded by

AayushGoyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
292 views14 pages

Branch and Bound

1. The 15 puzzle problem involves arranging 15 numbered tiles in a 4x4 grid into the desired order with the minimum number of moves, where only the empty space can be moved into neighboring tiles. 2. Solving the problem by trying all possible arrangements is infeasible due to the huge search space. Heuristics are used to guide the search of the state space tree. 3. The heuristic estimates the cost of a node as the sum of the path length and number of misplaced tiles, and prioritizes exploring branches with lower estimated cost first to find the solution requiring minimum moves.

Uploaded by

AayushGoyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Branch and Bound

15 Puzzle Problem

Random Arrangement Desired Arrangement

1 2 15 5 1 2 3 4

4 3 6 5 6 7 8

14 13 12 9 9 10 11 12

10 11 7 8 13 14 15

Empty slot can move Goal is to have desired


Left/right/top/bottom a arrangement in
number of times to get the minimum number of
desired arrangement moves
Possible Moves
Total permutation= 16! 1 2 15 5
State space tree will be huge! 4 3 6
14 13 12 9 left
bottom
10 11 7 8 1 2 15 5
1 2 15 5
4 3 6
4 13 3 6
top 14 13 12 9
14 12 9 right
10 11 7 8
10 11 7 8
1 2 15 5 1 15 5
4 3 6 4 2 3 6
14 13 12 9 14 13 12 9
10 11 7 8 10 11 7 8
Possible Moves
1 2 15 5
4 3 6
14 13 12 9
bottom 10 11 7 8

1 2 15 5
4 13 3 6
14 12 9
10 11 7 8
Possible Moves
1 2 15 5
4 3 6
14 13 12 9
bottom 10 11 7 8

1 2 15 5
Can’t move TOP, it will result back
4 13 3 6 into previous state
14 12 9
10 11 7 8
left
right bottom
1 2 15 5 1 2 15 5
1 2 15 5
4 13 3 6 4 13 3 6
4 13 3 6
14 12 9 14 11 12 9
14 12 9
10 11 7 8 10 7 8
10 11 7 8
Problem Solving
• Cannot try all possible solutions!
• Cannot build state space tree
– Branch for each move…. Very large…
• Need some heuristics to simplify the search
• Heuristics decide the fate of state space tree
– decides which sub-child to selected for branching
– and which should be pruned (bounded)
Heuristic for 15 puzzle
• For a state node ‘x’ in state space tree let its cost be
defined as:
𝑐 (𝑥) = 𝑓 𝑥 + 𝑔(𝑥)
• 𝑐 (𝑥) =estimated min cost to reach the goal node
• 𝑓 𝑥 length of path from root to node ‘x’
• 𝑔(𝑥) =estimate of length of shortest path from node
‘x’ to a goal node in subtree with root ‘x’

• Here 𝑔(𝑥) =number of non blank tiles not in


their goal position.
state space tree 1 1 2 3 4
5 6 8
9 10 7 11
13 14 15 12
B L 5
2 T R
1 2 4 3 1 2 3 4 4 1 2 3 4 1 2 3 4
5 6 3 8 5 6 7 8 5 6 8
5 6 8
9 10 7 11 9 10 11 9 10 7 11
9 10 7 11
13 14 15 12 13 14 15 12 13 14 15 12
13 14 15 12

• Four board arrangements possible..


• Need to find which may be best arrangement
closest to desired arrangement
state space tree 1 1 2 3 4
5 6 8
9 10 7 11
13 14 15 12 f 𝑥 =1
f 𝑥 =1 5
2 T f 𝑥 =1 R f 𝑥 =1 B L
1 2 4 3 1 2 3 4 4 1 2 3 4 1 2 3 4
5 6 3 8 5 6 7 8 5 6 8
5 6 8
9 10 7 11 9 10 11 9 10 7 11
9 10 7 11
13 14 15 12 13 14 15 12 13 14 15 12
13 14 15 12
𝑔(𝑥) = 4
𝑔(𝑥) = 4 𝑔(𝑥) = 4 𝑔(𝑥) = 2

Select the branch from where we can reach the


desired arrangement in min number of moves…
state space tree 1 1 2 3 4
5 6 8
9 10 7 11
13 14 15 12 f 𝑥 =1
f 𝑥 =1 5
2 T f 𝑥 =1 R f 𝑥 =1 B L
1 2 4 3 1 2 3 4 4 1 2 3 4 1 2 3 4
5 6 3 8 5 6 7 8 5 6 8
5 6 8
9 10 7 11 9 10 11 9 10 7 11
9 10 7 11
13 14 15 12 13 14 15 12 13 14 15 12
13 14 15 12
𝑔(𝑥) = 4
𝑔(𝑥) = 4 𝑔(𝑥) = 4 𝑔(𝑥) = 2
bound bound branch bound

Select the branch from where we can reach the


desired arrangement in min number of moves…
state space tree 1 1 2 3 4
5 6 8
9 10 7 11
13 14 15 12 f 𝑥 =1
f 𝑥 =1 5
2 T f 𝑥 =1 R f 𝑥 =1 B L
1 2 4 3 1 2 3 4 4 1 2 3 4 1 2 3 4
5 6 3 8 5 6 7 8 5 6 8
5 6 8
9 10 7 11 9 10 11 9 10 7 11
9 10 7 11
13 14 15 12 13 14 15 12 13 14 15 12
13 14 15 12
𝑔(𝑥) = 2 𝑔(𝑥) = 4
𝑔(𝑥) = 4 𝑔(𝑥) = 4
R
B L
1 2 3 4 1 2 3 4 1 2 3 4
5 6 7 8 5 6 7 8 5 6 7 8
9 10 11 9 10 15 11 9 10 11
13 14 15 12 13 14 12 𝑔(𝑥) = 3
13 14 15 12
𝑔(𝑥) = 1
𝑔(𝑥) = 3
state space tree 1 1 2 3 4
5 6 8
9 10 7 11
13 14 15 12 f 𝑥 =1
f 𝑥 =1 5
2 T f 𝑥 =1 R f 𝑥 =1 B L
1 2 4 3 1 2 3 4 4 1 2 3 4 1 2 3 4
5 6 3 8 5 6 7 8 5 6 8
5 6 8
9 10 7 11 9 10 11 9 10 7 11
9 10 7 11
13 14 15 12 13 14 15 12 13 14 15 12
13 14 15 12
𝑔(𝑥) = 2 𝑔(𝑥) = 4
𝑔(𝑥) = 4 𝑔(𝑥) = 4
R
B L
1 2 3 4 1 2 3 4 1 2 3 4
5 6 7 8 5 6 7 8 5 6 7 8
9 10 11 9 10 15 11 9 10 11
13 14 15 12 13 14 12 13 14 15 12
𝑔(𝑥) = 1
𝑔(𝑥) = 3 𝑔(𝑥) = 3
branch
bound bound
state space tree 1 1 2 3 4
5 6 8
9 10 7 11
13 14 15 12 f 𝑥 =1
f 𝑥 =1 5
2 T f 𝑥 =1 R f 𝑥 =1 B L
1 2 4 3 1 2 3 4 4 1 2 3 4 1 2 3 4
5 6 3 8 5 6 7 8 5 6 8
5 6 8
9 10 7 11 9 10 11 9 10 7 11
9 10 7 11
13 14 15 12 13 14 15 12 13 14 15 12
13 14 15 12
𝑔(𝑥) = 2 𝑔(𝑥) = 4
𝑔(𝑥) = 4 𝑔(𝑥) = 4
R 𝑔(𝑥) = 3 B L
1 2 3 4 1 2 3 4 1 2 3 4
5 6 7 8 5 6 7 8 5 6 7 8
9 10 11 9 10 15 11 9 10 11
13 14 15 12 13 14 12 13 14 15 12
𝑔(𝑥) = 1
𝑔(𝑥) = 3
1 2 3 4
B 1 2 3 4
5 6 7 8 5 6 7
T
9 10 11 12 9 10 11 8
13 14 15 13 14 15 12
state space tree 1 1 2 3 4
5 6 8
9 10 7 11
13 14 15 12 f 𝑥 =1
f 𝑥 =1 5
2 T f 𝑥 =1 R f 𝑥 =1 B L
1 2 4 3 1 2 3 4 4 1 2 3 4 1 2 3 4
5 6 3 8 5 6 7 8 5 6 8
5 6 8
9 10 7 11 9 10 11 9 10 7 11
9 10 7 11
13 14 15 12 13 14 15 12 13 14 15 12
13 14 15 12
𝑔(𝑥) = 2 𝑔(𝑥) = 4
𝑔(𝑥) = 4 𝑔(𝑥) = 4
R 𝑔(𝑥) = 3 B L
1 2 3 4 1 2 3 4 1 2 3 4
5 6 7 8 5 6 7 8 5 6 7 8
9 10 11 9 10 15 11 9 10 11
13 14 15 12 13 14 12 13 14 15 12
𝑔(𝑥) = 1
𝑔(𝑥) = 3
1 2 3 4
B 1 2 3 4
5 6 7 8 5 6 7
T
9 10 11 12 9 10 11 8
13 14 15 13 14 15 12

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy