238 research outputs found

    Crossword Construction using Constraint Satisfaction and Simulated Annealing

    Get PDF
    Selle töö eesmärk on luua programm, mis koostab ristsõnu, kasutades kahte meetodit: kitsenduste rahuldamist (KR) ahne algoritmiga ja libalõõmutamist (LL), ning võrrelda nende meetodite efektiivsust. Tööd hakatakse kasutama õppematerjalina aine Tehisintellekt I õpetamisel. Ristsõna koostamine on üks tehisintellekti probleemidest, mis kuulub NP-täielike klassi. Seega hea lahenduse leidmine nõuab palju ressursse ja aega. Aga eksisteerivad meetodid, mis võimaldavad lahenduse leidmise aega vähendada. Nende hulgas on ka KR ja LL. KR kasutades seatakse antud ülesandele kitsendusi, mis teevad lahendamise lihtsamaks. Ristsõna koostamisel kehtivad järgmised kitsendused: 1.Sõna ei saa olla lühem, kui ruutude järjend, kuhu seda pannakse. 2.Sõna ei saa olla pikem, kui ruutude järjend, kuhu seda pannakse. 3.Kui järjendis on mõned tähed juba olemas, siis sõna, mis pannakse sellesse järjendisse, peab neid tähti sisaldama täpselt nendel samadel positsioonidel ja ei saa sisaldada mingeid teisi tähti nendel positsioonidel. Kui sõna rahuldab neid tingimusi, siis teda võetakse vastu ning ahne algoritm otsustab, kasutades heuristilist funktsiooni, kas see sõna on parim lahendus selles olukorras.Niiviisi püüab programm lõpliku sammude hulgaga optimaalse lahenduseni jõuda. LL töötab nii: antud on suvaline algseisund s, leida tema naaberseisund s', kui uus seisund on jooksvast seisundist parem, siis valida see, aga kui leitud seisund on jooksvast seisundist halvem, siis kasutada tõenäosus funktsiooni P, et otsustada, kas valida seda seisundit või mitte. Sellist operatsiooni korratakse kuni rahuldav lahendus on leitud või algoritm on juba teinud lubatud arvu samme. Tõenäosus, et algoritm valib uueks seisundiks halvema seisundi väheneb aja jooksul (kooskõlas nn temperatuuri alanemisega). Meetodeid on testitud ja võrreldid, kasutades erinevaid heuristikuid.The main goal of this thesis is to create a program that allows constructing crosswords, using two different algorithms. Given a grid and a text file with words (dictionary), the program should search for suitable words from a dictionary to fill the grid. The program should be able to complete this task in two different ways, in this case using constraint satisfaction method (CSM) with greedy algorithm and simulated annealing. Afore-mentioned algorithms were chosen mainly for educational purposes, since construction of the fastest algorithm is not a goal of this work. Along with other similar Artificial Intelligence problems, like N queens problem, map colouring and Sudoku solving (which is also NP-complete problem), crossword construction is a good example of simple, yet nontrivial task. The choice of CSM with greedy algorithm is obvious. If there are no constraints, the program will simply try to fill each entry by placing up to all, and that means also the words that are of inappropriate length, words in vocabulary until it finds first suitable or runs out of words. For example, by putting constraints on words length and already filled letters, the construction time can be drastically reduced. The simulated annealing was chosen with intention to show that the same problem can be solved in different ways and also to illustrate the difference in algorithm processing and its effectiveness. In addition, simulated annealing is quite similar to greedy algorithm, thus making their comparison a bit easier, but more interesting

    Symmetry in constraint programming

    Get PDF
    Constraint programming is an invaluable tool for solving many of the complex NP-complete problems that we need solutions to. These problems can be easily described as Constraint Satisfaction Problems (CSPs) and then passed to constraint solvers: complex pieces of software written to solve general CSPs efficiently. Many of the problems we need solutions to are real world problems: planning (e.g. vehicle routing), scheduling (e.g. job shop schedules) and timetabling problems (e.g. staff rotas) to name but a few. In the real world, we place structure on objects to make them easier to deal with. This manifests itself as symmetry. The symmetry in these real world problems make them easier to deal with for humans. However, they lead to a great deal of redundancy when using computational methods of problem solving. Thus, this thesis examines some of the many aspects of utilising the symmetry of CSPs to reduce the amount of computation needed by constraint solvers. In this thesis we look at the ease of use of previous symmetry breaking methods. We introduce a new and novel method of describing the symmetries of CSPs. We look at previous methods of symmetry breaking and show how we can drastically reduce their computation while still breaking all symmetry. We give the first detailed investigation into the behaviour of breaking only subsets of all symmetry. We look at how this affects the performance of constraint solvers before discovering the properties of a good symmetry. We then present an original method for choosing the best symmetries to use. Finally, we look at areas of redundant computation in constraint solvers that no other research has examined. New ways of dealing with this redundancy are proposed with results of an example implementation which improves efficiency by several orders of magnitude

    Finite Energy Survey Propagation for Constraint Satisfaction Problems

    Get PDF
    The Survey Propagation (SP) algorithm [1] has recently been shown to work well in the hard region for random K-SAT problems. SP has its origins in sophisticated arguments in statistical physics, and can be derived from an approach known as the cavity method, when applied at what is called the one-step replica symmetry breaking level. In its most general form, SP can be applied to general constraint satisfaction problems, and can also be used in the unsatisfiable region, where the aim is to minimize the number of violated constraints. In this paper, we formulate the SP-Y algorithm for general constraint satisfaction problems, applicable for minimizing the number of violated constraints. This could be useful, for example, in solving approximate subgraph isomorphism problems. Preliminary results show that SP can solve a few instances of induced subgraph isomorphism for which belief propagation failed to converge.Singapore-MIT Alliance (SMA

    Random Max-CSPs Inherit Algorithmic Hardness from Spin Glasses

    Full text link
    We study random constraint satisfaction problems (CSPs) in the unsatisfiable regime. We relate the structure of near-optimal solutions for any Max-CSP to that for an associated spin glass on the hypercube, using the Guerra-Toninelli interpolation from statistical physics. The noise stability polynomial of the CSP's predicate is, up to a constant, the mixture polynomial of the associated spin glass. We prove two main consequences: 1) We relate the maximum fraction of constraints that can be satisfied in a random Max-CSP to the ground state energy density of the corresponding spin glass. Since the latter value can be computed with the Parisi formula, we provide numerical values for some popular CSPs. 2) We prove that a Max-CSP possesses generalized versions of the overlap gap property if and only if the same holds for the corresponding spin glass. We transfer results from Huang et al. [arXiv:2110.07847, 2021] to obstruct algorithms with overlap concentration on a large class of Max-CSPs. This immediately includes local classical and local quantum algorithms.Comment: 41 pages, 1 tabl

    Increasing symmetry breaking by preserving target symmetries and eliminating eliminated symmetries in constraint satisfaction.

    Get PDF
    在約束滿足問題中,破壞指數量級數量的所有對稱通常過於昂貴。在實踐中,我們通常只有效地破壞對稱的一個子集。我們稱之為目標對稱。在靜態對稱破壞中,我們的目標是發佈一套約束去破壞這些目標對稱,以達到減少解集以及搜索空間的效果。一個問題中的所有對稱之間是互相交織的。一個旨在特定對稱的破壞對稱約束几乎總會產生副作用,而不僅僅破壞了預期的對稱。破壞相同目標對稱的不同約束可以有不同的副作用。傳統智慧告訴我們應該選擇一個破壞更多對稱從而有更多副作用的破壞對稱約束。雖然這樣的說法在許多方面上都是有效的,我們應該更加注意副作用發生的地方。給與一個約束滿足問題,一個對稱被一個約束保留當且僅當該對稱仍然是新的約束滿足問題的對稱。這個新的約束滿足問題是有原問題加上該約束組成的。我們給出定律和例子,以表明發佈儘量保留目標對稱以及限制它的副作用發生在非目標對稱上的破壞約束是有利的。這些好處來自于被破壞的對稱數目以及一個對稱被破壞(或消除)的程度,并導致一個較小的解集和搜索空間。但是,對稱不一定會被保留。我們顯示,旨在一個已經被消除的目標對稱的破壞對稱約束仍然可以被發佈。我們建議根據問題的約束以及其他破壞對稱約束來選擇破壞對稱約束,以繼續消除更多的對稱。我們進行了廣泛的實驗來確認我們的建議的可行性與效率。Breaking the exponential number of all symmetries of a constraint satisfaction problem is often too costly. In practice, we often aim at breaking a subset of the symmetries efficiently, which we call target symmetries. In static sym-metry breaking, the goal is to post a set of constraints to break these target symmetries in order to reduce the solution set and thus also the search space. Symmetries of a problem are all intertwined. A symmetry breaking constraint intended for a particular symmetry almost always breaks more than just the intended symmetry as a side-effect. Different constraints for breaking the same target symmetry can have different side-effects. Conventional wisdom suggests that we should select a symmetry breaking constraint that has more side-effects by breaking more symmetries. While this wisdom is valid in many ways, we should be careful where the side-effects take place.A symmetry σ of a CSP P =(V, D, C) is preserved by a set of symmetry breaking constraints C{U+02E2}{U+1D47} i σ is a symmetry of P¹ =(V, D, CU C{U+02E2}{U+1D47}). We give theorems and examples to demonstrate that it is beneficial to post symmetry breaking constraints that preserve the target symmetries and restrict the side-effects to only non-target symmetries as much as possible. The benefits are in terms of the number of symmetries broken and the extent to which a symmetry is broken (or eliminated), resulting in a smaller solution set and search space. However, symmetry preservation may not always hold. We illustrate that symmetry breaking constraints, which aim at a target symmetry that is already eliminated, can still be posted. To continue eliminating more symmetries, we suggest to select symmetry breaking constraints based on problem constraints and other symmetry breaking constraints. Extensive experiments are also conducted to confirm the feasibility and efficiency of our proposal empirically.Detailed summary in vernacular field only.Detailed summary in vernacular field only.Li, Jingying.Thesis (M.Phil.)--Chinese University of Hong Kong, 2012.Includes bibliographical references (leaves 101-112).Abstracts also in Chinese.Chapter 1 --- Introduction --- p.1Chapter 1.1 --- Constraint Satisfaction Problems --- p.1Chapter 1.2 --- Motivation and Goals --- p.3Chapter 1.3 --- Outline of Thesis --- p.5Chapter 2 --- Background --- p.8Chapter 2.1 --- Constraint Satisfaction Problems --- p.8Chapter 2.1.1 --- Backtracking Search --- p.9Chapter 2.1.2 --- Consistency Techniques --- p.12Chapter 2.1.3 --- Local Consistencies with Backtracking Search --- p.15Chapter 2.2 --- Symmetry Breaking in CSPs --- p.16Chapter 2.2.1 --- Symmetry Classes --- p.18Chapter 2.2.2 --- Breaking Symmetries --- p.22Chapter 2.2.3 --- Variable and Value Symmetries --- p.23Chapter 2.2.4 --- Symmetry Breaking Constraints --- p.26Chapter 3 --- Effects of Symmetry Breaking Constraints --- p.29Chapter 3.1 --- Removing Symmetric Search Space --- p.29Chapter 3.1.1 --- Properties --- p.30Chapter 3.1.2 --- Canonical Variable Orderings --- p.31Chapter 3.1.3 --- Regenerating All Solutions --- p.33Chapter 3.1.4 --- Remaining Solution Set Sizes --- p.36Chapter 3.2 --- Constraint Interactions in Propagation --- p.43Chapter 4 --- Choices of Symmetry Breaking Constraints --- p.45Chapter 4.1 --- Side-Effects --- p.45Chapter 4.2 --- Symmetry Preservation --- p.50Chapter 4.2.1 --- De nition and Properties --- p.50Chapter 4.2.2 --- Solution Reduction --- p.54Chapter 4.2.3 --- Preservation Examples --- p.55Chapter 4.2.4 --- Preserving Order --- p.64Chapter 4.3 --- Eliminating Eliminated Symmetries --- p.65Chapter 4.3.1 --- Further Elimination --- p.65Chapter 4.3.2 --- Aggressive Elimination --- p.71Chapter 4.4 --- Interactions with Problem Constraints --- p.72Chapter 4.4.1 --- Further Simplification --- p.72Chapter 4.4.2 --- Increasing Constraint Propagation --- p.73Chapter 5 --- Experiments --- p.75Chapter 5.1 --- Symmetry Preservation --- p.75Chapter 5.1.1 --- Diagonal Latin Square Problem --- p.76Chapter 5.1.2 --- NN-Queen Problem --- p.77Chapter 5.1.3 --- Error Correcting Code - Lee Distance (ECCLD) --- p.78Chapter 5.2 --- Eliminating Eliminated Symmetries --- p.80Chapter 5.2.1 --- Equidistance Frequency Permutation Array Problem --- p.80Chapter 5.2.2 --- Cover Array Problem --- p.82Chapter 5.2.3 --- Sports League Scheduling Problem --- p.83Chapter 6 --- Related Work --- p.86Chapter 6.1 --- Symmetry Breaking Approaches --- p.86Chapter 6.2 --- Reducing Overhead and Increasing Propagation --- p.90Chapter 6.3 --- Selecting and Generating Choices --- p.91Chapter 6.3.1 --- Reducing Conflict with Search Heuristic --- p.92Chapter 6.3.2 --- Choosing the Subset of Symmetries --- p.93Chapter 6.4 --- Detecting Symmetries --- p.93Chapter 7 --- Conclusion and Remarks --- p.95Chapter 7.1 --- Conclusion --- p.95Chapter 7.2 --- Discussions --- p.97Chapter 7.3 --- Future Work --- p.99Bibliography --- p.10
    corecore