Questions tagged [constraint-programming]
77 questions
20
votes
1 answer
When to use SAT vs Constraint Satisfaction?
If I have a hard problem, one standard approach is to express it as a SAT instance and try running a SAT solver on it. Another standard approach is to express it as a constraint satisfaction problem, and try using a CSP solver. The two feel…
D.W.
- 167,959
- 22
- 232
- 500
17
votes
4 answers
Can constraint satisfaction problems be solved with Prolog?
Is "party attendance" type of problems solvable in Prolog? For example:
Burdock Muldoon and Carlotta Pinkstone both said they would come if Albus Dumbledore came. Albus Dumbledore and Daisy Dodderidge both said they would come if Carlotta Pinkstone…
Tegiri Nenashi
- 475
- 4
- 7
10
votes
1 answer
In Constraint Programming, are there any models that take into account the number of variable changes?
Consider a CSP model where changing the value of a particular variable is expensive. Is there any work where the objective function also considers the number of changes in the value of the variable during the search process?
An example: The…
amit kumar
- 201
- 1
- 4
8
votes
2 answers
A tentative satisfiability algorithm
General satisfiability (with a few exceptions such as Horn Clauses) is not believed to have an algorithmic solution. However, the following algorithm appears to be a solution for general satisfiability. What exactly is the flaw with the following…
user1422
8
votes
1 answer
Find subsequence of maximal length simultaneously satisfying two ordering constraints
We are given a set $F=\{f_1, f_2, f_3, …, f_N\}$ of $N$ Fruits. Each Fruit has price $P_i$ and vitamin content $V_i$; we associated fruit $f_i$ with the ordered pair $(P_i, V_i)$. Now we have to arrange these fruits in such a way that the sorted…
Jack
- 329
- 1
- 5
7
votes
2 answers
How to impose Euclidean distance constraint in a constraint satisfaction problem without quadratic constraints?
Best reference I could find is this one. However, I could not quite understand this one since there is no numerical example.
What I am trying to achieve with one sentence
How can I answer the following question by using constraint programming:
The…
padawan
- 1,455
- 1
- 12
- 30
7
votes
1 answer
In a CSP, what is an extensional constraint?
When talking about Constraint Satisfaction Problems (CSP), what does the term extensional constraint mean?
Daniel Kats
- 223
- 1
- 4
5
votes
2 answers
Find a binary matrix so that no vector from {-1,0,1}^n is in its kernel
Given integers $n,m$, I want to find a $m \times n$ binary matrix $X$ such that there does not exist any non-zero vector $y \in \{-1,0,1\}^n$ with $Xy=0$ (all operations performed over $\mathbb{Z}$). What algorithm could I use for this?
In more…
marshall
- 143
- 6
5
votes
1 answer
Graph coloring with fixed-size color classes
I'm interested in coloring a graph, but with slightly different objectives than the standard problem. It seems like the focus of most graph-coloring algorithms (DSATUR etc) is to minimize the number of color classes used.
My goal, in contrast, is to…
Raphie Palefsky-Smith
- 153
- 4
4
votes
0 answers
(Historical perspective) CSP and SAT inter-fertilization
[Disclaimer: this is a rather specialized question]
It is known that techniques like Conflict-Driven Clause Learning (CDCL) and back-jumping -- which improved the Satisfiability (SAT) strategies exponentially -- were actually inspired [2] by…
ZakC
- 141
- 1
4
votes
1 answer
Maximum set of equalities, subject to some inequalities
I have $n$ variables $x_1,\dots,x_n$. I'm given a set $E$ of equalities (each of the form $x_i=x_j$ for some $i,j$) and a set $I$ of inequalities (each of the form $x_i \ne x_j$ for some $i,j$). I want to find a maximum-size subset $E' \subseteq…
D.W.
- 167,959
- 22
- 232
- 500
4
votes
1 answer
Extracting maximum information from a set of exam answers and their scores
Imagine we have a multiple-choice exam with N questions.
Suppose we have a set of K answer sheets to the exam and their total scores (1 for a correct answer on a question, 0 for incorrect).
How much information can we extract from this set about the…
jkff
- 2,269
- 1
- 14
- 17
4
votes
1 answer
transformation of constraint satisfaction to SAT
How can any Constraint satisfaction problem be converted to an instance of Satisfiability? I have a CSP and i know its NP hard to solve it, but i would like to convert to an instance of k-SAT, but im not sure of any algorithm for transformation
user12987
- 41
- 1
3
votes
2 answers
CSP Forward checking with n-ary (and binary) constraints
I have implemented my own CSP solver using a Backtracking algorithm.
Within the Backtracking algorithm I apply a Forward Checking algorithm (reducing domains of connected, unnasigned variables) that only works with Binary constraints.
The problem I…
Reinder Kas
- 31
- 1
- 4
3
votes
0 answers
Finding multi word anagrams from a set of words
Finding all anagrams for a word $w$ from a set of words is a problem with many well-known solutions (for example make a hash table mapping from the bag of letters of a word to the word).
But what about finding multi-word anagrams? For example…
Teodor Dyakov
- 1,341
- 1
- 13
- 22