Exhaustive Search. Brute Force Methods  guarantee best fitness value is found  feasible for ‘small’ data sets only.

Slides:



Advertisements
Similar presentations
Introduction to Algorithms NP-Complete
Advertisements

Interactive Shortest Path An Image Segmentation Technique Jonathan-Lee Jones.
CS420 lecture one Problems, algorithms, decidability, tractability.
Page 1 Recursion and Exhaustion Yip Lik Yau. Page 2 Why Exhaustion?  Many problems can be solved by brute force in a reasonable amount of time if the.
Obtaining a Solution to TSP using Convex Hulls Eric Salmon & Joseph Sewell.
Search by partial solutions. Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Hill climbing Random restart General.
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
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 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
The Theory of NP-Completeness
MAE 552 – Heuristic Optimization Lecture 26 April 1, 2002 Topic:Branch and Bound.
Chapter 11: Limitations of Algorithmic Power
MAE 552 – Heuristic Optimization Lecture 5 February 1, 2002.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
Backtracking.
1 Integrality constraints Integrality constraints are often crucial when modeling optimizayion problems as linear programs. We have seen that if our linear.
Lecture 6 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Randomized Algorithms Morteza ZadiMoghaddam Amin Sayedi.
1.1 Chapter 1: Introduction What is the course all about? Problems, instances and algorithms Running time v.s. computational complexity General description.
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.
Randomized Algorithm. NP-Complete Problem  A problem that, right now, we need exhaustive search  Example:  SAT  TSP  Vertex Cover  Etc.
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
Branch & Bound UPPER =  LOWER = 0.
1 Constraint Satisfaction and Backtrack Search 22c:31 Algorithms.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely
Modular Arithmetic Shirley Moore CS4390/5390 Fall September 3, 2013.
Brought to you by Max (ICQ: TEL: ) March 12, 2005 Recursion and Exhaustion.
Design of an Evolutionary Algorithm M&F, ch. 7 why I like this textbook and what I don’t like about it!
Contents of Chapter 7 Chapter 7 Backtracking 7.1 The General method
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
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.
Honors Track: Competitive Programming & Problem Solving Optimization Problems Kevin Verbeek.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Chapter 3 Brute Force. A straightforward approach, usually based directly on the problem’s statement and definitions of the concepts involved Examples:
Clase 3: Basic Concepts of Search. Problems: SAT, TSP. Tarea 1 Computación Evolutiva Gabriela Ochoa
Graphs and MSTs Sections 1.4 and 9.1. Partial-Order Relations Everybody is not related to everybody. Examples? Direct road connections between locations.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
Lecture 7 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera.
Analysis & Design of Algorithms (CSCE 321)
Chapter 13 Backtracking Introduction The 3-coloring problem
NPC.
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Exhaustive search Exhaustive search is simply a brute- force approach to combinatorial problems. It suggests generating each and every element of the problem.
Approximation algorithms
Brute Force A straightforward approach, usually based directly on the problem’s statement and definitions of the concepts involved Examples: Computing.
Brute Force A straightforward approach, usually based directly on the problem’s statement and definitions of the concepts involved Examples: Computing.
SAT problem SAT – Boolean satisfiability problem
Integer Programming An integer linear program (ILP) is defined exactly as a linear program except that values of variables in a feasible solution have.
Richard Anderson Lecture 26 NP-Completeness
Optimization problems such as
Lecture 2-2 NP Class.
Richard Anderson Lecture 26 NP-Completeness
Hard Problems Introduction to NP
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Randomized Algorithms
P and NP CISC4080, Computer Algorithms CIS, Fordham Univ.
Richard Anderson Lecture 25 NP-Completeness
Integer Programming (정수계획법)
Richard Anderson Lecture 28 Coping with NP-Completeness
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Brute Force A straightforward approach, usually based directly on the problem’s statement and definitions of the concepts involved Examples: Computing.
3. Brute Force Selection sort Brute-Force string matching
P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ.
Integer Programming (정수계획법)
3. Brute Force Selection sort Brute-Force string matching
3. Brute Force Selection sort Brute-Force string matching
Presentation transcript:

Exhaustive Search

Brute Force Methods  guarantee best fitness value is found  feasible for ‘small’ data sets only

SAT satisfiability problem  set of propositions prop[n]  fitness function logical expression based on propositions boolean fitness(prop)  try all 2 n combinations of T/F for propositions

boolean fitness(boolean b[]) //fitness function boolean [] prop = new boolean[n]; boolean satisfied = sat(n-1); boolean sat (int index) // find a solution {if (index==0) //base case { prop[0] = true; if fitness(prop) return true; prop[0] = false; return fitness(prop); } prop[index] = true; // recursive if (sat(index-1)) return true; prop[index] = false; return sat(index-1); }.....T..F.FT.TT.TF.FF FFTFTTFTFFFFTFTTTTTTFTFF

efficiency without risk  pruning the tree: suppose fitness(prop) is (p 0 \/ ~p 1 ) /\ (~p 2 )  partial evaluation.....T..F.FT.TT.TF.FF FFTFTTFTFFFFTFTTTTTTFTFF nodes can be ignored: fitness can not be true

TSP travelling salesman  directed edges, complete graph: exhaustive search is the permutation problem enumerate all n! permutations of n distinct items (cities) {0,2,3,…,n-1} ijij rank in path array D[i][j]

TSP travelling salesman O(n n ) input(V) // number of cities (Vertices) int[V] rIP // rankInPath, initialized to 0==not ranked visit(1) // generate visiting sequences void visit(int rank) { for (city = 0 to V-1) if (rIP[city] == 0) // not yet visited { rIP[city] = rank; if (rank == V) fitness(rIP) else visit(rank+1) rIP[city] = 0 } fitness(int[] p) calculate pathlength from D[i][j] if bestpath, save p fitness(int[] p) calculate pathlength from D[i][j] if bestpath, save p

efficiency without risk  fix first city  O((n-1) n-1 )  use sets instead of searching array  O((n-1)!)  keep partial fitness values reduce cost of fitness evaluation apply branch and bound BUT…still O(e n )

Variations on TSP  undirected edges: D[i][j] == D[j][i]  incomplete graph: some D[i][j] = null  Euclidean distances (on a plane) cities are located on plane at (x i,y i ) D[i][j] is computed from coordinates: D[i][j] = D[j][i] = sqrt((x i -x j ) 2 + (y i -y j ) 2 )  other data structures, efficiencies

Continuous problem spaces Where is height of land? 1. what scale to sample? x  [0,1], y  [0,1] interval length: 0.1: 100 data points 0.01: 10, : 1,000, x  --- y 

Continuous problem spaces Where is height of land? 1. what scale to sample? x  [0,1], y  [0,1] interval length: 0.1: 100 data points 0.01: 10, :1,000, x  --- y 

Continuous problem spaces Where is height of land? 2. constraints – ignore water fewer data points but constraints must be tested --- x  --- y 

Continuous problem spaces Where is height of land? 3. where to locate sample --- x  --- y 

Continuous problem spaces - NLP N on- L inear P rogramming problems Typical problems are functions of multiple variables over domains of each Maximize f(x 1,x 2,x 3,…,x n ) for x 1  D 1, x 2  D 2, x 3  D 3,…, x n  D n NLP problems are NP complete *Linear Programming problems are polynomial solvable O(n k )