Chapter 12 Coping with the Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.

Slides:



Advertisements
Similar presentations
Types of Algorithms.
Advertisements

Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
Techniques for Dealing with Hard Problems Backtrack: –Systematically enumerates all potential solutions by continually trying to extend a partial solution.
5-1 Chapter 5 Tree Searching Strategies. 5-2 Satisfiability problem Tree representation of 8 assignments. If there are n variables x 1, x 2, …,x n, then.
Branch & Bound Algorithms
September 26, 2012Introduction to Artificial Intelligence Lecture 7: Search in State Spaces I 1 After our “Haskell in a Nutshell” excursion, let us move.
Eight queens puzzle. The eight queens puzzle is the problem of placing eight chess queens on an 8×8 chessboard such that none of them are able to capture.
S. J. Shyu Chap. 1 Introduction 1 The Design and Analysis of Algorithms Chapter 1 Introduction S. J. Shyu.
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Branch and Bound Searching Strategies
6 - 1 § 6 The Searching Strategies e.g. satisfiability problem x1x1 x2x2 x3x3 FFF FFT FTF FTT TFF TFT TTF TTT.
Branch and Bound Similar to backtracking in generating a search tree and looking for one or more solutions Different in that the “objective” is constrained.
Chapter 8 Dynamic Programming Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
MAE 552 – Heuristic Optimization Lecture 26 April 1, 2002 Topic:Branch and Bound.
1 Branch and Bound Searching Strategies 2 Branch-and-bound strategy 2 mechanisms: A mechanism to generate branches A mechanism to generate a bound so.
Ch 13 – Backtracking + Branch-and-Bound
1 Tree Searching Strategies. 2 The procedure of solving many problems may be represented by trees. Therefore the solving of these problems becomes a tree.
Backtracking Reading Material: Chapter 13, Sections 1, 2, 4, and 5.
Games & Adversarial Search Chapter 6 Section 1 – 4.
5-1 Chapter 5 Tree Searching Strategies. 5-2 Breadth-first search (BFS) 8-puzzle problem The breadth-first search uses a queue to hold all expanded nodes.
Jin Zheng, Central South University1 Branch-and-bound.
Chapter 12 Coping with the Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Backtracking.
ECE669 L10: Graph Applications March 2, 2004 ECE 669 Parallel Computer Architecture Lecture 10 Graph Applications.
CSE 589 Applied Algorithms Spring Colorability Branch and Bound.
1 Adversary Search Ref: Chapter 5. 2 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans.
Busby, Dodge, Fleming, and Negrusa. Backtracking Algorithm Is used to solve problems for which a sequence of objects is to be selected from a set such.
Search.
Dr. Jouhaina Chaouachi Siala
Artificial Intelligence Lecture 9. Outline Search in State Space State Space Graphs Decision Trees Backtracking in Decision Trees.
Chapter 12 Coping with the Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Formal Description of a Problem In AI, we will formally define a problem as –a space of all possible configurations where each configuration is called.
Backtracking. N-Queens The object is to place queens on a chess board in such a way as no queen can capture another one in a single move –Recall that.
Design and Analysis of Algorithms - Chapter 111 How to tackle those difficult problems... There are two principal approaches to tackling NP-hard problems.
For Wednesday Read Weiss, chapter 12, section 2 Homework: –Weiss, chapter 10, exercise 36 Program 5 due.
BackTracking CS335. N-Queens The object is to place queens on a chess board in such as way as no queen can capture another one in a single move –Recall.
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
1 Tackling Difficult Combinatorial Problems There are two principal approaches to tackling difficult combinatorial problems (NP-hard problems): b Use a.
Search by partial solutions.  nodes are partial or complete states  graphs are DAGs (may be trees) source (root) is empty state sinks (leaves) are complete.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
1 Branch and Bound Searching Strategies Updated: 12/27/2010.
COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Divide and Conquer Optimization problem: z = max{cx : x  S}
Types of Algorithms. 2 Algorithm classification Algorithms that use a similar problem-solving approach can be grouped together We’ll talk about a classification.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 13: Graphs Data Abstraction & Problem Solving with C++
Backtracking & Brute Force Optimization Intro2CS – weeks
Search in State Spaces Problem solving as search Search consists of –state space –operators –start state –goal states A Search Tree is an efficient way.
© 2006 Pearson Addison-Wesley. All rights reserved 6-1 Chapter 6 Recursion as a Problem- Solving Technique.
Chapter 13 Backtracking Introduction The 3-coloring problem
CSCE350 Algorithms and Data Structure Lecture 21 Jianjun Hu Department of Computer Science and Engineering University of South Carolina
February 11, 2016Introduction to Artificial Intelligence Lecture 6: Search in State Spaces II 1 State-Space Graphs There are various methods for searching.
ICS 353: Design and Analysis of Algorithms Backtracking King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Prabhas Chongstitvatana 1 Backtracking Eight queens problem 1 try all possible C 64 8 = 4,426,165,368 2 never put more than one queen on a given row, vector.
Branch and Bound Searching Strategies
Brute Force and Exhaustive Search Brute Force and Exhaustive Search Traveling Salesman Problem Knapsack Problem Assignment Problem Selection Sort and Bubble.
Unit – 5: Backtracking For detail discussion, students are advised to refer the class discussion.
BackTracking CS255.
Types of Algorithms.
Back Tracking.
Types of Algorithms.
Branch and Bound.
Applied Combinatorics, 4th Ed. Alan Tucker
Chapter 12 Coping with the Limitations of Algorithm Power
Pruning 24-Feb-19.
Backtracking and Branch-and-Bound
Types of Algorithms.
Unit –VII Coping with limitations of algorithm power.
ICS 353: Design and Analysis of Algorithms
Major Design Strategies
Major Design Strategies
Presentation transcript:

Chapter 12 Coping with the Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter How to tackle those difficult problems... There are two principal approaches to tackling NP-hard problems or other “intractable” problems: b Use a strategy that guarantees solving the problem exactly but doesn’t guarantee to find a solution in polynomial time b Use an approximation algorithm that can find an approximate (sub-optimal) solution in polynomial time

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter Exact solutions The exact solution approach includes the strategies: b exhaustive search (brute force) useful only for small instancesuseful only for small instances b backtracking eliminates some cases from considerationeliminates some cases from consideration b branch-and-bound further cuts down on the searchfurther cuts down on the search fast solutions for most instancesfast solutions for most instances worst case is still exponentialworst case is still exponential

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter Backtracking b Construct the state space tree: nodes: partial solutionsnodes: partial solutions edges: choices in completing solutionsedges: choices in completing solutions b Explore the state space tree using depth-first search b “Prune” non-promising nodes dfs stops exploring subtree rooted at nodes leading to no solutions and...dfs stops exploring subtree rooted at nodes leading to no solutions and... “backtracks” to its parent node“backtracks” to its parent node

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter Example: The n-Queen problem b Place n queens on an n by n chess board so that no two of them are on the same row, column, or diagonal

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter State-space of the four-queens problem

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter Example: The m-coloring problem b Given a graph and an integer m, color its vertices using no more than m colors so that no two adjacent vertices are the same color. cd a eb

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter Branch and Bound b An enhancement of backtracking b Applicable to optimization problems b Uses a lower bound for the value of the objective function for each node (partial solution) so as to: guide the search through state-space guide the search through state-space rule out certain branches as “unpromising” rule out certain branches as “unpromising”

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter Select one element in each row of the cost matrix C so that: no two selected elements are in the same column; and no two selected elements are in the same column; and the sum is minimized the sum is minimized For example: Job 1Job 2Job 3Job 4 Person a Person b Person c Person d Lower bound: Any solution to this problem will have total cost of at least: Example: The assignment problem

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter Assignment problem: lower bounds

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter State-space levels 0, 1, 2

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter Complete state-space

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter

Copyright © 2007 Pearson Addison-Wesley. All rights reserved Design and Analysis of Algorithms - Chapter Traveling salesman example: