General Methods and Search Algorithms

Similar documents
Mathematical Programming Formulations, Constraint Programming

Constraint Satisfaction Problems

Constraint Satisfaction Problems

Constraint Satisfaction Problems. Chapter 6

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 30 January, 2018

Constraint Satisfaction Problems

Constraint Satisfaction Problems

Lecture 18. Questions? Monday, February 20 CS 430 Artificial Intelligence - Lecture 18 1

Constraint Satisfaction Problems. slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig, Jean-Claude Latombe

Spezielle Themen der Künstlichen Intelligenz

Example: Map coloring

Lecture 6: Constraint Satisfaction Problems (CSPs)

Constraint Satisfaction

Constraint Satisfaction Problems Part 2

CSE 473: Artificial Intelligence

Artificial Intelligence Constraint Satisfaction Problems

CS 188: Artificial Intelligence. What is Search For? Constraint Satisfaction Problems. Constraint Satisfaction Problems

Constraint Satisfaction Problems. A Quick Overview (based on AIMA book slides)

Constraint Satisfaction Problems

ARTIFICIAL INTELLIGENCE (CS 370D)

Space of Search Strategies. CSE 573: Artificial Intelligence. Constraint Satisfaction. Recap: Search Problem. Example: Map-Coloring 11/30/2012

Constraint Satisfaction Problems. Chapter 6

CS 343: Artificial Intelligence

What is Search For? CS 188: Artificial Intelligence. Constraint Satisfaction Problems

Reading: Chapter 6 (3 rd ed.); Chapter 5 (2 nd ed.) For next week: Thursday: Chapter 8

CS 771 Artificial Intelligence. Constraint Satisfaction Problem

CS 188: Artificial Intelligence Fall 2011

Constraint Satisfaction Problems (CSPs)

Constraint (Logic) Programming

Australia Western Australia Western Territory Northern Territory Northern Australia South Australia South Tasmania Queensland Tasmania Victoria

Example: Map-Coloring. Constraint Satisfaction Problems Western Australia. Example: Map-Coloring contd. Outline. Constraint graph

What is Search For? CSE 473: Artificial Intelligence. Example: N-Queens. Example: N-Queens. Example: Map-Coloring 4/7/17

Announcements. CS 188: Artificial Intelligence Fall 2010

Constraint Satisfaction Problems

Announcements. Homework 4. Project 3. Due tonight at 11:59pm. Due 3/8 at 4:00pm

Announcements. Homework 1: Search. Project 1: Search. Midterm date and time has been set:

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence,

Games and Adversarial Search II Alpha-Beta Pruning (AIMA 5.3)

Constraint Satisfaction Problems

Outline. Best-first search

Constraint Satisfaction Problems

Constraint Satisfaction Problems

CS W4701 Artificial Intelligence

CS 188: Artificial Intelligence Fall 2008

Announcements. CS 188: Artificial Intelligence Fall Large Scale: Problems with A* What is Search For? Example: N-Queens

CONSTRAINT SATISFACTION

Constraint Satisfaction Problems

Outline. Best-first search

Artificial Intelligence

Constraint Satisfaction. AI Slides (5e) c Lin

10/11/2017. Constraint Satisfaction Problems II. Review: CSP Representations. Heuristic 1: Most constrained variable

CS 188: Artificial Intelligence Spring Announcements

CS 4100 // artificial intelligence

Moving to a different formalism... SEND + MORE MONEY

Chapter 6 Constraint Satisfaction Problems

Constraint satisfaction problems. CS171, Winter 2018 Introduction to Artificial Intelligence Prof. Richard Lathrop

CS 188: Artificial Intelligence. Recap: Search

CMU-Q Lecture 7: Searching in solution space Constraint Satisfaction Problems (CSPs) Teacher: Gianni A. Di Caro

Recap: Search Problem. CSE 473: Artificial Intelligence. Space of Search Strategies. Constraint Satisfaction. Example: N-Queens 4/9/2012

Announcements. CS 188: Artificial Intelligence Spring Today. A* Review. Consistency. A* Graph Search Gone Wrong

Constraint Satisfaction Problems (CSPs) Introduction and Backtracking Search

Chronological Backtracking Conflict Directed Backjumping Dynamic Backtracking Branching Strategies Branching Heuristics Heavy Tail Behavior

Constraint Satisfaction Problems

Foundations of Artificial Intelligence

Constraint satisfaction search. Combinatorial optimization search.

AI Fundamentals: Constraints Satisfaction Problems. Maria Simi

CS 188: Artificial Intelligence. Recap Search I

CS 188: Artificial Intelligence Spring Announcements

Constraint Satisfaction Problems

CS188 Spring 2010 Section 2: CSP s

Constraint Satisfaction Problems

Artificial Intelligence

Artificial Intelligence

Constraint Satisfaction Problems. Some material from: D Lin, J You, JC Latombe

Set 5: Constraint Satisfaction Problems

Constraint Satisfaction. CS 486/686: Introduction to Artificial Intelligence

Search Algorithms. IE 496 Lecture 17

Announcements. CS 188: Artificial Intelligence Spring Today. Example: Map-Coloring. Example: Cryptarithmetic.

Constraint Satisfaction

Solving Problems by Searching: Constraint Satisfaction Problems

CS 4100/5100: Foundations of AI

CSPs: Search and Arc Consistency

Set 5: Constraint Satisfaction Problems Chapter 6 R&N

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 6 February, 2018

Today. CS 188: Artificial Intelligence Fall Example: Boolean Satisfiability. Reminder: CSPs. Example: 3-SAT. CSPs: Queries.

Announcements. CS 188: Artificial Intelligence Fall Reminder: CSPs. Today. Example: 3-SAT. Example: Boolean Satisfiability.

CS 188: Artificial Intelligence Fall 2008

UNIT 4 Branch and Bound

Constraint Satisfaction Problems

Constraint satisfaction search. Combinatorial optimization search.

Set 5: Constraint Satisfaction Problems

Set 5: Constraint Satisfaction Problems

Outline. Outline. Schedule and Material. 1. Course Introduction. 2. Combinatorial Optimization Combinatorial Problems Solution Methods. 3.

Constraints. CSC 411: AI Fall NC State University 1 / 53. Constraints

Constraint Programming

: Principles of Automated Reasoning and Decision Making Midterm

CONSTRAINT SATISFACTION

CS 188: Artificial Intelligence Fall 2011

Week 8: Constraint Satisfaction Problems

What is Search For? CS 188: Artificial Intelligence. Example: Map Coloring. Example: N-Queens. Example: N-Queens. Constraint Satisfaction Problems

Transcription:

DM811 HEURISTICS AND LOCAL SEARCH ALGORITHMS FOR COMBINATORIAL OPTIMZATION Lecture 3 General Methods and Search Algorithms Marco Chiarandini 2 Methods and Algorithms A Method is a general framework for the development of a solution algorithm. It is not problem-specific. An Algorithm (or algorithmic model) is a problem-specific template that leaves some practical details unspecified. The level of detail may vary: minimally instantiated (few details, algorithm template) lowly instantiated (which data structure to use) highly instantiated (programming tricks that give speedups) maximally instantiated (details specific of a programming language and computer architecture) A Program is the formulation of an algorithm in a programming language. An algorithm can thus be regarded as a class of computer programs (its implementations) 3 4

Solution Methods Exact methods: complete: guaranteed to eventually find (optimal) solution, or to determine that no solution exists (eg, systematic enumeration) Search algorithms (backtracking, branch and bound) Dynamic programming Constraint programming Integer programming Dedicated Algorithms Approximation methods worst-case solution guarantee http://www.nada.kth.se/~viggo/problemlist/compendium.html Heuristic (Approximate) methods: incomplete: not guaranteed to find (optimal) solution, and unable to prove that no solution exists Integer programming relaxations Randomized backtracking Heuristic algorithms 5 6 Problem specific methods: Knapsack Dynamic programming (knapsack) Dedicated algorithms (shortest path) Generic methods: U Allow to save development time D Do not achieve same performance as specific algorithms Integer Programming (knapsack) Search Methods and Constraint Programming (constraint satisfaction problem) Knapsack Given: a knapsack with maximum weight W and a set of n items {1, 2,..., n}, with each item j associated to a profit p j and to a weight w j. Task: Find the subset of items of maximal total profit and whose total weight is not greater than W. Note: In this course we use Search Methods and Constraint Programming, that are generic methods, to learn guidelines in the design of problem-specific construction heuristics. 7 8

Bin Packing Constraint Satisfaction Problem One dimensional Given: A set L = (a 1, a 2,..., a n ) of items, each with a size s(a i ) (0, 1] and an unlimited number of unit-capacity bins B 1, B 2,..., B m. Task: Pack all the items into a minimum number of unit-capacity bins B 1, B 2,..., B m. Related: cutting stock Input: a set of variables X1, X 2,..., X n each variable has a non-empty domain Di of possible values a set of constraints. Each constraint Ci involves some subset of the variables and specifies the allowed combination of values for that subset. [A constraint C on variables X i and X j, C(X i, X j ), defines the subset of the Cartesian product of variable domains D i D j of the consistent assignments of values to variables. A constraint C on variables X i, X j is satisfied by a pair of values v i, v j if (v i, v j ) C(X i, X j ).] Task: find an assignment of values to all the variables {Xi = v i, X j = v j,...} such that it is consistent, that is, it does not violate any constraint If assignments are not all equally good but some are preferable this is reflected in an objective function. 9 10 Search Methods initial state: the empty assignment {} in which all variables are unassigned successor function: a value can be assigned to any unassigned variable, provided that it does not conflict with previously assigned variables goal test: the current assignment is complete path cost: a constant cost Two search paradigms: search tree of depth n complete state formulation: local search 11 12

General Purpose Search Algorithms Backtrack Search Search algorithms tree with branching factor at the top level nd at the next level (n 1)d. The tree has n! d n even if only d n possible complete assignments. CSP is commutative in the order of application of any given set of action. (the order of the assignment does not influence) Hence we can consider search algs that generate successors by considering possible assignments for only a single variable at each node in the search tree. Backtracking search depth first search that chooses one variable at a time and backtracks when a variable has no legal values left to assign. 13 14 Backtrack Search Uninformed Complete Tree Search No need to copy solutions all the times but rather extensions and undo extensions Since CSP is standard then the alg is also standard and can use general purpose algorithms for initial state, successor function and goal test. Breadth-first search Depth-first search Backtracking is uninformed and complete. Other search algorithms may use information in form of heuristics. 15 16

Informed Complete Tree Search General Purpose Backtracking Methods 1) Which variable should we assign next, and in what order should its values be tried? Informed search algorithm: exploit problem-specific knowledge Best-first search: node that appears to be the best selected for expansion based on an evaluation function f(x) Implemented through a priority queue of nodes in ascending order of f See later discussion on A search 2) What are the implications of the current variable assignments for the other unassigned variables? 3) When a path fails that is, a state is reached in which a variable has no legal values can the search avoid repeating this failure in subsequent paths? In short, Constraint Programming is a logic programming that express rules and constraints and exploits point 2). In the general case, at point 1) we use heuristic rules. If we do not backtrack (point 3) then we have a construction heuristic. 17 18 1) Which variable should we assign next, and in what order should its values be tried? Constraint Programming (1) Select-Initial-Unassigned-Variable Types of Variables and Values Select-Unassigned-Variable most constrained first = fail-first heuristic = Minimum remaining values (MRV) heuristic (tend to reduce the branching factor and to speed up pruning) least constrained last Eg.: max degree, farthest, earliest due date, etc. Order-Domain-Values Discrete variables with finite domain: complete enumeration is O(d n ) Discrete variables with infinite domains: Impossible by complete enumeration. Instead a constraint language (constraint logic programming and constraint reasoning) Eg, project planning. greedy least constraining value heuristic (leaves maximum flexibility for subsequent variable assignments) maximal regret implements a kind of look ahead NB: If we search for all the solutions or a solution does not exists, then the ordering does not matter. 19 S j + p j S k NB: if only linear constraints, then integer linear programming variables with continuous domains NB: if only linear constraints or convex functions then mathematical programming 20

Constraint Programming (3) 2) What are the implications of the current variable assignments for the other unassigned variables? Propagating information through constraints Types of constraints Unary constraints Binary constraints (constraint graph) Higher order (constraint hypergraph) Eg, Alldiff() Atmost() Every higher order constraint can be reconduced to binary (you may need auxiliary constraints) Preference constraints cost on individual variable assignments Implicit in Select-Unassigned-Variable Forward checking (coupled with MRV) Constraint propagation arc consistency: force all (directed) arcs uv to be consistent: a value in D(v) : values in D(u), otherwise detects inconsistency can be applied as preprocessing or as propagation step after each assignment (MAC, Maintaining Arc Consistency) Applied repeatedly k-consistency: if for any set of k 1 variables, and for any consistent assignment to those variables, a consistent value can always be assigned to any k-th variable. determining the appropriate level of consistency checking is mostly an empirical science. 22 23 Arc Consistency Algorithm: AC-3 3) When a path fails that is, a state is reached in which a variable has no legal values can the search avoid repeating this failure in subsequent paths? Backtracking-Search chronological backtracking, the most recent decision point is revisited backjumping, backtracks to the most recent variable in the conflict set (set of previously assigned variables connected to X by constraints). every branch pruned by backjumping is also pruned by forward checking idea remains: backtrack to reasons of failure. 24 25

An Empirical Comparison Median number of consistency checks 26