際際滷

際際滷Share 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.
Ad

Recommended

Adsa u2 ver 1.0.
Adsa u2 ver 1.0.
Dr. C.V. Suresh Babu
Unit ii-ppt
Unit ii-ppt
Aravindharamanan S
Backtracking in Data Structure and Algorithm
Backtracking in Data Structure and Algorithm
GopalChandraHaldar
heuristic technique.pptx...............................
heuristic technique.pptx...............................
gursharansinghmavi20
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
B.T.L.I.T
Daa unit 1
Daa unit 1
jinalgoti
Daa chapter4
Daa chapter4
B.Kirron Reddi
Linear Programming Quiz
Linear Programming Quiz
Swatanu Satpathy
Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation Algorithms
Muthu Vinayagam
Unit 2 AI.pptxUnit 2 AI.pptxUnit 2 AI.pptx
Unit 2 AI.pptxUnit 2 AI.pptxUnit 2 AI.pptx
trwdcn
Ap Power Point Chpt8
Ap Power Point Chpt8
dplunkett
Python first year btech Algorithmic thinking with python
Python first year btech Algorithmic thinking with python
FahmaFamzin
Greedy algorithm
Greedy algorithm
CHANDAN KUMAR
Searching techniques
Searching techniques
Prof.Dharmishtha R. Chaudhari
35 algorithm-types
35 algorithm-types
Kislay Bhardwaj L|PT,ECSA,C|EH
Disign and Analysis for algorithm in computer science and technology
Disign and Analysis for algorithm in computer science and technology
ritikkumarchaudhury7
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
muthukrishnavinayaga
it is a ppt discussing important topic of daa such as branch and bound.pptx
it is a ppt discussing important topic of daa such as branch and bound.pptx
rajbaibhav004
CH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptx
satvikkushwaha1
Backtracking
Backtracking
Vikas Sharma
Algorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo code
hamza javed
Linear mixed integer programs for chemical engineering
Linear mixed integer programs for chemical engineering
AvaniTaiwade
Constraint satisfaction problems (csp)
Constraint satisfaction problems (csp)
Archana432045
Y11 m02 networks
Y11 m02 networks
Xu Wei
Lecture 12 Heuristic Searches
Lecture 12 Heuristic Searches
Hema Kashyap
DAA-Module-5.pptx
DAA-Module-5.pptx
smithashetty24
Design and Analysis of algorithms unit 1 notes
Design and Analysis of algorithms unit 1 notes
sangeja1
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
MAJDABDALLAH3
Greedy Algorithm for Computer Science.ppt
Greedy Algorithm for Computer Science.ppt
LakshmiSamivel
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
LakshmiSamivel

More Related Content

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

Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation Algorithms
Muthu Vinayagam
Unit 2 AI.pptxUnit 2 AI.pptxUnit 2 AI.pptx
Unit 2 AI.pptxUnit 2 AI.pptxUnit 2 AI.pptx
trwdcn
Ap Power Point Chpt8
Ap Power Point Chpt8
dplunkett
Python first year btech Algorithmic thinking with python
Python first year btech Algorithmic thinking with python
FahmaFamzin
Greedy algorithm
Greedy algorithm
CHANDAN KUMAR
Searching techniques
Searching techniques
Prof.Dharmishtha R. Chaudhari
35 algorithm-types
35 algorithm-types
Kislay Bhardwaj L|PT,ECSA,C|EH
Disign and Analysis for algorithm in computer science and technology
Disign and Analysis for algorithm in computer science and technology
ritikkumarchaudhury7
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
muthukrishnavinayaga
it is a ppt discussing important topic of daa such as branch and bound.pptx
it is a ppt discussing important topic of daa such as branch and bound.pptx
rajbaibhav004
CH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptx
satvikkushwaha1
Backtracking
Backtracking
Vikas Sharma
Algorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo code
hamza javed
Linear mixed integer programs for chemical engineering
Linear mixed integer programs for chemical engineering
AvaniTaiwade
Constraint satisfaction problems (csp)
Constraint satisfaction problems (csp)
Archana432045
Y11 m02 networks
Y11 m02 networks
Xu Wei
Lecture 12 Heuristic Searches
Lecture 12 Heuristic Searches
Hema Kashyap
DAA-Module-5.pptx
DAA-Module-5.pptx
smithashetty24
Design and Analysis of algorithms unit 1 notes
Design and Analysis of algorithms unit 1 notes
sangeja1
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
MAJDABDALLAH3
Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation Algorithms
Muthu Vinayagam
Unit 2 AI.pptxUnit 2 AI.pptxUnit 2 AI.pptx
Unit 2 AI.pptxUnit 2 AI.pptxUnit 2 AI.pptx
trwdcn
Ap Power Point Chpt8
Ap Power Point Chpt8
dplunkett
Python first year btech Algorithmic thinking with python
Python first year btech Algorithmic thinking with python
FahmaFamzin
Disign and Analysis for algorithm in computer science and technology
Disign and Analysis for algorithm in computer science and technology
ritikkumarchaudhury7
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
muthukrishnavinayaga
it is a ppt discussing important topic of daa such as branch and bound.pptx
it is a ppt discussing important topic of daa such as branch and bound.pptx
rajbaibhav004
CH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptx
satvikkushwaha1
Algorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo code
hamza javed
Linear mixed integer programs for chemical engineering
Linear mixed integer programs for chemical engineering
AvaniTaiwade
Constraint satisfaction problems (csp)
Constraint satisfaction problems (csp)
Archana432045
Y11 m02 networks
Y11 m02 networks
Xu Wei
Lecture 12 Heuristic Searches
Lecture 12 Heuristic Searches
Hema Kashyap
Design and Analysis of algorithms unit 1 notes
Design and Analysis of algorithms unit 1 notes
sangeja1
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
MAJDABDALLAH3

More from LakshmiSamivel (15)

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

Recently uploaded (20)

Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
The Man In The Back Exceptional Delaware.pdf
The Man In The Back Exceptional Delaware.pdf
dennisongomezk
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
How to Create an Event in Odoo 18 - Odoo 18 際際滷s
How to Create an Event in Odoo 18 - Odoo 18 際際滷s
Celine George
Overview of Employee in Odoo 18 - Odoo 際際滷s
Overview of Employee in Odoo 18 - Odoo 際際滷s
Celine George
ICT-8-Module-REVISED-K-10-CURRICULUM.pdf
ICT-8-Module-REVISED-K-10-CURRICULUM.pdf
penafloridaarlyn
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
Overview of Off Boarding in Odoo 18 Employees
Overview of Off Boarding in Odoo 18 Employees
Celine George
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
Paper 107 | From Watchdog to Lapdog: Ishiguros Fiction and the Rise of Godi...
Paper 107 | From Watchdog to Lapdog: Ishiguros Fiction and the Rise of Godi...
Rajdeep Bavaliya
Introduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdf
TechSoup
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
Paper 109 | Archetypal Journeys in Interstellar: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in Interstellar: Exploring Universal Themes...
Rajdeep Bavaliya
Nice Dream.pdf /
Nice Dream.pdf /
ErinUsher3
JHS SHS Back to School 2024-2025 .pptx
JHS SHS Back to School 2024-2025 .pptx
melvinapay78
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
The Man In The Back Exceptional Delaware.pdf
The Man In The Back Exceptional Delaware.pdf
dennisongomezk
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
How to Create an Event in Odoo 18 - Odoo 18 際際滷s
How to Create an Event in Odoo 18 - Odoo 18 際際滷s
Celine George
Overview of Employee in Odoo 18 - Odoo 際際滷s
Overview of Employee in Odoo 18 - Odoo 際際滷s
Celine George
ICT-8-Module-REVISED-K-10-CURRICULUM.pdf
ICT-8-Module-REVISED-K-10-CURRICULUM.pdf
penafloridaarlyn
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
Overview of Off Boarding in Odoo 18 Employees
Overview of Off Boarding in Odoo 18 Employees
Celine George
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
Paper 107 | From Watchdog to Lapdog: Ishiguros Fiction and the Rise of Godi...
Paper 107 | From Watchdog to Lapdog: Ishiguros Fiction and the Rise of Godi...
Rajdeep Bavaliya
Introduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdf
TechSoup
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
Paper 109 | Archetypal Journeys in Interstellar: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in Interstellar: Exploring Universal Themes...
Rajdeep Bavaliya
Nice Dream.pdf /
Nice Dream.pdf /
ErinUsher3
JHS SHS Back to School 2024-2025 .pptx
JHS SHS Back to School 2024-2025 .pptx
melvinapay78
Ad

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.