SlideShare a Scribd company logo
General method
of
backtracking
seminar
Introductionof
backtracking
 Backtracking can be defined as a general algorithmic technique
that considers searching every possible combination in order to
solve a computational problem.
Introductionof
backtracking
algorithm
 Backtracking is an algorithmic technique for solving
problems recursively by trying to build a solution
incrementally, one piece at a time, removing those
solutions that fail to satisfy the constraints of the
problem at any point of time (by time, here, is referred
to the time elapsed till reaching any level of the search
tree).
Basic
terminologies
 Candidate: A candidate is a potential choice or element that can
be added to the current solution.
 Solution: The solution is a valid and complete configuration that
satisfies all problem constraints.
 Partial Solution: A partial solution is an intermediate or
incomplete configuration being constructed during the
backtracking process.
 Decision Space: The decision space is the set of all possible
candidates or choices at each decision point.
 Decision Point: A decision point is a specific step in the algorithm
where a candidate is chosen and added to the partial solution.
 Feasible Solution: A feasible solution is a partial or complete solution that adheres to all
constraints.
 Dead End: A dead end occurs when a partial solution cannot be extended without violating
constraints.
 Backtrack: Backtracking involves undoing previous decisions and returning to a prior
decision point.
 Search Space: The search space includes all possible combinations of candidates and
choices.
 Optimal Solution: In optimization problems, the optimal solution is the best possible
solution.
Typesofbacktracking
problems
Problems associated with backtracking can be
categorized into 3
categories:
 Decision Problems: Here, we search for a feasible
solution.
 Optimization Problems: For this type, we search for
the best solution.
 Enumeration Problems: We find set of all possible
feasible solutions to the problems of this type.
Applicationsof
backtracking
 Creating smart bots to play Board Games such as
Chess.
 Solving mazes and puzzles such as N-Queen problem.
 Network Routing and Congestion Control.
 Decryption
 Text Justification
EXAMPLE
We start with a start node. First, we move to node A. Since it
is not a feasible solution so we move to the next node, i.e., B is
also not a feasible solution, and it is a dead-end so we backtrack
from node B to node A.
Suppose another path exists from node A to node C. So, we
move from node A to node C. It is also a dead-end, so again
backtrack from node C to node A. We move from node A to the
starting node.
Now we will check any other path exists from the starting node. So, we move
from start node to the node D. Since it is not a feasible solution so we move
from node D to node E. The node E is also not a feasible solution. It is a dead
end so we backtrack from node E to node D.
Suppose another path exists from node D to node F. So, we move from node
D to node F. Since it is not a feasible solution and it's a dead-end, we check
for another path from node F.
 Suppose there is another path exists from the node F to
node G so move from node F to node G. The node G is a
success node.
Thetermsrelatedto
thebacktrackingare
•Live node: The nodes that can be further generated are known
as live nodes.
•E node: The nodes whose children are being generated and
become a success node.
•Success node: The node is said to be a success node if it provides
a feasible solution.
•Dead node: The node which cannot be further generated and
also does not provide a feasible solution is known as a dead node.
Many problems can be solved by backtracking strategy, and that
problems satisfy complex set of constraints, and these
constraints are of two types:
•Implicit constraint: It is a rule in which how each element in a
tuple is related.
•Explicit constraint: The rules that restrict each element to be
chosen from the given set.

More Related Content

DOCX
Adsa u2 ver 1.0.
PPTX
Unit ii-ppt
PPTX
Backtracking in Data Structure and Algorithm
PPTX
heuristic technique.pptx...............................
PPTX
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
PPTX
Daa unit 1
PDF
Daa chapter4
PPTX
Linear Programming Quiz
Adsa u2 ver 1.0.
Unit ii-ppt
Backtracking in Data Structure and Algorithm
heuristic technique.pptx...............................
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
Daa unit 1
Daa chapter4
Linear Programming Quiz

Similar to General methodin Data Structure for UG.pptx (20)

PDF
unit 4 of Unit 4 of design and analysis of algorithms
PPTX
Undecidable Problems and Approximation Algorithms
PPT
Ap Power Point Chpt8
PPTX
Python first year btech Algorithmic thinking with python
PPTX
Branch-and-Bound Algorithm presentation paradigm
PPT
Greedy algorithm
DOCX
Searching techniques
PPT
35 algorithm-types
PDF
Disign and Analysis for algorithm in computer science and technology
PPTX
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
PPTX
it is a ppt discussing important topic of daa such as branch and bound.pptx
PPTX
CH-1.1 Introduction (1).pptx
PPT
Backtracking
PPTX
Algorithm and flowchart with pseudo code
PPTX
Linear mixed integer programs for chemical engineering
PPTX
Constraint satisfaction problems (csp)
PPTX
Y11 m02 networks
PPTX
Lecture 12 Heuristic Searches
PPTX
DAA-Module-5.pptx
PPT
Design and Analysis of algorithms unit 1 notes
unit 4 of Unit 4 of design and analysis of algorithms
Undecidable Problems and Approximation Algorithms
Ap Power Point Chpt8
Python first year btech Algorithmic thinking with python
Branch-and-Bound Algorithm presentation paradigm
Greedy algorithm
Searching techniques
35 algorithm-types
Disign and Analysis for algorithm in computer science and technology
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
it is a ppt discussing important topic of daa such as branch and bound.pptx
CH-1.1 Introduction (1).pptx
Backtracking
Algorithm and flowchart with pseudo code
Linear mixed integer programs for chemical engineering
Constraint satisfaction problems (csp)
Y11 m02 networks
Lecture 12 Heuristic Searches
DAA-Module-5.pptx
Design and Analysis of algorithms unit 1 notes
Ad

More from LakshmiSamivel (15)

PPT
Greedy Algorithm for Computer Science.ppt
PPTX
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
PPTX
DataSructure-Time and Space Complexity.pptx
PPTX
Basic Queue Operation in DataStructure.pptx
PPTX
Presentation DM.pptx
PPTX
Dos.pptx
PPTX
Formatting tags
PPTX
Classification of datastructure.ppt
PPTX
Top down parsing
PPTX
Semaphore
PPTX
Firewall ppt
PPTX
PPT
Procedures andcursors
PDF
Computer network notes
DOCX
OsI reference model
Greedy Algorithm for Computer Science.ppt
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
DataSructure-Time and Space Complexity.pptx
Basic Queue Operation in DataStructure.pptx
Presentation DM.pptx
Dos.pptx
Formatting tags
Classification of datastructure.ppt
Top down parsing
Semaphore
Firewall ppt
Procedures andcursors
Computer network notes
OsI reference model
Ad

Recently uploaded (20)

PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PPTX
Cell Structure & Organelles in detailed.
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
Classroom Observation Tools for Teachers
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Yogi Goddess Pres Conference Studio Updates
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Updated Idioms and Phrasal Verbs in English subject
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
01-Introduction-to-Information-Management.pdf
Cell Types and Its function , kingdom of life
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
2.FourierTransform-ShortQuestionswithAnswers.pdf
Microbial disease of the cardiovascular and lymphatic systems
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
UNIT III MENTAL HEALTH NURSING ASSESSMENT
Cell Structure & Organelles in detailed.
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Classroom Observation Tools for Teachers
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Yogi Goddess Pres Conference Studio Updates
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Updated Idioms and Phrasal Verbs in English subject

General methodin Data Structure for UG.pptx

  • 2. Introductionof backtracking  Backtracking can be defined as a general algorithmic technique that considers searching every possible combination in order to solve a computational problem.
  • 3. Introductionof backtracking algorithm  Backtracking is an algorithmic technique for solving problems recursively by trying to build a solution incrementally, one piece at a time, removing those solutions that fail to satisfy the constraints of the problem at any point of time (by time, here, is referred to the time elapsed till reaching any level of the search tree).
  • 4. Basic terminologies  Candidate: A candidate is a potential choice or element that can be added to the current solution.  Solution: The solution is a valid and complete configuration that satisfies all problem constraints.  Partial Solution: A partial solution is an intermediate or incomplete configuration being constructed during the backtracking process.  Decision Space: The decision space is the set of all possible candidates or choices at each decision point.  Decision Point: A decision point is a specific step in the algorithm where a candidate is chosen and added to the partial solution.
  • 5.  Feasible Solution: A feasible solution is a partial or complete solution that adheres to all constraints.  Dead End: A dead end occurs when a partial solution cannot be extended without violating constraints.  Backtrack: Backtracking involves undoing previous decisions and returning to a prior decision point.  Search Space: The search space includes all possible combinations of candidates and choices.  Optimal Solution: In optimization problems, the optimal solution is the best possible solution.
  • 6. Typesofbacktracking problems Problems associated with backtracking can be categorized into 3 categories:  Decision Problems: Here, we search for a feasible solution.  Optimization Problems: For this type, we search for the best solution.  Enumeration Problems: We find set of all possible feasible solutions to the problems of this type.
  • 7. Applicationsof backtracking  Creating smart bots to play Board Games such as Chess.  Solving mazes and puzzles such as N-Queen problem.  Network Routing and Congestion Control.  Decryption  Text Justification
  • 8. EXAMPLE We start with a start node. First, we move to node A. Since it is not a feasible solution so we move to the next node, i.e., B is also not a feasible solution, and it is a dead-end so we backtrack from node B to node A. Suppose another path exists from node A to node C. So, we move from node A to node C. It is also a dead-end, so again backtrack from node C to node A. We move from node A to the starting node.
  • 9. Now we will check any other path exists from the starting node. So, we move from start node to the node D. Since it is not a feasible solution so we move from node D to node E. The node E is also not a feasible solution. It is a dead end so we backtrack from node E to node D. Suppose another path exists from node D to node F. So, we move from node D to node F. Since it is not a feasible solution and it's a dead-end, we check for another path from node F.
  • 10.  Suppose there is another path exists from the node F to node G so move from node F to node G. The node G is a success node.
  • 11. Thetermsrelatedto thebacktrackingare •Live node: The nodes that can be further generated are known as live nodes. •E node: The nodes whose children are being generated and become a success node. •Success node: The node is said to be a success node if it provides a feasible solution. •Dead node: The node which cannot be further generated and also does not provide a feasible solution is known as a dead node. Many problems can be solved by backtracking strategy, and that problems satisfy complex set of constraints, and these constraints are of two types: •Implicit constraint: It is a rule in which how each element in a tuple is related. •Explicit constraint: The rules that restrict each element to be chosen from the given set.