This action might not be possible to undo. Are you sure you want to continue?

Welcome to Scribd! Start your free trial and access books, documents and more.Find out more

Backtracking [1] It is used to find all possible solutions available to the problem. [2] It traverse tree by DFS(Depth First Search). [3] It realizes that it has made a bad choice & undoes the last choice by backing up. [4] It search the state space tree until it found a solution. [5] It involves feasibility function. Branch-and-Bound (BB) [1] It is used to solve optimization problem. [2] It may traverse the tree in any manner, DFS or BFS. [3] It realizes that it already has a better optimal solution that the pre-solution leads to so it abandons that pre-solution. [4] It completely searches the state space tree to get optimal solution. [5] It involves bounding function. The difference between branch-&-bound and backtracking is used for optimization problem does not limit us to a particular way of traversing the tree We compute a number at a node to determine whether the node is promising. If that bound is no better than the value of the best solution found so far, the node is nonpromising. breadth-first search (queue) Algorithm in page 224 Figure 6.1 best-first search (priority queue)：we can compare the bounds of promising nodes and visit the children of the one with the best bound. best-first search with branch-&-bound pruning breadth-first search with branch-&-bound pruning

NIT 4 : Backtracking and Branch and Bound Backtracking – N Queen’s problem – Hamiltonian circuit problem – Subset sum problem – Branch and Bound – Assignment problem – Knapsack problem – Traveling salesman problem. Two marks: 1. What are the state space algorithms? Backtracking and Branch-and-bound are called state-space algorithms as they generate state-space tree while solving the problem. 2. What are the differences between exhaustive search method and state-space algorithms? State-space algorithms make it possible to solve some larger instances of difficult combinatorial problems. Unlike exhaustive search, state-space algorithms generate candidate solutions one component at a time and evaluate the partially constructed solutions. If no potential values of the remaining components can lead to a solution, the remaining components are not generated at all. 3. What are the differences between backtracking and branch-and-bound methods?

i]) //Gives a template of a generic backtracking algorithm. //Output : All the tuples representing the problems solutions. and evaluate such partially constructed candidates as: ¨ If a partially constructed solution can be developed further without violating the problem’s constraints. Otherwise.. Backtracking generates tree by depth-first rule. If X[1. Define Backtracking. N-Queen’s problem is to place n-queens on an n x n chessboard. Draw the backtracking tree to find the subset. Result: {1. (ii) Branch-and-bound generates nodes by Best-first rule. ¨ If there is no legitimate option for the next component. What is a state-space tree? The tree construted to implement backtracking with the choices for the components is called the statespace tree. Backtracking is the technique that constructs one component at a time. Algorithm Backtrack(X[1. 7.. the algorithm backtracks to replace the last component of the partially constructed solution with its next option.(i) Branch-and-Bound algorithms can be applied only to optimization problems. //Input : X[1. A subset sum problem finds a subset of a given set S={s1.i] specifies first I promising components of a solution. 9. whose sum is equal to a given positive integer d. if it corresponds to a partially constructed solution that may still lead to complete solution.4}. 6. What is a subset sum problem? Find the subset from the set S={1. Write the general algorithm for backtracking. What is N-Queen’s problem? Give any one solution to 6-Queen’s problem. 5. One of the solutions to 6-Queen’s problem is Q Q Q Q Q Q 8.3. no alternatives for any remaining component need to be considered.. What is a Hamiltonian circuit? A Hamiltonian circuit in a graph is the path that starts and ends at the same vertex and passes through all the other vertices exactly once. Backtracking is more often not applied to non-optimization. such that no two queens attack each other by being in the same row or in the same column or on the same diagonal..sn}of n positive integers.4}. What is promising and non-promising node? A node in state-space tree is said to be promising.s2.2.i] is a solution write X[1. taking the first remaining legitimate option for the next component does it. 10. 4. for the sum d=7 using backtracking.i] .2. In this case. Its root represents initial state before the search for a solution and the nodes at each level represent the choices made for the corresponding component of a solution.4}... {3. that node is non-promising.

Find the sum Si of the distances from city i to the nearest cities.. State the difference between branch and bound and backtracking. 12. the steps are: · Order the items given in descending order. Divide S by 2 to find lower bound.w2. The cost of assigning ith person to jth job is C[i. (6). The state-space tree provides the nodes which are bound on the best value of the objective function on any solution. The capacity of Knapsack is W..j]. 16. Find the most valuable subset of items.else for each element x ε Si+1 consistent with X[1.Compute sum S of these n numbers. What are the reasons for terminating search path at current node in the state-space tree? · The value of the nodes bound is not better than the value of the best solution seen so far. so that the total cost of the assignment is as small as possible. by their value-to-weight ratios. if the node is left child.v2. otherwise exclusion of the item. 15. To compute lower bound. · Construct the state-space tree as binary tree. it computes the lower bound. Explain Branch-and-bound method. The branch-and-bound method uses the state-space tree. An optimal solution is a feasible solution. Travelling salesman problem as it finds the shortest tour. · To solve branch-and-bound problem. It considers the lower bound for minimization problem and the upper bound for maximization problem. 16 Marks: 1. What is Assignment problem? The Assignment problem assign n people to n jobs. What is a feasible solution and optimal solution? A feasible solution is a point in the problem’s state-space that satisfies all the problem’s constraints. What is travelling salesman problem? How it could be solved using branch-and-bound technique? The travelling salesman problem is to find the shortest tour through a given set of n cities that visits each city exactly once before returning to the city where it started. What is Knapsack problem? How it could be solved by branch-and-bound problems? There are n items of known weights w1. · The node represents no feasible solutions. because the constraints of the problem are already violated.. Set a constraint such that any city should be visited before another. 14. The result is the value of the best solution obtained so far. . · The subset of feasible solutions represented by the node consists of a single point – here we compare the value of the objective function for this feasible solution with that of the best solution seen so far and update the latter with the former. that fit into knapsack.. That is. 13. Hints : Refer Question two marks 3 – Minimization problem – Maximization problem – Steps for Branch and bound – Steps for Backtracking. The non-promising nodes will be terminated if no solution obtained from it can yield better solution than the one already available.vn.wn and the values are v1. And write about minimization and maximization problems.i+1]) 11. with the best value of the objective function. there are n people who need to be assigned to execute n jobs. Each node on ith level indicate inclusion of item to the set. This reduces more work in generating all-pairs of permutations. Find the assignment with the smallest total cost.i] and the constraints do X[i+1] ß x Backtrack (X[1. one person per job. that can be obtained by adding further components to the partial solution represented by the node. if the new solution is better.

whose sum will be equivalent to d= 13.Draw the subset sum tree using backtracking – Explain the steps – Conclusion.Queen’s problem and Write the steps for solving it using backtracking.General algorithm of backtracking -Draw backtracking tree – Explain the steps – Write the conclusion. 9. find the subsets. For the following cost matrix. ABCDEF A010010 B101010 C010111 D001010 E111101 F001010 Hints : Explain Hamiltonian circuit – Draw the Graph from the adjacency matrix.Write about backtracking. Find the Hamiltonian circuit for the graph corresponding to the following adjacency matrix and explain about the steps in detail. For the given subset S= { 1. with branch and bound technique. Hints : Problem description for subset-sum problem – Write about backtracking – General algorithm of backtracking . 13}.2. Job1 Job2 Job3 Job4 7 3 2 6 Person1 5 2 6 8 Person2 2 5 1 4 Person3 4 6 2 3 Person4 Hints : Problem description for Job assignment problem – Write about branch and bound problem – Explain the steps for solving minimization problem – Draw state-space tree – Conclusion. 3. Item no Weight Value 1 4 $40 2 3 $12 3 1 $15 4 2 $40 . Hints: Problem description of n-queen’s problem – Write about backtracking – General algorithm of backtracking -Draw state space tree of 8-Queen’s problem till any two solutions is found – Explain the steps done to find the solution. 3. 5. 7. 6. If there is a Knapsack of capacity W= 6 and the weights and values of the items are mentioned as below. solve the knapsack problem. Write any two solutions for 8. assign job to 4 persons. 4.

- sm
- apple suppliers list.pdf
- Life Cycle
- future_of_hr.pdf
- Product Life Cycle
- Multicultural Team
- Perception _OB
- Ost-kerala Solar Energy Policy 2013
- artificial intelligence
- GT-2
- Exhaustive Software to Use in TGMC 2012
- Scenario Template
- What is Difference Between Backtracking and Branch and Bound Method
- Untitled
- Untitled
- AssignmentII

DAA

DAA

- DAA 5
- 253.pdf
- ch11
- Optimal-Storage-on-Tapes
- ch13-bw.pdf
- HAMITONIAN CIRCUITS (Using Backtracking Method)
- daa
- CN Lab Manual MIT
- Daa
- Design and Analysis of Algorithms
- Backtracking+8 queen problem
- branch and bound
- Submodular Set Function - Wikipedia
- Branch And Bound Design And Analysis Of Alogorithm
- Gp 1
- NoSQL Distilled a Brief Guide to the Emerging World of Polyglot
- transportation problem
- ACD-11..
- Statistics and Probability Solved Assignments - Semester Fall 2008
- [Stuart E. Madnick, John J. Donovan] Operating Sys(Bookos.org)
- Measures of Central Tendency
- Lower Bound Theory
- 3.1 Lecture_remark.pdf
- Hamacher - Computer Organization (5th Ed)
- Guidelines for MTO
- SYSTEM SOFTWARE NOTES 5TH SEM VTU
- CCP303
- Con Currency Control
- PAnel Output
- Discrete Mathematics for Computer Science

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue listening from where you left off, or restart the preview.

scribd