6 - 1 § 6 The Searching Strategies e.g. satisfiability problem x1x1 x2x2 x3x3 FFF FFT FTF FTT TFF TFT TTF TTT.

Slides:



Advertisements
Similar presentations
Chapter 4: Informed Heuristic Search
Advertisements

Algorithm Design Methods Spring 2007 CSE, POSTECH.
Informed search algorithms
Artificial Intelligence Chapter 9 Heuristic Search Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
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.
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
Branch & Bound Algorithms
CS 484 – Artificial Intelligence1 Announcements Department Picnic: today, after class Lab 0 due today Homework 2 due Tuesday, 9/18 Lab 1 due Thursday,
1 Tree Searching Strategies Updated: 2010/12/27. 2 The procedure of solving many problems may be represented by trees. Therefore the solving of these.
EIE426-AICV 1 Blind and Informed Search Methods Filename: eie426-search-methods-0809.ppt.
Search in AI.
Chapter 3 The Greedy Method 3.
Review: Search problem formulation
Branch and Bound Searching Strategies
Using Search in Problem Solving
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.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
1 -1 Chapter 1 Introduction Why Do We Need to Study Algorithms? To learn strategies to design efficient algorithms. To understand the difficulty.
Dealing with NP-Complete Problems
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.
Find a Path s A D B E C F G Heuristically Informed Methods  Which node do I expand next?  What information can I use to guide this.
Problem Solving and Search in AI Heuristic Search
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.
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.
Linear Programming Applications
1 Structures and Strategies for State Space Search 3 3.0Introduction 3.1Graph Theory 3.2Strategies for State Space Search 3.3Using the State Space to Represent.
Backtracking.
1 Midterm Review cmsc421 Fall Outline Review the material covered by the midterm Questions?
1 Lecture 4 Maximal Flow Problems Set Covering Problems.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Informed Search Strategies
Problem Solving and Search Andrea Danyluk September 11, 2013.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Search.
Introduction to Job Shop Scheduling Problem Qianjun Xu Oct. 30, 2001.
CPS 270: Artificial Intelligence More search: When the path to the solution doesn’t matter Instructor: Vincent.
MODELING AND ANALYSIS OF MANUFACTURING SYSTEMS Session 12 MACHINE SETUP AND OPERATION SEQUENCING E. Gutierrez-Miravete Spring 2001.
Design and Analysis of Algorithms - Chapter 111 How to tackle those difficult problems... There are two principal approaches to tackling NP-hard problems.
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.
Today’s Topics FREE Code that will Write Your PhD Thesis, a Best-Selling Novel, or Your Next Methods for Intelligently/Efficiently Searching a Space.
Notes 5IE 3121 Knapsack Model Intuitive idea: what is the most valuable collection of items that can be fit into a backpack?
3 -1 Chapter 3 The Greedy Method 3 -2 A simple example Problem: Pick k numbers out of n numbers such that the sum of these k numbers is the largest.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
1 Branch and Bound Searching Strategies Updated: 12/27/2010.
Integer Linear Programming Terms Pure integer programming mixed integer programming 0-1 integer programming LP relaxation of the IP Upper bound O.F. Lower.
Algorithm Design Methods (II) Fall 2003 CSE, POSTECH.
COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Branch-and-Cut Valid inequality: an inequality satisfied by all feasible solutions Cut: a valid inequality that is not part of the current formulation.
Divide and Conquer Optimization problem: z = max{cx : x  S}
Basic Search Procedure 1. Start with the start node (root of the search tree) and place in on the queue 2. Remove the front node in the queue and If the.
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Search Techniques CS480/580 Fall Introduction Trees: – Root, parent, child, sibling, leaf node, node, edge – Single path from root to any node Graphs:
Ch22.Branch and Bound.
EMIS 8373: Integer Programming Column Generation updated 12 April 2005.
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
© The McGraw-Hill Companies, Inc., Chapter 1 Introduction.
Branch and Bound Searching Strategies
1 Tree Searching Strategies 2010/12/03. 2 The procedure of solving many problems may be represented by trees. Therefore the solving of these problems.
Artificial Intelligence Problem solving by searching CSC 361
Analysis and design of algorithm
Branch and Bound.
Branch and Bound Searching Strategies
Tree Searching Strategies
Lecture 4: Tree Search Strategies
Presentation transcript:

6 - 1 § 6 The Searching Strategies e.g. satisfiability problem x1x1 x2x2 x3x3 FFF FFT FTF FTT TFF TFT TTF TTT

6 - 2 Fig. 6-1 Tree Representation of Eight Assignments. If there are n variables x 1, x 2, …,x n, then there are 2 n possible assignments.

6 - 3 an instance: -x (1) x (2) x2 v x (3) x (4) -x (5) Fig. 6-2 A Partial Tree to Determine the Satisfiability Problem. We may not need to examine all possible assignments.

6 - 4 The breadth-first search e.g. 8-puzzle problem Fig A Search Tree Produced by a Breadth-First Search The breadth-first search uses a queue to holds all expanded nodes.

6 - 5 The depth-first search e.g. sum of subset problem S={7, 5, 1, 2, 10}  S’  S  sum of S’ = 9 ? Fig A Sum of Subset Problem Solved by Depth-First Search. A stack can be used to guide the depth-first search.

6 - 6 Hill climbing a variant of depth-first search The method selects the locally optimal node to expand. e.g. 8-puzzle problem evaluation function f(n) = d(n) + w(n) where d(n) is the depth of node n w(n) is # of misplaced tiles in node n.

6 - 7 Fig An 8-Puzzle Problem Solved by a Hill Climbing Method.

6 - 8 Best-first search strategy Combing depth-first search and breadth-first search. Selecting the node with the best estimated cost among all nodes. This method has a global view.

6 - 9 Fig An 8-Puzzle Problem Solved by a Best-First Search Scheme.

Best-First Search Scheme Step1:Form a one-element list consisting of the root node. Step2:Remove the first element from the list. Expand the first element. If one of the descendants of the first element is a goal node, then stop; otherwise, add the descendants into the list. Step3:Sort the entire list by the values of some estimation function. Step4:If the list is empty, then failure. Otherwise, go to Step 2.

The branch-and-bound strategy This strategy can be used to solve optimization problems. (DFS, BFS, hill climbing and best-first search can not be used to solve optimization problems.) e.g. Fig A Multi-Stage Graph Searching Problem.

Solved by branch-and-bound:

The personnel assignment problem a linearly ordered set of persons P={P 1, P 2, …, P n } where P 1 <P 2 <…<P n a partially ordered set of jobs J={J 1, J 2, …, J n } Suppose that P i and P j are assigned to jobs f(P i ) and f(P j ) respectively. If f(P i )  f(P j ), then P i  P j. Cost C ij is the cost of assigning P i to J j. We want to find a feasible assignment with the min. cost. i.e. X ij = 1 if P i is assigned to J j and X ij = 0 otherwise. Minimize  i,j C ij X ij

e.g. Fig A Partial Ordering of Jobs After topological sorting, one of the following topologically sorted sequences will be generated: one of feasible assignments: P 1 →J 1, P 2 →J 2, P 3 →J 3, P 4 →J 4 J1J1 J2J2 ↓ ↘ ↓ J3J3 J4J4 J1,J1,J2,J2,J3,J3,J4J4 J1,J1,J2,J2,J4,J4,J3J3 J1,J1,J3,J3,J2,J2,J4J4 J2,J2,J1,J1,J3,J3,J4J4 J2,J2,J1,J1,J4J4 J3J3

cost matrix: Table 6-1 A Cost Matrix for a Personnel Assignment Problem. Solution tree: Jobs Persons

Apply the best-first search scheme:

reduced cost matrix: subtract a constant from each row and each column respectively such that each row and each column contains at least one zero. Table 6-2 A Reduced Cost Matrix total cost subtracted: = 54 This is a lower bound of our solution. Jobs Persons (-12) 26102(-26) (-3) 48005(-10) (-3)

bounding of subsolutions:

The traveling salesperson optimization problem It is NP-complete e.g. cost matrix: Table 6-3 A Cost Matrix for a Traveling Salesperson Problem. j i ∞ ∞ ∞ ∞ ∞ ∞ ∞

Reduced cost matrix: Table 6-4 A Reduced Cost Matrix. j i ∞ (-3) 20∞ (-4) 3291∞200129(-16) ∞49084(-7) ∞032(-25) ∞4(-3) ∞(-26) reduced:84

Table 6-5 Another Reduced Cost Matrix. total cost reduced: = 96 (lower bound) j i ∞ ∞ ∞ ∞ ∞ ∞ ∞ (-7)(-1)(-4)

decision tree: Fig The Highest Level of a Decision Tree. If we use arc 3-5 to split, the difference on the lower bounds is 17+1 = 18.

Table 6-6 A Reduced Cost Matrix. If Arc 4-6 is Included. j i ∞ ∞ ∞ ∞ ∞ ∞

The cost matrix for all solution with arc 4-6: Table 6-7 A Reduced Cost Matrix for that in Table 6-6. total cost reduced: 96+3 = 99 (new lower bound) j i ∞ ∞ ∞ ∞25(-3) 60858∞ ∞

Fig 6-26 A Branch-and-Bound Solution of a Traveling Salesperson Problem.

The 0/1 knapsack problem positive integer P 1, P 2, …, P n (profit) W 1, W 2, …, W n (weight) M (capacity) maximize subject to X i = 0 or 1, i =1, …, n. The problem is modified: minimize

Fig The Branching Mechanism in the Branch-and-Bound Strategy to Solve 0/1 Knapsack Problem. e.g. n = 6, M = 34 a feasible solution: X 1 = 1, X 2 = 1, X 3 = 0, X 4 = 0, X 5 = 0, X 6 = 0 -(P 1 +P 2 ) = -16 (upper bound) Any solution higher than -16 can not be an optimal solution. i PiPi WiWi (P i /W i  P i+1 /W i+1 )

Relax our restriction from X i = 0 or 1 to 0  X i  1 (knapsack problem) Let be an optimal solution for 0/1 knapsack problem and be an optimal solution for knapsack problem. Let Y=, Y’ =.  Y’  Y

We can use the greedy method to find an optimal solution for knapsack problem: X 1 = 1, X 2 =1, X 3 = 5/8, X 4 = 0, X 5 = 0, X 6 =0 -(P 1 +P 2 +5/8P 3 ) = (lower bound) -18 is our lower bound. (only consider integers)  -18  optimal solution  -16 optimal solution: X 1 = 1, X 2 = 0, X 3 = 0, X 4 = 1, X 5 = 1, X 6 = 0 -(P 1 +P 4 +P 5 ) = -17

Fig /1 Knapsack Problem Solved by Branch-and-Bound Strategy.