This document proposes an approximate encoding method for at-most-k constraints that reduces boolean expressions compared to conventional encodings, though it does not cover all possible solutions. It recursively applies at-most constraints by multiplying the number of variables. For a 2x2 recursive model, it achieves a 44% solution coverage using only 15% of the literals required by a sequential counter encoding. The approximate encoding is intended for use with soft constraints to efficiently search for better solutions, rather than finding all possible solutions.
2. At-most-k constraints and encodings
the number of true values ≦ k
problem: Boolean expressions will explode
proposed encodings in the past:
binary, sequential counter, commander, product, etc..
2
3. the number of true values ≦ k
problem: Boolean expressions will explode
proposed encodings in the past:
binary, sequential counter, commander, product, etc..
3
are absolutely at-most-k
here is approximately at-most-k
At-most-k constraints and encodings
4. the number of true values ≦ k
problem: Boolean expressions will explode
proposed encodings in the past:
binary, sequential counter, commander, product, etc..
4
are absolutely at-most-k
here is approximately at-most-k
covers all solutions
only covers
a part of solutions
At-most-k constraints and encodings
7. Soft constraints
Not necessary but preferred
In common with optimization problems
Example: university timetabling
minimize empty time slots in between
minimize the number of teachers who have continuous classes
it is preferable a subject is always taught in the same room
7
17. 17
• again, is not a real at-most-k
• should use for only soft constraints
18. 2x2 models
18
x 2 x 2
x2 x2 x2 x2
two parents and four children
define recursively
19. 2x2 models
19
x 2 x 2
x2 x2 x2 x2
m
at most k of 4
approximate-at-most-
(k/2 · 2m+1) of 2m+1
20. h x w models
20
h1
w1
h2
w2
h2
w2
hn
wn
hn・m hn・m
hn
wn
height h and width w
21. h x w models
21
h1
w1
h2
w2
h2
w2
hn
wn
hn・m hn・m
hn
wn
at most k of h1·w1
approximate-at-most-
(k/(h1·w1) · Π hi·wi·m)
of Π hi·wi·m
22. h x w models
22
h1
w1
h2
w2
h2
w2
hn
wn
hn・m hn・m
hn
wn
at most k of h1·w1
approximate-at-most-
(k/(h1·w1) · Π hi·wi·m)
of Π hi·wi·m
notation:
approximate-at-most-(a/b·n) of n
37. Low efficiency between highs
37
24 of 30 :
high efficiency
at-most-6
fix 2 falses and 0 trues
26 of 30 :
high efficiency
at-most-7
fix 0 falses and 2 trues
(24 of 32 → 24 of 30) (28 of 32 → 26 of 30)
25 of 30 :
low efficiency
at-most-5
fix 1 false and 5 trues
(30 of 36 → 25 of 30)
38. Low efficiency between highs
38
24 of 30 :
high efficiency
at-most-6
fix 2 falses and 0 trues
26 of 30 :
high efficiency
at-most-7
fix 0 falses and 2 trues
(24 of 32 → 24 of 30) (28 of 32 → 26 of 30)
25 of 30 :
low efficiency
at-most-5
fix 1 false and 5 trues
(30 of 36 → 25 of 30)
42. Discussion2: probability of finding solutions
When approximate-at-most-k covers 50% of the possible
solutions, every single solution has probability 50% to be found.
42
43. Discussion2: probability of finding solutions
When approximate-at-most-k covers 50% of the possible
solutions, every single solution has probability 50% to be found.
43
For a real-life problem ..
• has 1 solution → 50% to find
• has 2 solutions → 75% to find (whichever)
:
• has 10 solutions → 99.9% to find (whichever)
:
44. Discussion2: probability of finding solutions
When approximate-at-most-k covers 50% of the possible
solutions, every single solution has probability 50% to be found.
44
For a real-life problem ..
• has 1 solution → 50% to find
• has 2 solutions → 75% to find (whichever)
:
• has 10 solutions → 99.9% to find (whichever)
:
coverage ≠ finding probability
45. Conclusion
at-most-k constraints are recursively applied (with multiplying)
less Boolean expressions needed than conventional encodings,
but does not cover all solutions
available for searching better solutions under soft constraints
Ex. at-most-16 of 32
only 15% of literal number (vs sequential counter)
covers 44% of the solution space
45
Editor's Notes
At-most-k is a constraint of that the number of true values are less than or equal to k.
About encodings of at-most-k constraint, there is a problem that, Boolean expressions will explode.
To tackles this problem, several encodings had been proposed, such as, binary encoding, sequential counter encoding, commander encoding, product encoding, et cetera.
Those encodings are absolutely at-most-k.
In contrast, this study proposes approximate at-most-k.
(wait)
The difference is, conventional, absolute at-most-k covers all solutions.
However, approximate-at-most-k only covers a part of solutions.
(wait)
Here is a comparison table.
About solution coverage, conventional at-most-k completely covers solution but approximate is incomplete.
So about purposes, conventional at-most-k is available for both of hard constraints and soft constraints but approximate is for only soft constraints.
Where hard and soft means, as stated below, hard constraints are necessities and soft constraints are to describe optional desires.
Obviously approximate-at-most-k has limitation, but I will show you that approximate-at-most-k drastically reduces Boolean expressions.
Here, I would like to mention about soft constraints again.
Soft constraints are not necessary but preferred constraints.
This notion is in common with optimization problems.
For example on university timetableing.
We want to minimize empty time slots in between.
or, minimize the number of teachers who have continuous classes.
Also it is preferable a subject is always taught in the same room.
And so on.
(wait)
From here, I will introduce the fundamental idea of this study.
We consider four Boolean variables named A and eight variables named B.
First, at-most-2 constraint is applied on set A of four variables.
Then, we consider the left half of two variables, A1, and it constraint the left half of B, B1, with 2 times at-most.
2 times at-most means that,
When A1 has no true values, B1 is constrained by at-most-0, so no trues allowed.
(wait)
When A1 has 1 true value, B1 is constrained by at-most-2.
(wait)
When A1 has 2 true values, B1 is constrained by at-most-4, that makes no sense as a constraint.
(wait)
To wrap up, B1 is constrained by 2 times at-most of he number of trues in A1.
(wait)
As a result, by giving at-most-2 constraint to A, we obtain at-most-4-like constraint out of 8 variables in B.
With this idea, this combination of truth value, the bottom part, true true false false false true false true, is satisfiable.
In contrast, this combination 3 trues in the left and 1 true in the right, is not satisfiable.
(wait)
So I named this idea approximate-at-most.
(wait)
I would like to remark about approximate-at-most-k,
Again, is not a real at-most-k
And should be used for only soft constraints
(wait)
Here are 2 times 2 models for approximate-at-most-k.
They have two variables as parents and four variables as children
And recursively defined
on 2 times 2 models, when you give at-most-k on four variables at the top node, we obtain approximate-at-most as this formula.
(wait)
Next, generalized h times w models.
Each node has height h and width w.
(wait)
on these models, when you give at-most-k on the variables at the top node, we obtain approximate-at-most as this formula.
(wait)
And I would like to denote with fractional form, like a divided by b.
(wait)
Here is a graph of literal number comparison on 2 times 2 models.
Approximate is compared to sequential counter encoding.
Black line is approximate and gray is counter.
As the number of target variables increases, the difference between approximate and counter is enlarged.
And dashed is added. It denotes literal rates of approximate par counter.
As expected, approximate consumes a lower number than a conventional encoding.
(wait)
This graph indicates coverages.
That means the number of solutions by approximate divided by the number of all solutions.
Predictably, it becomes lower as target variables increase.
Literal rates I mentioned before is added.
You can see how much solutions are covered by how much literals.
For instance, about at-most-half-of-32, approximate covers 44% solutions on 15% literals.
One could say it is efficient when less literals covers large solution space.
So, we can define efficiency as coverage par literal rate.
The blue line describes efficiency.
In this graph, at-most-half-of 32 is the most efficient
Before moving on to generalized h times w models, we should check a method of adjustment.
When you want to generate approximate-at-most-k of n for arbitrary k and n, first you build a h times w model, and then you have to adjust by fixing some variables.
For example, when a model provides approximate-8 of 16, (there are 16 target variables)
If you fix 2 variables to false and 4 variables to true,
You obtain approximate-at-most 4 of 10.
(wait)
We use this method of adjustment
Here is example 1 of h times w models.
We want to generate approximate 5 of 10.
Using this model and giving at-most 2 at the top, we obtain approximate-at-most 6 of 12.
And we fix 1 false and 1 true, then it is transformed approximate-at-most 5 of 10.
This is example2.
In a similar way, another h times w models can be used to generate approximate-at-most 5 of 10.
As seen above, we can implement for specific k of n by using many kind of h times w models.
So I check efficiencies of each implements, and this shows the best efficiencies.
Blue line is approximate-at-most-k of 10.
Red is of 20.
Gray is of 30
(wait)
Here we notice a peculiar point.
24 of 30 is high efficiency.
25 of 30 is low efficiency.
And 26 of 30 is high efficiency
Each models are like these.
(wait)
Both high efficiency 24 and 26 are based on the same model.
But 25 is not able to implement from this model.
Any adjustment cannot work.
So 25 cannot mark high efficiency
This is discussion1.
A kind of hierarchy of solutions.
At-most-7 solutions are included in at-most-8 solutions,
At-most-6 solutions are included in at-most-7 solutions,
And so on
And this study’s definition of coverage consider this range
(wait)
But when people seek a better solution, I think maximum solution, at-most-8 in this example, would be important.
I suppose this has to be considered
And discussion 2, probability of finding solutions.
When approximate-at-most-k covers 50% of the possible solutions, every single solution has probability 50% to be found
For a real-life problem.
When it has 1 solution, 50% to find.
When it has 2 solutions, 75% to find, for whichever solutions.
And when 10 solutions, 99.9% to find
So coverage is not finding probability.
This will be also considered in future works