NP-Completeness: Proofs

Total Page:16

File Type:pdf, Size:1020Kb

NP-Completeness: Proofs NP-Completeness : Proofs ••• Proof Methods A method to show a decision problem ΠΠΠ NP-complete is as follows. (1) Show ΠΠΠ ∈∈∈ NP. (2) Choose an NP-complete problem ΠΠΠ’. (3) Show ΠΠΠ’ ∝∝∝ ΠΠΠ. A method to show an optimization problem ΨΨΨ NP-hard is as follows. (1) Choose an NP-hard problem ΨΨΨ’ (ΨΨΨ’ may be NP-complete). (2) Show ΨΨΨ’ ∝∝∝ ΨΨΨ. An alternative method to show ΨΨΨ NP-hard is to show the decision version of ΨΨΨ NP-complete. 1 ••• Two Simple Examples Ex. Sum of Subsets Instance : A finite set A of positive integers and a positive integer c. Question : Is there a subset A’ of A whose elements sum to c ? For example, if A = {7, 5, 19, 1, 12, 8, 14} and c = 21, then the answer is yes (A’ = {7, 14}). NP-completeness of Sum of Subsets is shown below. ♣ Sum of Subsets ∈∈∈ NP. ♣ A chosen NP-complete problem : Exact Cover. 2 Exact Cover Instance : A finite set S and k subsets S1, S2, …, Sk of S. Question : Is there a subset of {S1, S2, …, Sk} that forms a partition of S ? For example, if S = {7, 5, 19, 1, 12, 8, 14}, k = 4, S1 = {7, 19, 12, 14}, S2 = {7, 5, 8}, S3 = {5, 1, 8}, and S4 = {19, 1, 8, 14}, then the answer is yes ({S1, S3} forms a partition of S). 3 ♣ Exact Cover ∝∝∝ Sum of Subsets. Let S = {u1, u2, …, um} and S1, S2, …, Sk be an arbitrary instance of Exact Cover. An instance of Sum of Subsets can be obtained in polynomial time as follows. − m 1 i A = {a1, a2, …, ak} and c = ∑ (k + 1) , i=0 where for 1 ≤≤≤ j ≤≤≤ k, m a = e( k + 1)i−1 , j ∑ j, i i=1 with ej,i = 1 if ui ∈∈∈ Sj and ej,i = 0 if ui ∉∉∉ Sj. ⇒ Sum of Subsets has the answer yes if and only if Exact Cover has the answer yes . 4 For example, given the following instance of Exact Cover : S = {7, 5, 19, 1, 12, 8, 14}, k = 4, S1 = {7, 19, 12, 14}, S2 = {7, 5, 8}, S3 = {5, 1, 8}, and S4 = {19, 1, 8, 4}, a matrix e is defined as follows. 7 5 19 1 12 8 14 S 1 1010101 S 1100010 2 S 3 0101010 S 4 0011011 An instance of Sum of Subsets is constructed as follows. 5 0 1 2 6 A = {a1, a2, a3, a4} and c = 5 + 5 + 5 + … + 5 , where 0 2 4 6 st a1 = 5 + 5 + 5 + 5 (1 row of e); 0 1 5 nd a2 = 5 + 5 + 5 (2 row of e); 1 3 5 rd a3 = 5 + 5 + 5 (3 row of e); 2 3 5 6 th a4 = 5 + 5 + 5 + 5 (4 row of e). The construction relates ai with Si and c with S. It is not difficult to see a1 + a3 = c ⇔ S1 ∪∪∪ S3 = S and S1 ∩∩∩ S3 = ∅∅∅. 6 Ex. Partition Instance : A multiset B = {b1, b2, …, bn} of positive integers. Question : Is there a subset B’ ⊆⊆⊆ B such that ∑ bi = ∑ b j ? bi∈∈∈ B' bj∈∈∈ B− B' For example, when B = {17, 53, 9, 35, 41, 32, 35}, then the answer is yes (B’ = {17, 53, 41}). NP-completeness of Partition is shown below. ♣ Partition ∈∈∈ NP. ♣ A chosen NP-complete problem : Sum of Subsets. 7 ♣ Sum of Subsets ∝∝∝ Partition Let A = {a1, a2, …, am} and c be an arbitrary instance of Sum of Subsets. An instance of Partition can be obtained in polynomial time as follows: B = A ∪∪∪ { am+1 , am+2 }, where am+1 = c + 1 and am+2 = 1 −−− c + ∑ ai . ai∈∈∈ A Since am+1 + am+2 = ∑ ai + 2, we have ai∈∈∈ A {am+1 , am+2 } ⊄⊄⊄ B’ and {am+1 , am+2 } ⊄⊄⊄ B −−− B’ . We show below that ∑ ai = c if and only if ai∈∈∈Α' am+2 + ∑ ai = am+1 + ∑ ai ai∈∈∈Α' ai∈∈∈ΑΑ− ' (i.e., B’ = A’ + {am+2 }). 8 ⇒⇒⇒ ( ) Suppose ∑ ai = c. ai∈∈∈Α' am+2 + ∑ ai = (1 −−− c + ∑ ai ) + ∑ ai ai∈∈∈Α' ai∈∈∈ A ai∈∈∈Α' = 1 + ∑ ai . ai∈∈∈Α am+1 + ∑ ai = (c + 1) + ∑ ai ai∈∈∈ΑΑ− ' ai∈∈∈ΑΑ− ' = 1 + ∑ ai . ai∈∈∈Α (⇐⇐⇐) Suppose am+2 + ∑ ai = am+1 + ∑ ai , ai∈∈∈Α' ai∈∈∈ΑΑ− ' i.e., B’ = A’ + {am+2 }. Then, (1 −−− c + ∑ ai ) + ∑ ai = (c + 1) + ai∈∈∈ A ai∈∈∈Α' ∑ ai , ai∈∈∈ΑΑ− ' from which ∑ ai = c can be derived. ai∈∈∈Α' 9 Exercise 5. Read Example 8-14 on page 367 of the textbook. (1) Give a reduction from Partition to the bin packing problem. (2) Illustrate the reduction by an example. (3) Verify the reduction. Exercise 6. Read Theorem 11.2 on page 518 of Ref. (2). (1) Give a reduction from Satisfiability to Clique. (2) Illustrate the reduction by an example. (3) Verify the reduction. 10 ••• Three Proof Techniques Restriction Local Replacement Component Design 11 ••• Restriction If a problem ΠΠΠ contains an NP-hard problem ΠΠΠ’ as a special case (i.e., ΠΠΠ’ is a restricted subproblem of ΠΠΠ), then ΠΠΠ is NP-hard. Ex. Exact Cover Instance : A finite set S and k subsets S1, S2, …, Sk of S. Question : Is there a subset of {S1, S2, …, Sk} that forms a partition of S ? Exact Cover by 3-Sets Instance : A finite set S with |S| = 3p and k 3- element subsets S1, S2, …, Sk of S. Question : Is there a subset of {S1, S2, …, Sk} that forms a partition of S ? 12 Exact Cover by 3-Sets is a special case of Exact Cover. 3-Dimensional Matching Instance : A set M ⊆⊆⊆ W ××× X ××× Y, where W, X and Y are three disjoint q-element subsets. Question : Does M contain a matching , i.e., a subset M’ ⊆⊆⊆ M such that |M’ | = q and no two elements of M’ agree in any coordinate ? For example, if W = {0, 1}, X = {a, b}, Y = {+++, −−−}, and M = {(0, a, +++), (1, b, +++), (1, b, −−−)}, then the answer is yes (M’ = {(0, a, +++), (1, b, −−−)}). 3-Dimensional Matching is a special case of Exact Cover by 3-Sets. 13 For example, the following instance of 3-Dimensional Matching : W = {0, 1}, X = {a, b}, Y = {+++, −−−}, and M = {(0, a, +++), (1, b, +++), (1, b, −−−)} can be transformed into an instance of Exact Cover by 3-Sets as follows : S1 = {0 W, aX, +++Y}, S2 = {1 W, bX, +++Y}, S3 = {1 W, bX, −−−Y}, and S = W ∪∪∪ X ∪∪∪ Y = {0W, 1W, aX, bX, +++Y, −−−Y}. Therefore, 3-Dimensional Matching is NP-complete. ⇒⇒⇒ Exact Cover by 3-Sets is NP-complete. ⇒⇒⇒ Exact Cover is NP-complete. 14 Ex. Hamiltonian Cycle Instance : An undirected graph G = (V, E). Question : Does G contain a Hamiltonian Cycle , i.e., an ordering (v1, v2, …, v|V|) of the vertices of G such that ( v1, v|V|) ∈∈∈ E and ( vi, vi+1 ) ∈∈∈ E for all 1 ≤≤≤ i < |V| ? Directed Hamiltonian Cycle Instance : A directed graph G = (V, A), where A is a set of arcs (i.e., ordered pairs of vertices). Question : Does G contain a directed Hamiltonian cycle , i.e., an ordering (v1, v2, …, v|V|) of the vertices of G such that ( v1, v|V|) ∈∈∈ A and ( vi, vi+1 ) ∈∈∈ A for all 1 ≤≤≤ i < |V| ? 15 Hamiltonian Cycle is a special case of Directed Hamiltonian Cycle (or Hamiltonian Cycle ∝∝∝ Directed Hamiltonian Cycle, where each ( u, v) ∈∈∈ E corresponds to two arcs (u, v), ( v, u) ∈∈∈ A). Therefore, Hamiltonian Cycle is NP-complete. ⇒⇒⇒ Directed Hamiltonian Cycle is NP-complete. 16 Hamiltonian Path between Two Vertices Instance : An undirected graph G = (V, E) and two distinct vertices u, v ∈∈∈ V. Question : Does G contain a Hamiltonian path starting at u and ending at v, i.e., an ordering (v1, v2, …, v|V|) of the vertices of G such that u = v1, v = v|V|, and (vi, vi+1 ) ∈∈∈ E for all 1 ≤≤≤ i < |V| ? Hamiltonian Cycle ∝∝∝ Hamiltonian Path between Two Vertices : if the latter is polynomial time solvable, then the former is also polynomial time solvable (considering all edges (u, v) ∈∈∈ V for the latter). ⇒⇒⇒ Hamiltonian Path between Two Vertices is NP-complete. 17 Hamiltonian Path Instance : An undirected graph G = (V, E). Question : Does G contain a Hamiltonian path ? Hamiltonian Cycle ∝∝∝ Hamiltonian Path : For each (u, v) ∈∈∈ E, construct an instance of Hamiltonian Path by adding x, y to V and (x, u), ( y, v) to E (thus G’ is induced). x y u v u v G G’ G has a Hamiltonian cycle if and only if G’ has a Hamiltonian x-y path. ⇒⇒⇒ If Hamiltonian Path is polynomial time solvable, then Hamiltonian Cycle is also polynomial time solvable. ⇒ Hamiltonian Path is NP-complete. 18 Exercise 7. Show the following two problems NP- complete by restriction to Hamiltonian Path and Partition, respectively. Bounded Degree Spanning Tree Instance : An undirected graph G = (V, E) and a positive integer k ≤≤≤ |V| −−− 1. Question : Does G contains a spanning tree in which each node has degree at most k ? 0/1 Knapsack + Instance : A finite set U, a “size” s(u) ∈∈∈ Z and + a “value” v(u) ∈∈∈ Z for each u ∈∈∈ U, a + size constraint b ∈∈∈ Z , and a value + goal k ∈∈∈ Z . Question : Is there a subset U’ ⊆⊆⊆ U such that ∑ s( u ) ≤≤≤ b and ∑ v( u ) ≥≥≥ k ? u∈∈∈ U' u∈∈∈ U' 19 ••• Local Replacement In order to show ΠΠΠ’ ∝∝∝ ΠΠΠ, local replacement specifies the “basic units” for ΠΠΠ’ and replaces them with others, while constructing a corresponding instance of ΠΠΠ. Usually, local replacement has one kind of basic units that each are replaced with the same structure.
Recommended publications
  • Solving Sudoku with Dancing Links
    Solving Sudoku with Dancing Links Rob Beezer [email protected] Department of Mathematics and Computer Science University of Puget Sound Tacoma, Washington USA African Institute for Mathematical Sciences October 25, 2010 Available at http://buzzard.pugetsound.edu/talks.html Example: Combinatorial Enumeration Create all permutations of the set f0; 1; 2; 3g Simple example to demonstrate key ideas Creation, cardinality, existence? There are more efficient methods for this example Rob Beezer (U Puget Sound) Solving Sudoku with Dancing Links AIMS October 2010 2 / 37 Brute Force Backtracking BLACK = Forward BLUE = Solution RED = Backtrack root 0 1 2 0 1 3 3 0 2 1 0 2 3 3 0 3 1 0 3 1 0 2 0 0 1 2 2 0 1 3 0 2 1 3 0 2 3 0 3 1 3 0 3 3 1 0 2 1 0 0 0 1 2 0 1 0 2 1 0 2 0 3 1 0 3 1 0 2 0 0 1 2 3 0 0 2 0 0 3 0 1 0 2 2 0 1 0 1 2 0 2 0 2 2 0 3 0 3 2 root 1 0 2 0 1 0 0 1 0 2 0 0 2 0 3 0 0 3 2 0 1 1 0 2 3 0 1 0 1 3 0 2 0 2 3 0 3 0 3 2 1 0 1 0 2 . 0 1 1 0 1 3 0 0 2 1 0 2 3 0 0 3 1 0 3 2 1 1 0 0 .
    [Show full text]
  • Representing Sudoku As an Exact Cover Problem and Using Algorithm X and Dancing Links to Solve the Represented Problem
    Bhavana Yerraguntla Bhagya Dhome SUDOKU SOLVER Approach: Representing Sudoku as an exact cover problem and using Algorithm X and Dancing Links to solve the represented problem. Before we start, let us try to understand what Exact Cover is; Exact Cover: Given a set S and another set X where each element is a subset to S, select a set of subsets S* such that every element in X exist in exactly one of the selected sets. This selection of sets is said to be a cover of the set S. The exact cover problem is a decision problem to find an exact cover. E.g. Let S = {A, B, C, D, E, F} be a collection of subsets of a set X = {1, 2, 3, 4, 5, 6, 7} s t: A = {1, 4, 7} B = {1, 4} C = {4, 5, 7} D = {3, 5, 6} E = {2, 3, 6, 7} F = {2, 7} Then the set of subsets S* = {B, D, F} is an exact cover. Before we represent the Sudoku problem into an exact cover, let’s explore an example smaller. The basic approach towards solving an exact cover problem is simple 1) List the constraints that needs to be satisfied. (columns) 2) List the different ways to satisfy the constraints. (rows) Simple example: Imagine a game of Cricket (a batting innings), the batting order is almost filled with three batsmen A, B, C are yet to be placed and with three exact spots unfilled. One opener, one top order and one middle order. Each batsman must play in one order, and no two batsman must be in the same order.
    [Show full text]
  • Bastian Michel, "Mathematics of NRC-Sudoku,"
    Mathematics of NRC-Sudoku Bastian Michel December 5, 2007 Abstract In this article we give an overview of mathematical techniques used to count the number of validly completed 9 × 9 sudokus and the number of essentially different such, with respect to some symmetries. We answer the same questions for NRC-sudokus. Our main result is that there are 68239994 essentially different NRC-sudokus, a result that was unknown up to this day. In dit artikel geven we een overzicht van wiskundige technieken om het aantal geldig inge- vulde 9×9 sudokus en het aantal van essentieel verschillende zulke sudokus, onder een klasse van symmetrie¨en,te tellen. Wij geven antwoorden voor dezelfde vragen met betrekking tot NRC-sudoku's. Ons hoofdresultaat is dat er 68239994 essentieel verschillende NRC-sudoku's zijn, een resultaat dat tot op heden onbekend was. Dit artikel is ontstaan als Kleine Scriptie in het kader van de studie Wiskunde en Statistiek aan de Universiteit Utrecht. De begeleidende docent was dr. W. van der Kallen. Contents 1 Introduction 3 1.1 Mathematics of sudoku . .3 1.2 Aim of this paper . .4 1.3 Terminology . .4 1.4 Sudoku as a graph colouring problem . .5 1.5 Computerised solving by backtracking . .5 2 Ordinary sudoku 6 2.1 Symmetries . .6 2.2 How many different sudokus are there? . .7 2.3 Ad hoc counting by Felgenhauer and Jarvis . .7 2.4 Counting by band generators . .8 2.5 Essentially different sudokus . .9 3 NRC-sudokus 10 3.1 An initial observation concerning NRC-sudokus . 10 3.2 Valid transformations of NRC-sudokus .
    [Show full text]
  • Posterboard Presentation
    Dancing Links and Sudoku A Java Sudoku Solver By: Jonathan Chu Adviser: Mr. Feinberg Algorithm by: Dr. Donald Knuth Sudoku Sudoku is a logic puzzle. On a 9x9 grid with 3x3 regions, the digits 1-9 must be placed in each cell such that every row, column, and region contains only one instance of the digit. Placing the numbers is simply an exercise of logic and patience. Here is an example of a puzzle and its solution: Images from web Nikoli Sudoku is exactly a subset of a more general set of problems called Exact Cover, which is described on the left. Dr. Donald Knuth’s Dancing Links Algorithm solves an Exact Cover situation. The Exact Cover problem can be extended to a variety of applications that need to fill constraints. Sudoku is one such special case of the Exact Cover problem. I created a Java program that implements Dancing Links to solve Sudoku puzzles. Exact Cover Exact Cover describes problems in h A B C D E F G which a mtrix of 0’s and 1’s are given. Is there a set of rows that contain exactly one 1 in each column? The matrix below is an example given by Dr. Knuth in his paper. Rows 1, 4, and 5 are a solution set. 0 0 1 0 1 1 0 1 0 0 1 0 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 1 We can represent the matrix with toriodal doubly-linked lists as shown above.
    [Show full text]
  • Combinatorialalgorithms for Packings, Coverings and Tilings Of
    Departm en t of Com m u n ication s an d Networkin g Aa lto- A s hi k M a thew Ki zha k k ep a lla thu DD 112 Combinatorial Algorithms / 2015 for Packings, Coverings and Tilings of Hypercubes Combinatorial Algorithms for Packings, Coverings and Tilings of Hypercubes Hypercubes of Tilings and Coverings Packings, for Algorithms Combinatorial Ashik Mathew Kizhakkepallathu 9HSTFMG*agdcgd+ 9HSTFMG*agdcgd+ ISBN 978-952-60-6326-3 (printed) BUSINESS + ISBN 978-952-60-6327-0 (pdf) ECONOMY ISSN-L 1799-4934 ISSN 1799-4934 (printed) ART + ISSN 1799-4942 (pdf) DESIGN + ARCHITECTURE Aalto Un iversity Aalto University School of Electrical Engineering SCIENCE + Department of Communications and Networking TECHNOLOGY www.aalto.fi CROSSOVER DOCTORAL DOCTORAL DISSERTATIONS DISSERTATIONS Aalto University publication series DOCTORAL DISSERTATIONS 112/2015 Combinatorial Algorithms for Packings, Coverings and Tilings of Hypercubes Ashik Mathew Kizhakkepallathu A doctoral dissertation completed for the degree of Doctor of Science (Technology) to be defended, with the permission of the Aalto University School of Electrical Engineering, at a public examination held at the lecture hall S1 of the school on 18 September 2015 at 12. Aalto University School of Electrical Engineering Department of Communications and Networking Information Theory Supervising professor Prof. Patric R. J. Östergård Preliminary examiners Dr. Mathieu Dutour Sikirić, Ruđer Bošković Institute, Croatia Prof. Aleksander Vesel, University of Maribor, Slovenia Opponent Prof. Sándor Szabó, University of Pécs, Hungary Aalto University publication series DOCTORAL DISSERTATIONS 112/2015 © Ashik Mathew Kizhakkepallathu ISBN 978-952-60-6326-3 (printed) ISBN 978-952-60-6327-0 (pdf) ISSN-L 1799-4934 ISSN 1799-4934 (printed) ISSN 1799-4942 (pdf) http://urn.fi/URN:ISBN:978-952-60-6327-0 Unigrafia Oy Helsinki 2015 Finland Abstract Aalto University, P.O.
    [Show full text]
  • Arxiv:0910.0460V3 [Cs.DS] 3 Feb 2010 Ypsu Ntertclapcso Optrsine21 ( 2010 Science Computer of Aspects Theoretical on Symposium Matching
    Symposium on Theoretical Aspects of Computer Science 2010 (Nancy, France), pp. 95-106 www.stacs-conf.org EXACT COVERS VIA DETERMINANTS ANDREAS BJORKLUND¨ E-mail address: [email protected] Abstract. Given a k-uniform hypergraph on n vertices, partitioned in k equal parts such that every hyperedge includes one vertex from each part, the k-Dimensional Match- ing problem asks whether there is a disjoint collection of the hyperedges which covers all vertices. We show it can be solved by a randomized polynomial space algorithm in O∗(2n(k−2)/k) time. The O∗() notation hides factors polynomial in n and k. The general Exact Cover by k-Sets problem asks the same when the partition constraint is dropped and arbitrary hyperedges of cardinality k are permitted. We show it can be ∗ n solved by a randomized polynomial space algorithm in O (ck ) time, where c3 = 1.496, c4 = 1.642, c5 = 1.721, and provide a general bound for larger k. Both results substantially improve on the previous best algorithms for these problems, especially for small k. They follow from the new observation that Lov´asz’ perfect matching detection via determinants (Lov´asz, 1979) admits an embedding in the recently proposed inclusion–exclusion counting scheme for set covers, despite its inability to count the perfect matchings. 1. Introduction The Exact Cover by k-Sets problem (XkC) and its constrained variant k-Dimensional Matching (kDM) are two well-known NP-hard problems. They ask, given a k-uniform hy- pergraph, if there is a subset of the hyperedges which cover the vertices without overlapping each other.
    [Show full text]
  • Unique Covering Problems with Geometric Sets
    Unique Covering Problems with Geometric Sets B Pradeesha Ashok1, Sudeshna Kolay1, Neeldhara Misra2( ), and Saket Saurabh1 1 Institute of Mathematical Sciences, Chennai, India {pradeesha,skolay,saket}@imsc.res.in 2 Indian Institute of Science, Bangalore, India [email protected] Abstract. The Exact Cover problem takes a universe U of n elements, a family F of m subsets of U and a positive integer k, and decides whether there exists a subfamily(set cover) F of size at most k such that each element is covered by exactly one set. The Unique Cover problem also takes the same input and decides whether there is a subfamily F ⊆F such that at least k of the elements F covers are covered uniquely(by exactly one set). Both these problems are known to be NP-complete. In the parameterized setting, when parameterized by k, Exact Cover is W[1]-hard. While Unique Cover is FPT under the same parameter, it is known to not admit a polynomial kernel under standard complexity- theoretic assumptions. In this paper, we investigate these two problems under the assumption that every set satisfies a given geometric property Π. Specifically, we consider the universe to be a set of n points in a real space Rd, d being a positive integer. When d = 2 we consider the problem when Π requires all sets to be unit squares or lines. When d>2, we consider the problem where Π requires all sets to be hyperplanes in Rd. These special versions of the problems are also known to be NP-complete.
    [Show full text]
  • Algorithm X, Conflict-Driven-Clause-Learning
    Algorithm X, Conflict-Driven-Clause-Learning and Dancing Links for Sudoku solving Jeremias Berg Monday 1st December, 2014 1 Introduction In this text we give an informal description of the two algorithms used in the experimental comparison of Sudoku solvers. We direct the reader to the provided references for a more thorough presentation [1, 2]. Our aim is to present both algorithms in a easily followable way. However, basic knowledge of algorithm design, mathematical terminology and data structures is assumed. 2 DLX for exact cover The first algorithm we present is Algorithm X implemented with Dancing Links, known as the DLX algorithm. As mentioned in the Sudoku solver comparison, the algorithm was originally proposed for solving the exact cover problem: Definition 1 Given a binary matrix M let M(r; c) denote the element of M on row r column c. The exact cover problem asks us to decide the existence of a subset of its rows R0 such that for each column c of M there exists exactly one r 2 R0 for which M(r; c) = 1. We call such a subset for an exact cover of the matrix. As an example, consider: 01 0 1 11 @1 1 0 0A : (1) 0 0 0 1 For this matrix no exact cover exists. In order to see this, note that in order to ensure that the potential exact cover includes a 1 on the second column, it has to include the second row. On the other hand, in order to include a 1 in the third column, the first row has to be included.
    [Show full text]
  • Decomposition-Width: Extending the Clique-Width to Hypergraphs
    Decomposition-width: Extending the Clique-width to Hypergraphs Yann Strozecki Universit´eParis-Sud 11, Laboratoire de Recherche en Informatique. Abstract. We define a width parameter for hypergraphs, which we call the decomposition-width. We provide an explicit family of hypergraphs of large decomposition-width and we prove that every MSO property can be checked in linear time for hypergraphs with bounded decomposition- width when their decomposition is given. Finally, the decomposition- width of a graph is proved to be bounded by twice its clique-width, which suggests that decomposition-width is a generalization of clique-width to relations of large or unbounded arity. 1 Introduction Hypergraphs are a straightforward generalization of graphs: their edges or hy- peredges are sets of any number of vertices instead of two. A hypergraph is said to be k-uniform when all its edges are of size k, a 2-uniform hypergraph is thus a graph. Most problems on graphs generalize to hypergraphs and often become harder to solve. For instance, a matching or a spanning tree in a graph can be computed in polynomial time while computing an exact cover in a 3-uniform hypergraph or a spanning hypertree in a 4-uniform hypergraph is NP-hard [1]. Numerous combinatorial structures are nothing but hypergraphs satisfying some properties, like the matroids, the convex geometries or the intersecting set families. The matroid intersection problem, which generalizes many problems in combinatorial optimization, is also NP-hard as soon as three matroids are involved. Besides complexity issues, we have to deal with the representation of hyper- graphs.
    [Show full text]
  • Python for Education: the Exact Cover Problem
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by The Python Papers Anthology The Python Papers 6(2): 4 Python for Education: The Exact Cover Problem Andrzej Kapanowski Marian Smoluchowski Institute of Physics, Jagiellonian University, Cracow, Poland [email protected] Abstract Python implementation of Algorithm X by Knuth is presented. Algorithm X finds all solutions to the exact cover problem. The exemplary results for pentominoes, Latin squares and Sudoku are given. 1. Introduction Python is a powerful dynamic programming language that is used in a wide variety of application domains (Lutz, 2007). Its high level data structures and clear syntax make it an ideal first programming language (Downey, 2008) or a language for easy gluing together tools from different domains to solve complex problems (Langtangen, 2006). The Python standard library and third party modules can speed up programs development and that is why Python is used in thousands of real-world business applications around the world, Google and YouTube, for instance. The Python implementation is under an opes source licence that make it freely usable and distributable, even for commercial use. Python is a useful language for teaching even if students have no previous experience with it. They can explore complete documentation, both integrated into the language and as separate web pages. Since Python is interpreted, students can learn the language by executing and analysing individual commands. Python is sometimes called "working pseudocode" because it is possible to explain an algorithm by means of Python code and next to run a program in order to check if it is correct.
    [Show full text]
  • A Global Constraint for the Exact Cover Problem: Application to Conceptual Clustering Maxime Chabert, Christine Solnon
    A Global Constraint for the Exact Cover Problem: Application to Conceptual Clustering Maxime Chabert, Christine Solnon To cite this version: Maxime Chabert, Christine Solnon. A Global Constraint for the Exact Cover Problem: Application to Conceptual Clustering. Journal of Artificial Intelligence Research, Association for the Advancement of Artificial Intelligence, 2020, 67, pp.509 - 547. 10.1613/jair.1.11870. hal-02507186 HAL Id: hal-02507186 https://hal.archives-ouvertes.fr/hal-02507186 Submitted on 12 Mar 2020 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Journal of Artificial Intelligence Research 67 (2020) 509-547 Submitted 12/2019; published 03/2020 A Global Constraint for the Exact Cover Problem: Application to Conceptual Clustering Maxime Chabert [email protected] Infologic, Universit´ede Lyon, INSA-Lyon, CNRS, LIRIS, F-69621, Villeurbanne, France Christine Solnon [email protected] Universit´ede Lyon, INSA-Lyon, Inria, CITI, CNRS, LIRIS, F-69621, Villeurbanne, France Abstract We introduce the exactCover global constraint dedicated to the exact cover problem, the goal of which is to select subsets such that each element of a given set belongs to exactly one selected subset. This NP-complete problem occurs in many applications, and we more particularly focus on a conceptual clustering application.
    [Show full text]
  • Generic Distributed Exact Cover Solver
    Generic Distributed Exact Cover Solver Jan Magne Tjensvold December 18, 2007 Abstract This report details the implementation of a distributed computing system which can be used to solve exact cover problems. This work is based on Donald E. Knuth’s recursive Dancing Links algorithm which is designed to efficiently solve exact cover problems. A variation of this algorithm is developed which enables the problems to be distributed to a global network of computers using the BOINC framework. The parallel nature of this distributed computing platform allows more complex problems to be solved. Exact cover problems includes, but is not limited to problems like n-queens, Latin Square puzzles, Sudoku, polyomino tiling, set packing and set partitioning. The details of the modified Dancing Links algorithm and the implementation is explained in detail. A Petri net model is developed to examine the flow of data in the distributed system by running a number of simulations. Acknowledgements I wish to thank Hein Meling for his detailed and insightful comments on the report and his helpful ideas on the design and implementation of the software. i Contents 1 Introduction 1 1.1 Queens . 1 1.2 Related work . 3 1.3 Report organization . 3 2 Dancing Links 4 2.1 Exact cover . 4 2.1.1 Generalized exact cover . 5 2.2 Algorithm X . 7 2.3 Dancing Links . 9 2.3.1 Data structure . 10 2.3.2 Algorithm . 11 2.4 Parallel Dancing Links . 12 3 Implementation details 15 3.1 Architecture . 15 3.2 Transforms . 16 3.2.1 n-queens .
    [Show full text]