PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

Similar documents
PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

Foundations of Artificial Intelligence

Constraint Satisfaction. AI Slides (5e) c Lin

Chapter 6 Constraint Satisfaction Problems

Outline. Best-first search

Constraint Satisfaction Problems

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

Constraint Satisfaction Problems

Constraint Satisfaction Problems

Artificial Intelligence

Constraint Satisfaction Problems. Chapter 6

Artificial Intelligence

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

PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

Week 8: Constraint Satisfaction Problems

CS 188: Artificial Intelligence Fall 2011

CS 188: Artificial Intelligence

Foundations of Artificial Intelligence

CS 188: Artificial Intelligence

Constraint Satisfaction Problems (CSPs)

Escaping Local Optima: Genetic Algorithm

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

CS 188: Artificial Intelligence Fall 2008

Constraint Satisfaction Problems

CS 188: Artificial Intelligence Fall 2008

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

Iterative improvement algorithms. Today. Example: Travelling Salesperson Problem. Example: n-queens

Constraint Satisfaction Problems

9. Parameter Treewidth

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

Artificial Intelligence

Artificial Intelligence

CS 188: Artificial Intelligence

CSE 473: Artificial Intelligence

Constraint Satisfaction Problems

Lecture 6: Constraint Satisfaction Problems (CSPs)

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

K-Consistency. CS 188: Artificial Intelligence. K-Consistency. Strong K-Consistency. Constraint Satisfaction Problems II

AI Fundamentals: Constraints Satisfaction Problems. Maria Simi

CS 188: Artificial Intelligence. Recap: Search

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

PART 1 GRAPHICAL STRUCTURE

CS 188: Artificial Intelligence Spring Announcements

Constraint Satisfaction Problems

CS 4100 // artificial intelligence

Announcements. Reminder: CSPs. Today. Example: N-Queens. Example: Map-Coloring. Introduction to Artificial Intelligence

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

Fixed-Parameter Algorithm for 2-CNF Deletion Problem

An Effective Upperbound on Treewidth Using Partial Fill-in of Separators

Heuristic Optimisation

Spezielle Themen der Künstlichen Intelligenz

Treewidth. Kai Wang, Zheng Lu, and John Hicks. April 1 st, 2015

Non-deterministic Search techniques. Emma Hart

Hybridization EVOLUTIONARY COMPUTING. Reasons for Hybridization - 1. Naming. Reasons for Hybridization - 3. Reasons for Hybridization - 2

Constraint Satisfaction

Constraint Satisfaction Problems

Constraint Satisfaction Problems

CS 771 Artificial Intelligence. Constraint Satisfaction Problem

Common Induced Subgraph Isomorphism Structural Parameterizations and Exact Algorithms

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

Local Search (Greedy Descent): Maintain an assignment of a value to each variable. Repeat:

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

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

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

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

Design and Analysis of Algorithms

Constraint Satisfaction Problems. Chapter 6

R E P O R T. htd A Free, Open-Source Framework for Tree Decompositions and Beyond INSTITUT FÜR INFORMATIONSSYSTEME DBAI-TR

Parallel Computing in Combinatorial Optimization

Outline. Best-first search

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

Treewidth: Preprocessing and Kernelization

Example: Map coloring

CS 188: Artificial Intelligence Spring Announcements

Material. Thought Question. Outline For Today. Example: Map-Coloring EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Algorithms & Complexity

CS 188: Artificial Intelligence. Recap Search I

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

Constraint Satisfaction Problems

Introduction to Combinatorial Algorithms

ACO and other (meta)heuristics for CO

Constraint Satisfaction Problems

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

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

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

CS 343: Artificial Intelligence

CS 188: Artificial Intelligence Spring Today

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

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

Outline of the talk. Local search meta-heuristics for combinatorial problems. Constraint Satisfaction Problems. The n-queens problem

Constraint Satisfaction Problems

Artificial Intelligence Constraint Satisfaction Problems

Computational Complexity CSC Professor: Tom Altman. Capacitated Problem

Conflict Graphs for Combinatorial Optimization Problems

CS 188: Artificial Intelligence Fall 2011

Research Incubator: Combinatorial Optimization. Dr. Lixin Tao December 9, 2003

Solving Problems by Searching: Constraint Satisfaction Problems

Artificial Intelligence

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

arxiv: v5 [cs.cc] 28 Oct 2010

Transcription:

Artificial Intelligence, Computational Logic PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE Lecture 10 Tree Decompositions Sarah Gaggl Dresden, 30th June 2015

Agenda 1 Introduction 2 Uninformed Search versus Informed Search (Best First Search, A* Search, Heuristics) 3 Local Search, Stochastic Hill Climbing, Simulated Annealing 4 Tabu Search 5 Answer-set Programming (ASP) 6 Constraint Satisfaction Problems (CSP) 7 Evolutionary Algorithms/ Genetic Algorithms 8 Structural Decomposition Techniques (Tree/Hypertree Decompositions) TU Dresden, 30th June 2015 PSSAI slide 2 of 41

Fixed-Parameter Tractability (FPT) Motivation Some Observations For intractable problems, computational costs often depend primarily on some problem parameters rather than on the mere size of the instances. Many hard problems become tractable if some problem parameter is fixed or bounded by a fixed constant. Typical parameters for graphs: treewidth and cliquewidth. Meta-theorems allow for rather easy proofs of FPT results w.r.t. these parameters Dedicated dynamic algorithms required for practical realization! FPT is one branch in the area of Parameterized Complexity Downey & Fellows: Parameterized Complexity. Springer, 1999 Flum & Grohe: Parameterized Complexity Theory. Springer, 2006 Niedermeier: Invitation to Fixed-Parameter Algorithms. OUP, 2006 TU Dresden, 30th June 2015 PSSAI slide 3 of 41

Introduction Many instances of constraint satisfaction problems can be solved in polynomial time if their treewidth (or hypertree width) is small. Solving of problems with bounded width includes two phases: Generate a (hyper)tree decomposition with small width; Solve a problem (based on generated decomposition) with a particular algorithm such as for example dynamic programming. Main idea: decomposing a problem into sub-problems of limited size allows to solve the whole problem more efficiently The efficiency of solving of problem based on its (hyper)tree decomposition depends on the width of (hyper)tree decomposition. It is of high importance to generate (hyper)tree decompositions with small width. TU Dresden, 30th June 2015 PSSAI slide 4 of 41

CSP: Map-Coloring Western Australia Northern Territory South Australia Queensland New South Wales Victoria Tasmania Variables WA, NT, Q, NSW, V, SA, T Domains D i = {red, green, blue} Constraints: adjacent regions must have different colors e.g., WA NT, or (WA, NT) {(red, green), (red, blue), (green, red), (green, blue),...} TU Dresden, 30th June 2015 PSSAI slide 5 of 41

Constraint Graph Binary CSP: each constraint relates at most two variables Constraint graph: nodes are variables, arcs show constraints WA NT Q SA NSW V Victoria T General-purpose CSP algorithms use the graph structure to speed up search. E.g., Tasmania is an independent sub-problem! TU Dresden, 30th June 2015 PSSAI slide 6 of 41

Tree-structured CSPs A C B D E F Theorem If the constraint graph has no loops, the CSP can be solved in O(n d 2 ) time. Compare to general CSPs, where worst-case time is O(d n ) This property also applies to logical and probabilistic reasoning: an important example of the relation between syntactic restrictions and the complexity of reasoning. TU Dresden, 30th June 2015 PSSAI slide 7 of 41

CSP: SAT Problem (x 1 x 2 x 3 ) (x 1 x 4 x 5 x 6 ) (x 3 x 4 x 7 x 8 )... Possible CSP fomulation: Variables x 1, x 2, x 3,... Domains 0, 1 Constraints C1: (x 1 x 2 x 3 ) true C2: (x 1 x 4 x 5 x 6 ) true... TU Dresden, 30th June 2015 PSSAI slide 8 of 41

CSP and Hypergraph (x 1 x 2 x 3 ) (x 1 x 4 x 5 x 6 ) (x 3 x 4 x 7 x 8 )... In general worst case complexity: 2 NumberOfVariables = 2 19 TU Dresden, 30th June 2015 PSSAI slide 9 of 41

Hypergraph and its Primal Graph TU Dresden, 30th June 2015 PSSAI slide 10 of 41

CSP and (Hyper)treewidth In general exponential worst case complexity. Can we solve this instance more efficiently (or in polynomial time)? Yes, if it has a small (hyper) treewidth!!! TU Dresden, 30th June 2015 PSSAI slide 11 of 41

Tree Decomposition Definition Tree Decomposition Let G = (V, E) be a graph. A tree decomposition of G is a pair (T, χ), where T = (I, F) is a tree with node set I and edge set F, and χ = {χ i : i I} is a family of subsets of V, one for each node of T, such that 1 i I χ i = V, 2 for every edge (v, w) E, there is an i I with v χ i and w χ i, and 3 for all i, j, k I, if j is on the path from i to k in T, then χ i χ k χ j. The width of a tree decompostion is max i I χ i 1. The treewidth of a graph G, denoted by tw(g), is the minimum width over all possible tree decompositions of G. TU Dresden, 30th June 2015 PSSAI slide 12 of 41

Tree Decomposition - Example All pairs of vertices that are connected appear in some node of the tree. Connectedness condition for vertices TU Dresden, 30th June 2015 PSSAI slide 13 of 41

Elimination Ordering For the given problem find the tree decomposition with minimal width -> NP hard. There exists a perfect elimination ordering which produces tree decomposition with treewidth (smallest width). Tree decomposition problem search for the best elimination ordering of vertices! Permutation Problem similar to TSP. Possible elimination ordering for graph in previous slide: 10, 9, 8, 7, 2, 3, 6, 1, 5, 4 TU Dresden, 30th June 2015 PSSAI slide 14 of 41

Perfect Elimination Ordering Vertex 10 is eliminated from the graph. All neighbors of 10 are connected and a tree node is created that contains vertex 10 and its neighbors. Elimination ordering: 10, 9, 8, 7, 2, 3, 6, 1, 5, 4 TU Dresden, 30th June 2015 PSSAI slide 15 of 41

Perfect Elimination Ordering ctd. The tree decomposition node with vertices [7,9,10] is connected with the tree decomposition node which is created when the next vertex which appears in [7,9,10] is eliminated (in this case vertex 9) Vertex 9 is eliminated from the graph. All neighbors of vertex 9 are connected and a new tree node is created. Elimination ordering: 10, 9, 8, 7, 2, 3, 6, 1, 5, 4 TU Dresden, 30th June 2015 PSSAI slide 16 of 41

Perfect Elimination Ordering ctd. Elimination ordering: 10, 9, 8, 7, 2, 3, 6, 1, 5, 4 TU Dresden, 30th June 2015 PSSAI slide 17 of 41

Perfect Elimination Ordering ctd. Elimination ordering: 10, 9, 8, 7, 2, 3, 6, 1, 5, 4 TU Dresden, 30th June 2015 PSSAI slide 18 of 41

Perfect Elimination Ordering ctd. Elimination ordering: 10, 9, 8, 7, 2, 3, 6, 1, 5, 4 TU Dresden, 30th June 2015 PSSAI slide 19 of 41

Perfect Elimination Ordering ctd. Elimination ordering: 10, 9, 8, 7, 2, 3, 6, 1, 5, 4 TU Dresden, 30th June 2015 PSSAI slide 20 of 41

Perfect Elimination Ordering ctd. Elimination ordering: 10, 9, 8, 7, 2, 3, 6, 1, 5, 4 TU Dresden, 30th June 2015 PSSAI slide 21 of 41

Perfect Elimination Ordering ctd. Elimination ordering: 10, 9, 8, 7, 2, 3, 6, 1, 5, 4 TU Dresden, 30th June 2015 PSSAI slide 22 of 41

Perfect Elimination Ordering ctd. Elimination ordering: 10, 9, 8, 7, 2, 3, 6, 1, 5, 4 TU Dresden, 30th June 2015 PSSAI slide 23 of 41

Perfect Elimination Ordering ctd. Elimination ordering: 10, 9, 8, 7, 2, 3, 6, 1, 5, 4 TU Dresden, 30th June 2015 PSSAI slide 24 of 41

Perfect Elimination Ordering ctd. Elimination ordering: 10, 9, 8, 7, 2, 3, 6, 1, 5, 4 TU Dresden, 30th June 2015 PSSAI slide 25 of 41

Tree Decomposition of a Graph Width: max(vertices in tree node) 1 = 3. Treewidth: minimal width over all possible tree decompostions. TU Dresden, 30th June 2015 PSSAI slide 26 of 41

Example (Another Tree Decomposition) Elimination ordering: 4, 3, 10, 5, 6, 7, 1, 2, 9, 8 Group-Work! TU Dresden, 30th June 2015 PSSAI slide 27 of 41

Bounded Treewidth for CSP If a graph has treewidth k, and we are given the corresponding tree decomposition, then the problem can be solved in O(nd k+1 ) time. n - d - number of variables, maximum domain size of any variable in the CSP. But, finding the decomposition with minimal treewidth is NP-hard. Heuristic methods work well in practice! TU Dresden, 30th June 2015 PSSAI slide 28 of 41

Example Graph Coloring Australia WA NT Q SA NSW V Victoria T Naive approach: try all possibilities d n combinations Make tree decomposition and solve each subproblem independently (blackboard) If one subproblem has no solution the whole problem has no solution Elimination ordering: V, NSW, Q, NT, T TU Dresden, 30th June 2015 PSSAI slide 29 of 41

Algorithms for Finding Good Elimination Ordering Exact Methods Branch and bound A (Meta)Heuristic Methods Maximum Cardinality Search (MCS) Min-Fill Heuristic Tabu Search Genetic Algorithms Iterated Local Search TU Dresden, 30th June 2015 PSSAI slide 30 of 41

Maximum Cardinality Search (MCS) 1 Select a random vertex in graph to be the first in elimination ordering 2 Pick next vertex that has highest connectivity with vertices previously selected in elimination ordering (ties are broken randomly) 3 Repeat Step 2 until whole ordering is complete Example (Graph Coloring) WA NT Q SA NSW V Victoria T On blackboard! TU Dresden, 30th June 2015 PSSAI slide 31 of 41

Min-Fill Heuristic 1 Select vertex which adds smalles number of edges when eliminated (ties are broken randomly) to be first vertex in eleimination ordering 2 Pick next vertex that adds the minimum number of edges when eliminated from graph 3 Repeat Step 2 until whole ordering is constructed Note When the vertex is elimited from graph, all its neighbours are connected (new edges are inserted in the graph) TU Dresden, 30th June 2015 PSSAI slide 32 of 41

Tabu Search Moves: Swap to nodes in the elimination ordering Neighborhood: All possible solutions that can be obtained with swap of two vertices Tabu list: moved nodes are made tabu for several iterations (Diversification of search) Aspiration criterion: override tabu if solution is autstanding Frequency-based memory TU Dresden, 30th June 2015 PSSAI slide 33 of 41

Genetic Algorithms Population of randomly created individuals Tournament selection selects an individual by randomly choosing a group of several individuals from former population Individual of highest fitness (smallest width) within group is selected for next population Applied until enough individuals have entered next population TU Dresden, 30th June 2015 PSSAI slide 34 of 41

Crossover Operators Order Crossover (OX) Selects crossover area within the parents by randomly selecting two positions within the ordering Elements in crossover area of first parent are copied to offspring Starting at end of crossover area all elements outside the area are inserted in same order in which they occur in second parent 1 2 3 4 5 6 7 8 2 4 6 8 7 5 3 1 8 7 3 4 5 1 2 6 4 5 6 8 7 1 2 3 TU Dresden, 30th June 2015 PSSAI slide 35 of 41

Crossover Operators ctd. Order-based Crossover (OBX) Selects at random several positions in the parent orderings by tossing a coin for each position Elements of first parent at these positions are inserted in first child in the order of the second parent Elements of second parent at these positions are inserted in second child in the order of the first parent 1 2 3 4 5 6 7 8 2 4 6 8 7 5 3 1 1 2 3 4 6 5 7 8 2 4 3 8 7 5 6 1 TU Dresden, 30th June 2015 PSSAI slide 36 of 41

Mutation Operators Exchange Mutation Operator (EM) Randomly selects two elements and exchanges them. 1 2 3 4 5 6 7 8 1 2 6 4 5 3 7 8 TU Dresden, 30th June 2015 PSSAI slide 37 of 41

Mutation Operators Exchange Mutation Operator (EM) Randomly selects two elements and exchanges them. 1 2 3 4 5 6 7 8 1 2 6 4 5 3 7 8 Insertion Mutation Operator (ISM) Randomly chooses an element and moves it to randomly selected position. 1 2 3 4 5 6 7 8 1 2 4 5 6 7 3 8 TU Dresden, 30th June 2015 PSSAI slide 38 of 41

Which Algorithm to Use? If width is not critical then MCS or Min-fill For exact solutions and small examples: Branch and Bound or A For longer examples and better width: MCS, Min-Fill, Iterated local search or GA TU Dresden, 30th June 2015 PSSAI slide 39 of 41

Summary Problems with small treewidth are solvable in polynomial time (if treedecomposition is given) Idea of decomposing a problem in smaller sub-problems to solve them more efficiently Width of treedecomposition depends on the elimination ordering Finding treewidth is NP hard Tree decomposition problem search for the best elimination ordering of vertices! Branch and bound A Maximum Cardinality Search (MCS) Min-Fill Heuristic Tabu Search Genetic Algorithms Iterated Local Search Literature and Benchmark Instances for tree decomposition: TreewidthLIB http://www.staff.science.uu.nl/~bodla101/treewidthlib/ index.php TU Dresden, 30th June 2015 PSSAI slide 40 of 41

References Thomas Hammerl, Nysret Musliu and Werner Schafhauser. Metaheuristic Algorithms and Tree Decomposition, Handbook of Computational Intelligence, pp 1255 1270, Springer, 2015. Hans L. Bodlaender, Arie M.C.A. Koster. Treewidth computations I. Upper bounds, Comput. 208(2): 259 275, 2010. TU Dresden, 30th June 2015 PSSAI slide 41 of 41