Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
MinaksheePatil
78 views
32 slides
Jul 12, 2024
Slide 1 of 32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
About This Presentation
N-queens problem, sum of subsets, graph coloring and hamiltonian circuit problem using backtracking
Size: 749.29 KB
Language: en
Added: Jul 12, 2024
Slides: 32 pages
Slide Content
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
Formulation of Backtracking process
N-Queen Problem
N-Queen Problem
SUM OF SUBSET
GRAPH COLORING
HAMILTONIAN CYCLES
Example Find the all possible Hamiltonian cycle by using the backtracking approach for a given graph. Draw portion of state space tree generated