Search Algorithms. IE 496 Lecture 17

Similar documents
UNIT 4 Branch and Bound

February 19, Integer programming. Outline. Problem formulation. Branch-andbound

General Methods and Search Algorithms

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.5, Page 1

Algorithm Design Techniques (III)

Computational Optimization ISE 407. Lecture 19. Dr. Ted Ralphs

Parallel Computing in Combinatorial Optimization

3 INTEGER LINEAR PROGRAMMING

LECTURE 3 ALGORITHM DESIGN PARADIGMS

Coping with the Limitations of Algorithm Power Exact Solution Strategies Backtracking Backtracking : A Scenario

CAD Algorithms. Categorizing Algorithms

ME/CS 132: Advanced Robotics: Navigation and Vision

Methods and Models for Combinatorial Optimization Exact methods for the Traveling Salesman Problem

Chapter 9 Graph Algorithms

PATH FINDING AND GRAPH TRAVERSAL

Chapter 14. Graphs Pearson Addison-Wesley. All rights reserved 14 A-1

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions

Integer Programming ISE 418. Lecture 7. Dr. Ted Ralphs

Notes for Lecture 24

Greedy Algorithms CHAPTER 16

Practice Final Exam 1

Algorithm Design Methods. Some Methods Not Covered

CSCE 321/3201 Analysis and Design of Algorithms. Prof. Amr Goneid. Fall 2016

Design and Analysis of Algorithms

Cost Optimal Parallel Algorithm for 0-1 Knapsack Problem

Heuristic Search and Advanced Methods

Algorithm Design Paradigms

Analysis of Algorithms - Greedy algorithms -

10/31/18. About A6, Prelim 2. Spanning Trees, greedy algorithms. Facts about trees. Undirected trees

Spanning Trees, greedy algorithms. Lecture 20 CS2110 Fall 2018

Announcements. Solution to Assignment 1 is posted Assignment 2 is available Video automatically uploaded (see web page)

Backtracking and Branch-and-Bound

L2: Algorithms: Knapsack Problem & BnB

Graphs and Network Flows IE411. Lecture 13. Dr. Ted Ralphs

Spanning Trees, greedy algorithms. Lecture 22 CS2110 Fall 2017

Backtracking. Chapter 5

IV/IV B.Tech (Regular) DEGREE EXAMINATION. Design and Analysis of Algorithms (CS/IT 414) Scheme of Evaluation

The Algorithm Design Manual

Multiple Choice Question. Unit-1 Introduction

UNINFORMED SEARCH. Announcements Reading Section 3.4, especially 3.4.1, 3.4.2, 3.4.3, 3.4.5

Data Structures, Algorithms & Data Science Platforms

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.2, Page 1

Graphs and Network Flows ISE 411. Lecture 7. Dr. Ted Ralphs

Goal-Based Agents Problem solving as search. Outline

Computer Science 385 Design and Analysis of Algorithms Siena College Spring Topic Notes: Brute-Force Algorithms

CS6402 Design and Analysis of Algorithm. 2 Marks Question & Answer UNIT I INTRODUCTION

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.3, Page 1

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #8: Task Assignment and Scheduling on Multiprocessor Systems

L.J. Institute of Engineering & Technology Semester: VIII (2016)

CAP 4630 Artificial Intelligence

Chapter 3: Solving Problems by Searching

Institute of Operating Systems and Computer Networks Algorithms Group. Network Algorithms. Tutorial 1: Flashback and Fast Forward

Fundamentals of Integer Programming

Branch and Bound. Live-node: A node that has not been expanded. It is similar to backtracking technique but uses BFS-like search.

Chapter-6 Backtracking

A2 Uninformed Search

Lecture 3 - States and Searching

Algorithm Design and Analysis

Example: The 8-puzzle. A2 Uninformed Search. It can be generalized to 15-puzzle, 24-puzzle, or. (n 2 1)-puzzle for n 6. Department of Computer Science

COMP 182 Algorithmic Thinking. Breadth-first Search. Luay Nakhleh Computer Science Rice University

The ADT priority queue Orders its items by a priority value The first item removed is the one having the highest priority value

The Size Robust Multiple Knapsack Problem

Monte Carlo Methods; Combinatorial Search

Bulldozers/Sites A B C D

ARTIFICIAL INTELLIGENCE SOLVING PROBLEMS BY SEARCHING. Chapter 3

Search. CS 3793/5233 Artificial Intelligence Search 1

LECTURE 11 TREE TRAVERSALS

Spanning Trees 4/19/17. Prelim 2, assignments. Undirected trees

LECTURE 17 GRAPH TRAVERSALS

CSC 8301 Design and Analysis of Algorithms: Exhaustive Search

Spanning Trees. Lecture 22 CS2110 Spring 2017

Topic 1 Uninformed Search

HW#1 due today. HW#2 due Monday, 9/09/13, in class Continue reading Chapter 3

Chapter 9 Graph Algorithms

Integer Programming. Xi Chen. Department of Management Science and Engineering International Business School Beijing Foreign Studies University

Chapter 3: Search. c D. Poole, A. Mackworth 2010, W. Menzel 2015 Artificial Intelligence, Chapter 3, Page 1

Chapter 9 Graph Algorithms

3. Priority Queues. ADT Stack : LIFO. ADT Queue : FIFO. ADT Priority Queue : pick the element with the lowest (or highest) priority.

Algorithms for the Bin Packing Problem with Conflicts

CS 231: Algorithmic Problem Solving

Informed (Heuristic) Search. Idea: be smart about what paths to try.

Homework Assignment #3 Graph

Combinatorial Search; Monte Carlo Methods

CS 4700: Foundations of Artificial Intelligence. Bart Selman. Search Techniques R&N: Chapter 3

Uninformed Search Strategies AIMA

Data Structure. IBPS SO (IT- Officer) Exam 2017

Fundamental Algorithms

CS-E4800 Artificial Intelligence

Analysis of Algorithms Prof. Karen Daniels

11. APPROXIMATION ALGORITHMS

MVE165/MMG630, Applied Optimization Lecture 8 Integer linear programming algorithms. Ann-Brith Strömberg

Constraint Satisfaction Problems

( ) 1 B. 1. Suppose f x

Search : Lecture 2. September 9, 2003

Introduction to Optimization

Algorithms IV. Dynamic Programming. Guoqiang Li. School of Software, Shanghai Jiao Tong University

Search in State-Spaces 16/9 2014

Algorithms and Theory of Computation. Lecture 3: Graph Algorithms

and 6.855J February 6, Data Structures

Algorithm classification

Transcription:

Search Algorithms IE 496 Lecture 17

Reading for This Lecture Primary Horowitz and Sahni, Chapter 8

Basic Search Algorithms

Search Algorithms Search algorithms are fundamental techniques applied to solve a wide range of optimization problems. Generally speaking, search algorithms explore a graph in order to find a set of nodes or edges satisfying a particular property. Simple examples Find nodes that are reachable by directed paths from a source node. Find nodes that can reach a specific node along directed paths Identify the connected components of a network Identify directed cycles in network

Basic Graph Search Algorithm Node s is a given initial node Q {s} While Q Let v be any member of Q Remove v from Q Mark v For v' in A(v) If v' is not marked Q Q {v}

Search Algorithms The search proceeds depending on how element v is selected in each iteration. Q is usually ordered in some way by storing it in an appropriate data structure. If Q is a queue, we get FIFO ordering (traversal order?). If Q is a stack, we get LIFO ordering (traversal order?). The efficiency of the algorithm can be affected by the ordering and the data structure used to maintain Q

Search Tree Associated with each search ordering is a search tree that can be used to visualize the algorithm. At the time a node v' is added to Q, we record v as its predecesor. The set of arcs formed by each node and its predecessor forms a tree rooted at s.

Complexity of Search Algorithms Initialization Maintaining the set Q. What is the maximum number of additions and removals? How many operations are required for each? Searching the adjacency lists. How many times do we touch each element of each list? How much work do we do each time we touch an element? In some cases, the adjacency lists are constructed dynamically and this step may also be expensive. The size of the graph may not be polynomial in the size of the input.

The Graph Search Paradigm The basic algorithm is a template for a whole class of algorithms. How can we use it to determine whether a graph is connected? What other algorithms that we've seen can be viewed as graph search algorithms?

Topological Ordering In a directed graph, the arcs can be thought of as representing precedence constraints. In other words, an arc (i,j) represents the constraint that node i must come before node j. Given a graph G=(N,A) with the nodes labeled with 1 through n, let order(i) be the label of node i. Then, this labeling is a topological ordering of the nodes if for every arc (i,j) in A, order(i) < order(j). Can all graphs be topologically ordered?

Topological Ordering Algorithm

Analysis Correctness If G has a cycle... If G has no cycle. Running time

Advanced Search Algorithms

The Bin Packing Problem We are given a set of n items, each with a size/weight wi We are also given a set of bins of capacity C. Bin Packing Problem: Pack the items into the smallest number of bins possible. The total size/weight of items assigned to each bin must not exceed the capacity C. This problem is NP-hard.

Heuristic Methods Heuristic methods derive an approximate solution quickly (usually polynomial time). Heuristics for the Bin Packing Problem. Performance guarantees.

Integer Knapsack Problem We are given n objects. Each object has a weight wi and a profit p i. We also have a knapsack with capacity M. Objective: Fill the knapsack as profitably as possible. We do not allow fractional objects. This is an NP-hard problem.

Exact Solution Method We cannot hope for a polynomial-time algorithm for this problem. How do we solve it? What is the complexity?

Heuristic Methods Heuristic methods derive an approximate solution quickly (usually polynomial time). Heuristic for the Knapsack Problem. Performance guarantees.

Branch and Bound Methods Branch and Bound is a general method that can be used to solve many NP-complete problems. Components of Branch and Bound Algorithms Definition of the state space. Branching operation. Feasibility checking operation. Bounding operation. Search order.

Definition of the State Space To apply branch and bound, the solution must be expressible as an n-tuple (x 1, x 2,..., x n ) where x i is chosen from a finite set S i. A set of all possible n-tuples is the state space S. Knapsack Problem Bin Packing Problem

Decisions, Feasibility, Optimization Feasibility problems A defined subset of the state space contains the "feasible" elements. There are various ways to define "feasibility". The goal is to find one feasible element of the state space. Optimization problems We are also given an objective function f which assigns a cost to each element of the state space. We would like to find a feasible state with the lowest cost. Decision problems

Branching Operation Operation by which the original state space is partitioned into at least two non-empty subproblems. Typical branching operation Pick an element i of the n-tuple. Generate S i subproblems by setting x i to each of its possible values in succession. Knapsack Bin Packing

Feasibility Checking Operation Given a subproblem, we need to check whether it contains any feasible solutions. This may or may not be possible for partially defined states. It must be possible if the state is fully defined. Knapsack Problem Bin Packing Problem

Bounding Operation If applicable, we want upper and lower bounds on the optimal value of the current subproblem. This may not be possible. Upper bounds generally come from finding a feasible solution. Upper bounds are global Lower bounds can come from a number of sources. Knapsack Bin Packing

Basic Branch and Bound Algorithm BBound (S, U) S = {s: s is a feasible state}, U = current upper bound if (FEASIBLE(S) == FALSE) return( ); if (LBOUND(S) >= U) return( ); if (UBOUND(S) < U) U = UBOUND(S); if (LBOUND(S) < U) BRANCH(S) -> S 1,..., S k ; for (i = 0; i < k; i++) if (BB(U, S i ) < U) U = BB(S i ); return(u);

More Generally Associate branch and bound with a search tree. Maintain a priority queue of candidate subproblems. Iterate Pick a subproblem from the queue and process it. Check feasibility. Perform upper and lower bound. Prune if infeasible or lower bound greater than or equal to upper bound. Branch. Add new subproblems to the queue.

Search Strategies Depth First Breadth First Highest Lower Bound Lowest Lower Bound

The Traveling Salesman Problem