Design and Analysis of Algorithms - Chapter 111 How to tackle those difficult problems... There are two principal approaches to tackling NP-hard problems.

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.
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
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.
MAE 552 – Heuristic Optimization Lecture 26 April 1, 2002 Topic:Branch and Bound.
24-Jun-15 Pruning. 2 Exponential growth How many leaves are there in a complete binary tree of depth N? This is easy to demonstrate: Count “going left”
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.
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.
Distributed Constraint Optimization Michal Jakob Agent Technology Center, Dept. of Computer Science and Engineering, FEE, Czech Technical University A4M33MAS.
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.
For Wednesday Read Weiss, chapter 12, section 2 Homework: –Weiss, chapter 10, exercise 36 Program 5 due.
Chapter 12 Coping with the Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
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.
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.
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.
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
알고리즘 설계 및 분석 Foundations of Algorithm 유관우. Digital Media Lab. 2 Chap. 5 Backtracking (Eg) 큰 성 (castle)- 수 백 개의 방 (rooms) 그리고 “Sleeping Beauty” Systematic.
CS 721 Project Implementation of Hypergraph Edge Covering Algorithms By David Leung ( )
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:

Design and Analysis of Algorithms - Chapter 111 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

Design and Analysis of Algorithms - Chapter 112 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

Design and Analysis of Algorithms - Chapter 113 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

Design and Analysis of Algorithms - Chapter 114 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

Design and Analysis of Algorithms - Chapter 115 State-space of the four-queens problem

Design and Analysis of Algorithms - Chapter 116 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

Design and Analysis of Algorithms - Chapter 117 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”

Design and Analysis of Algorithms - Chapter 118 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

Design and Analysis of Algorithms - Chapter 119 Assignment problem: lower bounds

Design and Analysis of Algorithms - Chapter 1110 State-space levels 0, 1, 2

Design and Analysis of Algorithms - Chapter 1111 Complete state-space

Design and Analysis of Algorithms - Chapter 1112 Traveling salesman example: