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

MinaksheePatil 78 views 32 slides Jul 12, 2024
Slide 1
Slide 1 of 32
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32

About This Presentation

N-queens problem, sum of subsets, graph coloring and hamiltonian circuit problem using backtracking


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
Tags