SlideShare a Scribd company logo
Unit 5
BACKTRACKING
General Method Backtracking
• Many problems which deal with searching for a set of solutions or
which ask for an optimal solution Satisfying some constraints can be
solved using the backtracking formulation.
• The name backtrack was first coined by D.H.Lehmer in the 1950s Early
General Backtracking Method
General Method Backtracking
• Many of the problems we solve using backtracking require that all the
Solutions satisfy a complex set of constraints. For any problem these
constraints can be divided into two categories : explicit and implicit
• Explicit constraints
are rules that restrict each Xi to take on values only from a given set
• Common examples of explicit constraints are
General Method Backtracking
• The explicit constraints depend on the particular instance I of the
problem Being solved.
• All tuples that satisfy the explicit constraints define a possible
Solution space for I.
• The implicit constraints
• are rules that determine which of the tuples in the solution space of I satisfy
the criterion function.
• Thus Implicit constraints describe the way in which the Xi must relate to each
other
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Formulation of Backtracking process
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
N-Queen Problem
N-Queen Problem
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
SUM OF SUBSET
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
GRAPH COLORING
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
HAMILTONIAN CYCLES
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Example
Find the all possible Hamiltonian cycle by using the backtracking approach for a given graph. Draw
portion of state space tree generated

More Related Content

PPT
Backtracking Algorithm.ppt
PPTX
General methodin Data Structure for UG.pptx
PPTX
Backtrack-search-algorithm (2).pptx
PPTX
it is a ppt discussing important topic of daa such as branch and bound.pptx
PPTX
Backtracking in Data Structure and Algorithm
PPTX
Backtrack search-algorithm
PDF
unit 4 of Unit 4 of design and analysis of algorithms
PPTX
Design Algorithms - - Backtracking.pptx
Backtracking Algorithm.ppt
General methodin Data Structure for UG.pptx
Backtrack-search-algorithm (2).pptx
it is a ppt discussing important topic of daa such as branch and bound.pptx
Backtracking in Data Structure and Algorithm
Backtrack search-algorithm
unit 4 of Unit 4 of design and analysis of algorithms
Design Algorithms - - Backtracking.pptx

Similar to Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems (11)

PPTX
backtracking 8 Queen.pptx
PPTX
Algorithm design and analysis
PDF
module5_backtrackingnbranchnbound_2022.pdf
PDF
DAA UNIT-4 (1).pdf
PPTX
A-Backtracking with examples.pptxA-Backtracking with examples.pptx
PPTX
proficiency presenattion on topic of backtracking algo
PPTX
Backtracking Algorithm.pptx
PPT
BackTracking Algorithm: Technique and Examples
PPTX
Backtracking
PPTX
N queens using backtracking
backtracking 8 Queen.pptx
Algorithm design and analysis
module5_backtrackingnbranchnbound_2022.pdf
DAA UNIT-4 (1).pdf
A-Backtracking with examples.pptxA-Backtracking with examples.pptx
proficiency presenattion on topic of backtracking algo
Backtracking Algorithm.pptx
BackTracking Algorithm: Technique and Examples
Backtracking
N queens using backtracking
Ad

More from Minakshee Patil (18)

PPTX
Introduction, characteristics, Pseudocode.pptx
PPTX
0-1_knapsack_using_Dynamic Programming.pptx
PPTX
Introduction to Computational Complexity Theory pptx
PPTX
Different Searching and Sorting Methods.pptx
PPTX
Analysis of Algorithms (1).pptx, asymptotic
PPTX
0-1_knapsack_using_DP, types of knapsack
PPT
Linear Data Structures, array, stack, queue
PPT
stack, opeartions on stack, applications of stack
PPTX
Algorithm Design Techiques, divide and conquer
PPTX
Analysis of Algorithms, recurrence relation, solving recurrences
PPT
Lecture2 (9).ppt
PPTX
oracle.pptx
PPT
Lecture1.ppt
PPT
Unit 1.ppt
PPTX
Hierarchical clustering algorithm.pptx
PPT
Lecture2 (1).ppt
PPT
Lecture3 (3).ppt
PPT
Lecture4.ppt
Introduction, characteristics, Pseudocode.pptx
0-1_knapsack_using_Dynamic Programming.pptx
Introduction to Computational Complexity Theory pptx
Different Searching and Sorting Methods.pptx
Analysis of Algorithms (1).pptx, asymptotic
0-1_knapsack_using_DP, types of knapsack
Linear Data Structures, array, stack, queue
stack, opeartions on stack, applications of stack
Algorithm Design Techiques, divide and conquer
Analysis of Algorithms, recurrence relation, solving recurrences
Lecture2 (9).ppt
oracle.pptx
Lecture1.ppt
Unit 1.ppt
Hierarchical clustering algorithm.pptx
Lecture2 (1).ppt
Lecture3 (3).ppt
Lecture4.ppt
Ad

Recently uploaded (20)

PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Current and future trends in Computer Vision.pptx
PDF
Digital Logic Computer Design lecture notes
PPTX
web development for engineering and engineering
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Construction Project Organization Group 2.pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPT
Mechanical Engineering MATERIALS Selection
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
Safety Seminar civil to be ensured for safe working.
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Current and future trends in Computer Vision.pptx
Digital Logic Computer Design lecture notes
web development for engineering and engineering
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
UNIT 4 Total Quality Management .pptx
Construction Project Organization Group 2.pptx
CH1 Production IntroductoryConcepts.pptx
Mechanical Engineering MATERIALS Selection
Operating System & Kernel Study Guide-1 - converted.pdf
Automation-in-Manufacturing-Chapter-Introduction.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Safety Seminar civil to be ensured for safe working.
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Internet of Things (IOT) - A guide to understanding
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Embodied AI: Ushering in the Next Era of Intelligent Systems

Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems

  • 2. General Method Backtracking • Many problems which deal with searching for a set of solutions or which ask for an optimal solution Satisfying some constraints can be solved using the backtracking formulation. • The name backtrack was first coined by D.H.Lehmer in the 1950s Early
  • 4. General Method Backtracking • Many of the problems we solve using backtracking require that all the Solutions satisfy a complex set of constraints. For any problem these constraints can be divided into two categories : explicit and implicit • Explicit constraints are rules that restrict each Xi to take on values only from a given set • Common examples of explicit constraints are
  • 5. General Method Backtracking • The explicit constraints depend on the particular instance I of the problem Being solved. • All tuples that satisfy the explicit constraints define a possible Solution space for I. • The implicit constraints • are rules that determine which of the tuples in the solution space of I satisfy the criterion function. • Thus Implicit constraints describe the way in which the Xi must relate to each other
  • 32. Example Find the all possible Hamiltonian cycle by using the backtracking approach for a given graph. Draw portion of state space tree generated