SlideShare a Scribd company logo
3
Most read
5
Most read
6
Most read
15 PUZZLE PROBLEM
USING BRANCH AND BOUND
CREATED BY:-
ABHISHEK KUMAR SINGH
• Branch and Bound
• The search for an answer node can often be speeded by
using an “intelligent” ranking function, also called an
approximate cost function to avoid searching in sub-trees
that do not contain an answer node. It is similar to
backtracking technique but uses BFS-like search.
• There are basically three types of nodes involved in Branch
and Bound
• 1. Live node is a node that has been generated but whose
children have not yet been generated.
• 2. E-node is a live node whose children are currently being
explored. In other words, an E-node is a node currently
being expanded.
• 3. Dead node is a generated node that is not to be
expanded or explored any further. All children of a dead
node have already been expanded.
• Cost function:
• Each node X in the search tree is associated with a cost. The
cost function is useful for determining the next E-node. The
next E-node is the one with least cost. The cost function is
defined as,
• C(X) = g(X) + h(X) where g(X) = cost of reaching the current
node from the root h(X) = cost of reaching an answer node
from X
• Ideal Cost function for 15-puzzle Algorithm :
• We assume that moving one tile in any direction will have 1
unit cost. Keeping that in mind, we define cost function for 15-
puzzle algorithm as below :
• c(x) = f(x) + h(x) where f(x) is the length of the path from root
to x (the number of moves so far) and h(x) is the number of
non-blank tiles not in their goal position (the number of mis- -
placed tiles). There are at least h(x) moves to transform state x
to a goal state
1111 2@ 3 4
5 6 8
9 10 7 11
13 14 15 12
1111 2@ 33 4
5 6 7 8
9 10 11 12
13 14 15
Initial arrangement
Goalarrangement
1 2 3 4
5 6 8
9 10 7 11
13 14 15 12
up
right
left
down
1 2 4
5 6 3 8
9 10 7 11
13 14 15 12
1 2 3 4
5 6 8
9 10 7 11
13 14 15 12
1 2 3 4
5 6 7 8
9 10 11
13 14 15 12
1 2 3 4
5 6 8
9 10 7 11
13 14 15 12
C=1+4
C=1+4 C=1+2 C=1+4
1 2 4
5 6 3 8
9 10 7 11
13 14 15 12
1 2 3 4
5 6 8
9 10 7 11
13 14 15 12
1 2 3 4
5 6 7 8
9 10 11
13 14 15 12
1 2 3 4
5 6 8
9 10 7 11
13 14 15 12
1 2 3 4
5 6 7 8
9 10 11
13 14 15 12
1 2 3 4
5 6 7 8
9 10 15 11
13 14 12
1 2 3 4
5 6 7 8
9 10 11
13 14 15 12
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15
1 2 3 4
5 6 7 8
9 10 11
13 14 15 12
C=2+1 C=2+3
C=3+0C=3+2
C=2+3
• ALGORITHM 15-PUZZLE PROBLEM
• struct list_node
• {
• list_node *next;
• list_node *parent;
• float cost;
• };
• algorithm LCSearch(list_node *t)
• {
• if (*t is an answer node)
• {
• print(*t);
• return;
• }
• E =t;
• Initialize the list of live nodes to be empty;
• while (true) {
• for each child x of E
• {
• if x is an answer node {
• print the path from x to t;
• return; }
• Add (x);
• x->parent = E; }
• if there are no more live nodes
• {
• print ("No answer node");
• return;
• }
• E = Least();
• }
• }
•

More Related Content

What's hot (20)

PPTX
Recognition-of-tokens
Dattatray Gandhmal
 
PDF
I. AO* SEARCH ALGORITHM
vikas dhakane
 
PDF
P, NP, NP-Complete, and NP-Hard
Animesh Chaturvedi
 
PPTX
Knapsack Problem
Jenny Galino
 
PPTX
Signed Addition And Subtraction
Keyur Vadodariya
 
PPTX
Code generation
Aparna Nayak
 
PPTX
Graph coloring using backtracking
shashidharPapishetty
 
DOC
Time and space complexity
Ankit Katiyar
 
PPT
Floyd Warshall Algorithm
InteX Research Lab
 
PPTX
Unification and Lifting
Megha Sharma
 
PPT
Np cooks theorem
Narayana Galla
 
PPT
Recursion tree method
Rajendran
 
PPTX
Water jug problem ai part 6
Kirti Verma
 
PPTX
Decision properties of reular languages
SOMNATHMORE2
 
PPT
Turing Machine
Rajendran
 
PPTX
Automata theory -RE to NFA-ε
Akila Krishnamoorthy
 
PPTX
State space search
chauhankapil
 
PPT
Greedy Algorihm
Muhammad Amjad Rana
 
PPTX
sum of subset problem using Backtracking
Abhishek Singh
 
PPTX
Deadlock ppt
Sweetestangel Kochar
 
Recognition-of-tokens
Dattatray Gandhmal
 
I. AO* SEARCH ALGORITHM
vikas dhakane
 
P, NP, NP-Complete, and NP-Hard
Animesh Chaturvedi
 
Knapsack Problem
Jenny Galino
 
Signed Addition And Subtraction
Keyur Vadodariya
 
Code generation
Aparna Nayak
 
Graph coloring using backtracking
shashidharPapishetty
 
Time and space complexity
Ankit Katiyar
 
Floyd Warshall Algorithm
InteX Research Lab
 
Unification and Lifting
Megha Sharma
 
Np cooks theorem
Narayana Galla
 
Recursion tree method
Rajendran
 
Water jug problem ai part 6
Kirti Verma
 
Decision properties of reular languages
SOMNATHMORE2
 
Turing Machine
Rajendran
 
Automata theory -RE to NFA-ε
Akila Krishnamoorthy
 
State space search
chauhankapil
 
Greedy Algorihm
Muhammad Amjad Rana
 
sum of subset problem using Backtracking
Abhishek Singh
 
Deadlock ppt
Sweetestangel Kochar
 

Similar to 15 puzzle problem using branch and bound (20)

DOC
algorithm Unit 5
Monika Choudhery
 
PPT
ai and search algorithms general on a* and searching
peter958579
 
PPT
Different Search Techniques used in AI.ppt
jayrajsinghkardam
 
PPTX
designanalysisalgorithm_unit-v-part2.pptx
arifimad15
 
PPT
Ai4 heuristic2
Mohammad Faizan
 
PPTX
Chapter 3.pptx
ashetuterefa
 
PDF
Artificial Intelligence (AI) (Lecture 4).pdf
a7349061
 
PPTX
04 Problem Solving in AI (1)-artificial intelligence.pptx
HiraSardar1
 
PPT
Chapter3 Search
Khiem Ho
 
DOC
Unit 5 jwfiles
Nv Thejaswini
 
PPTX
AI UNIT 2 PPT AI UNIT 2 PPT AI UNIT 2 PPT.pptx
pank011
 
PPTX
Moduleanaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaad-II.pptx
Baseemkhan3
 
PPTX
AI : A* AND RANDOMIZED SEARCH METHOD​.pptx
Ananthi Palanisamy
 
PPT
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VEC
sundarKanagaraj1
 
PPT
8783733
P. Carmona
 
PPTX
HEURISTIC SEARCH and other technique.pptx
rakeshkumar12020604
 
PDF
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
Guru Nanak Technical Institutions
 
PPT
03 search blind
Nour Zeineddine
 
PDF
Ai unit-4
Tribhuvan University
 
algorithm Unit 5
Monika Choudhery
 
ai and search algorithms general on a* and searching
peter958579
 
Different Search Techniques used in AI.ppt
jayrajsinghkardam
 
designanalysisalgorithm_unit-v-part2.pptx
arifimad15
 
Ai4 heuristic2
Mohammad Faizan
 
Chapter 3.pptx
ashetuterefa
 
Artificial Intelligence (AI) (Lecture 4).pdf
a7349061
 
04 Problem Solving in AI (1)-artificial intelligence.pptx
HiraSardar1
 
Chapter3 Search
Khiem Ho
 
Unit 5 jwfiles
Nv Thejaswini
 
AI UNIT 2 PPT AI UNIT 2 PPT AI UNIT 2 PPT.pptx
pank011
 
Moduleanaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaad-II.pptx
Baseemkhan3
 
AI : A* AND RANDOMIZED SEARCH METHOD​.pptx
Ananthi Palanisamy
 
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VEC
sundarKanagaraj1
 
8783733
P. Carmona
 
HEURISTIC SEARCH and other technique.pptx
rakeshkumar12020604
 
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
Guru Nanak Technical Institutions
 
03 search blind
Nour Zeineddine
 
Ad

More from Abhishek Singh (7)

PPTX
0 1 knapsack using naive recursive approach and top-down dynamic programming ...
Abhishek Singh
 
PPTX
0 1 knapsack using branch and bound
Abhishek Singh
 
PPTX
Knights tour on chessboard using backtracking
Abhishek Singh
 
PPTX
RABIN KARP ALGORITHM STRING MATCHING
Abhishek Singh
 
PPTX
Naive string matching
Abhishek Singh
 
PPTX
kmp_algorithm (string matching)
Abhishek Singh
 
PPTX
Sudoku
Abhishek Singh
 
0 1 knapsack using naive recursive approach and top-down dynamic programming ...
Abhishek Singh
 
0 1 knapsack using branch and bound
Abhishek Singh
 
Knights tour on chessboard using backtracking
Abhishek Singh
 
RABIN KARP ALGORITHM STRING MATCHING
Abhishek Singh
 
Naive string matching
Abhishek Singh
 
kmp_algorithm (string matching)
Abhishek Singh
 
Ad

Recently uploaded (20)

PPT
Testing and final inspection of a solar PV system
MuhammadSanni2
 
PPTX
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
PPTX
OCS353 DATA SCIENCE FUNDAMENTALS- Unit 1 Introduction to Data Science
A R SIVANESH M.E., (Ph.D)
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PPTX
MODULE 05 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PPTX
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
PPTX
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
PPTX
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
PDF
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PPT
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PDF
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
PPTX
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
PDF
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
PPTX
MODULE 03 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PPTX
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
PDF
AN EMPIRICAL STUDY ON THE USAGE OF SOCIAL MEDIA IN GERMAN B2C-ONLINE STORES
ijait
 
PPTX
Distribution reservoir and service storage pptx
dhanashree78
 
PDF
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
Testing and final inspection of a solar PV system
MuhammadSanni2
 
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
OCS353 DATA SCIENCE FUNDAMENTALS- Unit 1 Introduction to Data Science
A R SIVANESH M.E., (Ph.D)
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
MODULE 05 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
MODULE 03 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
AN EMPIRICAL STUDY ON THE USAGE OF SOCIAL MEDIA IN GERMAN B2C-ONLINE STORES
ijait
 
Distribution reservoir and service storage pptx
dhanashree78
 
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 

15 puzzle problem using branch and bound

  • 1. 15 PUZZLE PROBLEM USING BRANCH AND BOUND CREATED BY:- ABHISHEK KUMAR SINGH
  • 2. • Branch and Bound • The search for an answer node can often be speeded by using an “intelligent” ranking function, also called an approximate cost function to avoid searching in sub-trees that do not contain an answer node. It is similar to backtracking technique but uses BFS-like search. • There are basically three types of nodes involved in Branch and Bound • 1. Live node is a node that has been generated but whose children have not yet been generated. • 2. E-node is a live node whose children are currently being explored. In other words, an E-node is a node currently being expanded. • 3. Dead node is a generated node that is not to be expanded or explored any further. All children of a dead node have already been expanded.
  • 3. • Cost function: • Each node X in the search tree is associated with a cost. The cost function is useful for determining the next E-node. The next E-node is the one with least cost. The cost function is defined as, • C(X) = g(X) + h(X) where g(X) = cost of reaching the current node from the root h(X) = cost of reaching an answer node from X • Ideal Cost function for 15-puzzle Algorithm : • We assume that moving one tile in any direction will have 1 unit cost. Keeping that in mind, we define cost function for 15- puzzle algorithm as below : • c(x) = f(x) + h(x) where f(x) is the length of the path from root to x (the number of moves so far) and h(x) is the number of non-blank tiles not in their goal position (the number of mis- - placed tiles). There are at least h(x) moves to transform state x to a goal state
  • 4. 1111 2@ 3 4 5 6 8 9 10 7 11 13 14 15 12 1111 2@ 33 4 5 6 7 8 9 10 11 12 13 14 15 Initial arrangement Goalarrangement
  • 5. 1 2 3 4 5 6 8 9 10 7 11 13 14 15 12 up right left down 1 2 4 5 6 3 8 9 10 7 11 13 14 15 12 1 2 3 4 5 6 8 9 10 7 11 13 14 15 12 1 2 3 4 5 6 7 8 9 10 11 13 14 15 12 1 2 3 4 5 6 8 9 10 7 11 13 14 15 12 C=1+4 C=1+4 C=1+2 C=1+4
  • 6. 1 2 4 5 6 3 8 9 10 7 11 13 14 15 12 1 2 3 4 5 6 8 9 10 7 11 13 14 15 12 1 2 3 4 5 6 7 8 9 10 11 13 14 15 12 1 2 3 4 5 6 8 9 10 7 11 13 14 15 12 1 2 3 4 5 6 7 8 9 10 11 13 14 15 12 1 2 3 4 5 6 7 8 9 10 15 11 13 14 12 1 2 3 4 5 6 7 8 9 10 11 13 14 15 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 13 14 15 12 C=2+1 C=2+3 C=3+0C=3+2 C=2+3
  • 7. • ALGORITHM 15-PUZZLE PROBLEM • struct list_node • { • list_node *next; • list_node *parent; • float cost; • }; • algorithm LCSearch(list_node *t) • { • if (*t is an answer node) • { • print(*t); • return; • } • E =t; • Initialize the list of live nodes to be empty;
  • 8. • while (true) { • for each child x of E • { • if x is an answer node { • print the path from x to t; • return; } • Add (x); • x->parent = E; } • if there are no more live nodes • { • print ("No answer node"); • return; • } • E = Least(); • } • } •