Local Search. m = 3h - 8 linear fitness function – optimum at domain boundary.

Slides:



Advertisements
Similar presentations
SAT-Based Planning Using Propositional SAT- Solvers to Search for Plans.
Advertisements

Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Neural and Evolutionary Computing - Lecture 4 1 Random Search Algorithms. Simulated Annealing Motivation Simple Random Search Algorithms Simulated Annealing.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
The Stable Circuit Problem A Short Introduction Brendan Juba.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
Generating Hard Satisfiability Problems1 Bart Selman, David Mitchell, Hector J. Levesque Presented by Xiaoxin Yin.
Clase 2, Parte 1: Conceptos Básicos de Búsqueda. Algoritmo de Ascenso de Colina. Enunciado Tarea 1 Diseño de Algoritmos (Heurísticas Modernas) Gabriela.
1 APPENDIX A: TSP SOLVER USING GENETIC ALGORITHM.
Search by partial solutions. Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Hill climbing Random restart General.
ECE 667 Synthesis & Verification - SAT 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Boolean SAT CNF Representation Slides adopted (with.
Characterizing the Distribution of Low- Makespan Schedules in the Job Shop Scheduling Problem Matthew J. Streeter Stephen F. Smith Carnegie Mellon University.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
The Theory of NP-Completeness
Local Search and Stochastic Algorithms Solution tutorial 4.
MAE 552 – Heuristic Optimization Lecture 4 January 30, 2002.
MAE 552 – Heuristic Optimization Lecture 5 February 1, 2002.
Knowledge Representation II (Inference in Propositional Logic) CSE 473 Continued…
State-Space Representation Read Chapter 3. Searches you use MapQuest –road maps Google –documents CiteSeer –research documents.
Logic - Part 2 CSE 573. © Daniel S. Weld 2 Reading Already assigned R&N ch 5, 7, 8, 11 thru 11.2 For next time R&N 9.1, 9.2, 11.4 [optional 11.5]
COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
Design of an Evolutionary Algorithm M&F, ch. 7 why I like this textbook and what I don’t like about it!
Escaping Local Optima. Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Hill climbing Random restart General.
State-Space Representation General Problem Solving via simplification Read Chapter 3.
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.
1 Combinatorial Problem. 2 Graph Partition Undirected graph G=(V,E) V=V1  V2, V1  V2=  minimize the number of edges connect V1 and V2.
Thursday, May 9 Heuristic Search: methods for solving difficult optimization problems Handouts: Lecture Notes See the introduction to the paper.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Exhaustive Search. Brute Force Methods  guarantee best fitness value is found  feasible for ‘small’ data sets only.
First-Order Logic and Inductive Logic Programming.
Genetic Algorithms What is a GA Terms and definitions Basic algorithm.
Machine Learning A Quick look Sources: Artificial Intelligence – Russell & Norvig Artifical Intelligence - Luger By: Héctor Muñoz-Avila.
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
Review of Propositional Logic Syntax
Clase 3: Basic Concepts of Search. Problems: SAT, TSP. Tarea 1 Computación Evolutiva Gabriela Ochoa
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Tommy Messelis * Stefaan Haspeslagh Patrick De Causmaecker *
Computability NP complete problems. Space complexity. Homework: [Post proposal]. Find PSPACE- Complete problems. Work on presentations.
Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera.
The n queens problem Many solutions to a classic problem: On an n x n chess board, place n queens so no queen threatens another.
NPC.
Constraint Propagation Artificial Intelligence CMSC January 22, 2002.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Local Search Methods for SAT Geoffrey Levine March 11, 2004.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
1 Combinatorial Problem. 2 Graph Partition Undirected graph G=(V,E) V=V1  V2, V1  V2=  minimize the number of edges connect V1 and V2.
Honors Track: Competitive Programming & Problem Solving 2-Satisfiability José Kuiper.
Escaping Local Optima. Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Hill climbing Exhaustive search Hill.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Constraints in Evolutionary Algorithms. Constraints: the big questions, page 233  how to evaluate and compare feasible and infeasible solutions  avoid,
1 Intro to AI Local Search. 2 Intro to AI Local search and optimization Local search: –use single current state & move to neighboring states Idea: –start.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
School of Computer Science & Engineering
Propositional Logic (a.k.a. Sentential Logic)
SAT problem SAT – Boolean satisfiability problem
COMP108 Algorithmic Foundations Greedy methods
Hard Problems Introduction to NP
First-Order Logic and Inductive Logic Programming
P and NP CISC4080, Computer Algorithms CIS, Fordham Univ.
How Hard Can It Be?.
Binary Decision Diagrams
P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ.
The n queens problem Many solutions to a classic problem:
Closures of Relations Epp, section 10.1,10.2 CS 202.
Presentation transcript:

Local Search

m = 3h - 8 linear fitness function – optimum at domain boundary

convex fitness function – optimum at one point in domain m = 20h - h 2

complex fitness function – local optima at points in domain m = h 3 mod 101 local optima

Local Search -ideal solution for convex functions -partial solution for complex functions (finds local optimum)

Local search algorithm localSearch(point P in domain) evaluate f P = fitness(P) repeat until no improvement in fitness transform P to a neighbouring point P’ evaluate f P ’ if f P ’ better than f P, P=P’ return P

1 Dimensional Convex space Example localSearch(point h=18) evaluate f h = 20(18)-18 2 =36 repeat until no improvement in fitness transform h to a neighbouring point h’ evaluate f h ’ if f h ’ better than f h, h=h’ return h = 10 m = 20h - h 2 in this domain, neighbouring points of h are (h+1), (h-1) hfhfh

2 Dimensional spaces 4 local search neighbours --- x  --- y 

Local search with SAT what is a “better” point in search space? what is a “neighbouring” point? localSearch(point P in domain) evaluate f P = fitness(P) repeat until no better fitness transform P to neighbour pt P’ evaluate f P ’ if f P ’ better than f P, P=P’ return P localSearch(point P in domain) evaluate f P = fitness(P) repeat until no better fitness transform P to neighbour pt P’ evaluate f P ’ if f P ’ better than f P, P=P’ return P P1P1 P2P2 P3P3 P4P4 (~P 1 \/ P 3 )(P 2 \/ ~P 3 )(P 4 \/ ~P 1 )fitness TFTFTFFF FITNESS: number of TRUE disjuncts 1 1 neighbour has one proposition with different boolean value

SAT representation Any logical expression can be written as a conjunction (/\) of disjunctions (\/) of propositions and negations (~P 1 \/ P 3 ) /\(P 2 \/ ~P 3 ) /\ (P 4 \/ ~P 1 ) (A \/ B) -> C = ~(A \/ B)\/ C = (~A /\ ~B) \/ C

Local search with SAT P1P1 P2P2 P3P3 P4P4 (~P 1 \/ P 3 )(P 2 \/ ~P 3 )(P 4 \/ ~P 1 )fitness TFTFTFF1 localSearch(point P in domain) evaluate f P = fitness(P) repeat until no better fitness transform P to neighbour pt P’ evaluate f P ’ if f P ’ better than f P, P=P’ return P localSearch(point P in domain) evaluate f P = fitness(P) repeat until no better fitness transform P to neighbour pt P’ evaluate f P ’ if f P ’ better than f P, P=P’ return P P1P1 P2P2 P3P3 P4P4 fitness FFTF2 P1P1 P2P2 P3P3 P4P4 TTTF2 P1P1 P2P2 P3P3 P4P4 TFFF1 P1P1 P2P2 P3P3 P4P4 TFTT2

Local search with SAT but SAT space is not convex… procedure GSAT // Michalewicz & Fogel begin for i = 1 to MAX_TRIES do T  random truth assignment for j = 1 to MAX_FLIPS do if T satisfies fitness return (T) flip a proposition truth value end return (“no solution found”) end

Local search with TSP what is a “better” point in search space? EASY – shorter path what is a “neighbouring” point? i.e., what change to transform a path to a similar path? MANY possible definitions of transformation operators. localSearch(point P in domain) evaluate f P = fitness(P) repeat until no better fitness transform P to neighbour pt P’ evaluate f P ’ if f P ’ better than f P, P=P’ return P localSearch(point P in domain) evaluate f P = fitness(P) repeat until no better fitness transform P to neighbour pt P’ evaluate f P ’ if f P ’ better than f P, P=P’ return P

TSP and local search  some neighbourhood definitions depend on the type of TSP e.g., 2-Opt: change two non-adjacent edges: ABCDEFG to ABEDCFG pathlength = pathlength –BC –EF + BE + CF A B C D E FG fails when? TSP with directed edges: DE  ED, CD  DC

Neighbourhood/Search tradeoff  larger neighbourhood  more chance of better optimum but  longer search time e.g. 2-Opt: n edges, n-3 non-adjacent number of neighbours n(n-2)/2 O(n 2 )

TSP neighbourhood definitions swap adjacent cities O(n) 2-Opt: change two non- adjacent edges O(n 2 ) 3-Opt: change among three non adjacent edges  -path (Lin-Kernighan) A B C D E FG A B C D E

3-OptO(n 3 ) THREE possible (2-Opt) neighbours: FOUR possible neighbours: BCDEFGHJKA B EDCHGF JKA FGH HGF CDE EDC B CDEHGF JKA EDC HGF FGH EDC

 -path (Lin-Kernighan) based on 2-Opt with 1 city (A) fixed. remove KA and consider all  -paths (e.g., by adding KE) -record best 2-Opt tour if any (e.g. EF FA) -BUT move to next tour according to best  -path length (e.g. including FA) BCDEFGHJKAA

Lin-Kernighan local search initial tour T, BestT = T start city A, last city L=K added_list =null; // added edges cannot be removed deleted_list=null; // deleted edges can’t be re-added repeat find best 2-Opt tour (may be change BestT) move to tour with best  -path < BestT if any put added edge in added_list (e.g., KE) put deleted edge in deleted_list(e.g., EF) L = F until no moves (all edges added or no short  -path) BCDEFGHJKAA

Variations on local search p, point in search space, fitness f(p) neighbourhood N p = {p 1,…,p k } (1) find first p i with f(p i )> f(p) or (2) find best p j such that f(p j ) ≥ f(p i ) 1≤ i ≤ k … pkpk p2p2 p1p1 f(p) (2) (1)