














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















Brahim Hnich^1 , Steven D. Prestwich^1 , Evgeny Selensky^2 , and Barbara M. Smith^1 (^1) Cork Constraint Computation Centre University College, Cork, Ireland {brahim, s.prestwich, b.smith}@4c.ucc.ie, (^2) Vidus Limited, Ipswich, U.K. [email protected]
Abstract. Covering arrays can be applied to the testing of software, hardware and advanced materials, and to the effects of hormone interac- tion on gene expression. In this paper we develop constraint programming models of the problem of finding an optimal covering array. Our models exploit global constraints, multiple viewpoints and symmetry-breaking constraints. We show that compound variables, representing tuples of variables in our original model, allow the constraints of this problem to be represented more easily and hence propagate better. With our best integrated model, we are able to either prove the optimality of existing bounds or find new optimal solutions, for arrays of moderate size. Local search on a SAT-encoding of the model is able to find improved solutions and bounds for larger problems.
Software and hardware testing play an important role in the process of prod- uct development. For instance, software testing may consume up to half of the overall software development cost [21]. Furthermore, even for simple software or hardware products, exhaustive testing is infeasible because the number of pos- sible test cases is typically prohibitively large. For example, suppose we have a machine with 10 switches that have to be set, each with two positions. We wish to test the machine before shipping. Since there are 2^10 possible combinations, it becomes impractical to test them all. We might instead be satisfied with a test suite in which every subset of, say, three switches gets exercised in all 2^3 possible ways. In such a case, the question becomes: what is the smallest number of test vectors that we need? This problem is an instance of the t-covering array problem.
(^) This work has received support from Science Foundation Ireland under Grant 00/PI.1/C075 and from Bausch & Lomb Ireland and Enterprise Ireland. The first author is also supported by an ILOG Software license grant. We wish to thank Radoslaw Szymanek for useful comments on an earlier draft of the paper
A covering array CA(t, k, g) of size b is an b × k array consisting of b vectors of length k with entries from { 0 , 1 ,... , g − 1 } (g is the size of the alphabet) such that every one of the gt^ possible vectors of size t occurs at least once in every possible selection of t elements from the vectors. The parameter t is referred to as the covering strength. The objective is to find the minimum b for which a CA(t, k, g) of size k exists. As an example, consider generating test vectors for all triples of 5 binary parameters that test all combinations of 3 parameters (t = 3, k = 5, g = 2), i.e. finding a CA(3, 5 , 2). The matrix in Figure 1 shows an optimal solution to this covering test problem, with 10 test vectors. We highlight the different combinations of 0 and 1 in the first three columns, to show that all possible combinations occur; this property holds for any subset of three columns.
0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 0 0 1 1 1 1 1
Fig. 1. A CA(3, 5 , 2) of minimum size. All 10 subsets of three columns contain all possible combinations of 0 and 1.
Covering arrays have been applied in many areas; the following are examples given by Colbourn [10]:
Software interaction testing: Software components may produce system faults due to unexpected interactions. Ideally, one should test all possible combi- nations of components, but there may be prohibitively many combinations. Instead, pairwise or t-wise testing can test a fixed level of interaction which finds a large number of faults in practice. Hardware testing: In a circuit, input signals interact through arithmetic and logical operations to yield a desired output vector. However, errors may still occur. As in software interaction testing, this hardware testing problem can be addressed using covering arrays. Testing of advanced materials: Materials are sometimes combined to yield improved properties such as strength, flexibility and melting point. However, certain combinations are toxic or explosive and must be avoided. Covering arrays can aid in designing experiments. Interactions regulating gene expressions: Hormones impact the expression of particular genes, and may interact with each other. Although not all possi-
have aimed at finding small covering arrays rather than provably optimal arrays. Here, we discuss some recent examples of the main approaches that have been used.
Chateauneuf and Kreher [4] survey known results for covering arrays with t = 3 and introduce algebraic techniques for their construction. They claim good results for their techniques in comparison with a commercially-available method, AETG, described below. Williams [32] describes a method, TConfig, for constructing covering arrays (for t = 2) from smaller ‘building blocks’, which is fast and was found to give better results than IPO (described below) except for heterogeneous alphabets, i.e. when g is not uniform for all parameters. Hartman and Raskin [16] describe their CTS (Combinatorial Test Services) package which aims to find small covering arrays, using a variety of constructive methods and choosing the best result. They also consider a number of related problems, such as maximising the number k of parameters with domains of size g in a t-wise covering test suite with a fixed number b of test cases, and finding a test suite giving maximum t-wise coverage from b tests. Meagher and Stevens [20] describe a constructive method using group theory which improves on the previously best known solutions for several instances.
Another group of techniques use a greedy strategy to construct covering ar- rays. Lei and Tai [19] describe a method for constructing pair-wise test suites based on the IPO (In-Parameter-Order) strategy. Given a pair-wise test set for the first two parameters, the remaining parameters are added one at a time and the test suite extended by adding new tests if necessary. Polynomial algorithms for extending a test suite are given; it is claimed that this is a practical approach to generating test suites for large numbers of parameters. AETG [7, 6] is another greedy approach which adds test vectors one at a time, considering many possi- bilities and choosing the one that covers the largest number of so-far-uncovered parameter combinations. Tung and Aldiwan’s Test Case Generator [31] is a sim- ilar greedy approach, but makes choices deterministically rather than randomly. The Deterministic Density Algorithm [9, 2] generates only one candidate test vector to add to the suite, but aims to generate a vector that covers more of the uncovered pairs.
Many of the best known results for covering arrays have been found using local search methods; for instance, Nurmela [22] uses tabu search to find small covering arrays and gives some new upper bounds, e.g. for CAN (3, 12 , 2). Cohen et al. [8] apply hill-climbing and simulated annealing to finding covering arrays with fixed and heterogeneous alphabets, and also consider a variant in which the strength t can be increased for specified subsets of the parameters. However, finding good bounds using such methods can be very time-consuming, especially in comparison to the greedy methods.
To the best of our knowledge, this area has not previously been studied from a constraint perspective. Our first attempt to fill this gap is reported in [17]. In this paper, we present the further development of the CP models and show that constraint-based approaches can compete with existing methods.
In this section we explore Constraint Programming models of the covering test problem that exploit features such as global constraints and multiple viewpoints. Many scheduling, assignment, routing and other decision problems can be solved efficiently by CP models consisting of matrices of decision variables (matrix models [13]). We can model the problem of generating test vectors using matrices, in different ways. In what follows, we usually assume that we have a binary alphabet Z 2 = { 0 , 1 }, for clarity, i.e. that g = 2. We use the covering array CA(3, 5 , 2) of Figure 1 as a running example.
3.1 A na¨ıve matrix model
An obvious CP model of the covering test problem has a b × k matrix of integer variables, xri, for 1 ≤ r ≤ b and 1 ≤ i ≤ k, such that xri = m if the value of parameter i in test vector r is m. However, it is hard to express the cover- age constraints, i.e. that every subset of t parameters must be combined in all possible gt^ ways. For every subset of t parameters in each row, we introduce a Boolean variable for each combination that is set to true whenever these t pa- rameters cover that particular combination, by means of reification constraints. For example, when t = 3, the constraints on these Boolean variables are:
xrijlmnp = (xri = m & xrj = n & xrk = p) ∀ r, i, j, l, m, n, p; 1 ≤ r ≤ b; 1 ≤ i < j < l ≤ k; 0 ≤ m, n, p < g
We then impose the constraint that each combination of parameter values should occur in at least one test vector for each combination of (in the example) 3 parameters, using a sum constraint over the auxiliary Boolean variables:
r
xrijlmnp ≥ 1 ∀ i, j, l, m, n, p; 1 ≤ i < j < l ≤ k; 0 ≤ m, n, p < g
Unfortunately, imposing the coverage constraints in this way introduces a huge number of auxiliary variables and reification constraints. Furthermore, propagation of these constraints is inefficient and ineffective. We therefore need a different model where the coverage constraints can be easily expressed and propagated efficiently.
3.2 An alternative matrix model
In our CA(3, 5 , 2) example, there are
3
= 10 triples of the parameters:
assigned to two compound variables are consistent, in terms of the values they imply for the covering array. For instance, because the variables in the first and the second column of the alternative matrix model both represent positions 1 and 2 in the test vectors, the parameter values (0 or 1) in these positions should be the same. With the alternative model, we introduce the burden of expressing such intersection constraints. So for every row r and every two columns c 1 and c 2 , if the two columns share some positions then we state a binary constraint between the variables (r, c 1 ) and (r, c 2 ) in the alternative matrix. For instance, for each row r the binary constraint between the compound variables yr,(1, 2 ,3) and yr,(1, 2 ,4) in columns 1 and 2 can be expressed extensionally by listing the pairs of values that are allowed for these variables, as follows:
{(0, 0), (0, 1), (1, 0), (1, 1), (2, 2), (2, 3), (3, 2), (3, 3), (4, 4), (4, 5), (5, 4), (5, 5), (6, 6), (6, 7), (7, 6), (7, 7)}
For instance, yr,(1, 2 ,3) = 4 represents xr 1 = 1, xr 2 = 0, xr 3 = 0 while yr,(1, 2 ,4) = 5 represents xr 1 = 1, xr 2 = 0, xr 4 = 1, so that the pair of values (4,5) should be allowed by the intersection constraint. For each compound variable, there are t
(k−t t− 1
other compound variables in the same row that have one of the original variables in common with it; for instance, yr,(1, 2 ,3) has one variable in common with each of yr,(1, 4 ,5), yr,(2, 4 ,5), yr,(3, 4 ,5).
There are
(t 2
)(k−t t− 2
other compound variables in the same row that have two original variables in common with it; for instance, yr,(1, 2 ,3) has two original variables in common with six other compound variables. It appears at first sight that we need to define an intersection constraint in each case, giving 9 such constraints for each compound variable, in the example, and 45 constraints for each row (since each has been counted twice). However, many of these constraints are redundant. The compound variables of the alter- native model are similar to the dual variables used in the dual graph translation of a non-binary constraint satisfaction problem to one with only binary con- straints [1, 11]; in that case, intersection constraints between dual variables are similarly needed to ensure that the values of the original variables implied by values assigned to the dual variables are the same for all dual variables. An in- tersection constraint between two dual variables is redundant if there is a chain of intersection constraints linking the two such that the original variables that they share are also shared by every dual variable in the chain. [30] shows that if arc consistency is maintained on the intersection constraints after assignments are made, redundant intersection constraints can be removed without affecting the search for solutions. In the present case, the constraints between pairs of compound variables that have only one original variable in common, or in general, fewer than t−1 original variables in common, can be deleted. Further, if a set of compound variables share t − 1 original variables, the clique of intersection constraints linking them can be reduced to just a path: Figure 3 illustrates this. When t = 3, there are
(k 2
pairs of parameters. For each pair, k−3 intersection constraints are needed (for each row of the matrix). For instance, when k=5, only
(1,2,3)
(1,2,4)
(1,2,6) (1,2,5)
(1,2,7)
Fig. 3. A clique of triples of original variables, with variables 1 and 2 in common, from the problem with k = 7, t = 3. Each row of the alternative matrix has a compound variable corresponding to each node, with a binary intersection constraint for each edge. Only four constraints are needed (thick lines mark a possible set); all the others can safely be deleted.
20 constraints are needed, out of the 45 possible constraints. For larger values of k, the difference is more marked: in general, when t = 3, the total number of possible intersection constraints in each row is
(k 3
3(k − 2)(k − 3)/4.
3.3 An Integrated Model
In the na¨ıve matrix model, it is difficult to express the coverage constraints in such a way that we can reason efficiently and effectively about them. In the alternative matrix model, on the other hand, we can use global cardinality constraints for which efficient propagation algorithms exist [24]. However, we still have a large number of intersection constraints, even after redundant constraints are removed. We propose to integrate the two models by using the variables of both, linked by channelling constraints, in the manner proposed by Cheng et al. [5]. The disadvantages of integration are the increased number of variables and the ad- ditional channelling constraints to be processed; however, the channelling con- straints make all the intersection constraints between the compound variables redundant. The channelling constraints associate each compound variable in the alter- native matrix with the t corresponding variables in the original matrix. The association between the values of the compound variables and those of the com- ponent original variables is defined in section 3.2. For instance, if t = 3 and the alphabet is binary then the constraint between the compound variable yr,(i,j,k) from the alternative matrix and its t corresponding variables in the na¨ıve model xri, xrj , xrk can be expressed extensionally as follows:
(yr,(i,j,k), xri, xrj , xrk) ∈ {(0, 0 , 0 , 0), (1, 0 , 0 , 1), (2, 0 , 1 , 0), (3, 0 , 1 , 1) (4, 1 , 0 , 0), (5, 1 , 0 , 1), (6, 1 , 1 , 0), (7, 1 , 1 , 1)}
or intensionally as:
In the alternative model, permuting the columns of the matrix of variables in a solution does not in general give another solution. However, the effect of lexicographically ordering the columns of the na¨ıve matrix can be at least par- tially achieved by lexicographically ordering the columns corresponding to the tuples (1,2,3), (1,2,4),... , (1,2,k). Again, this can be safely combined with lex- icographically ordering the rows. A final, less obvious, source of symmetry is that the values assigned to any parameter in a set of test vectors can be permuted, without affecting whether or not the set of test vectors is a covering array.^4 In terms of the na¨ıve model, the values within any column of the matrix can be permuted; for instance, with a binary alphabet, the 0s and 1s can be swapped in any column without affect- ing whether or not the constraints are satisfied. Given the symmetry-breaking constraints already introduced, to deal with this symmetry we need to introduce further constraints that do not conflict with them, since otherwise we would risk losing solutions. There are several possibilities; for instance, we could im- pose constraints on the number of occurrences of each value in each column. If nis is the number of occurrences of the value s in column i (1 ≤ i ≤ k, 0 ≤ s ≤ g − 1), then we could add the constraints ni 0 ≤ ni 1 ≤... ≤ ni,g− 1 , for 1 ≤ i ≤ k. Clearly, these constraints would not be affected by permuting the rows and columns of the matrix, and hence are compatible with the lexicographic or- dering constraints. Alternatively, given a binary alphabet, we can force the first row of the matrix to be all 0s (or equivalently the last row to be all 1s). This constraint gives better propagation than constraining the number of occurrences of each value. It clearly does not interfere with permuting the columns of the matrix, and it is compatible with lexicographic ordering of the rows because it forces the first row of the matrix to be lexicographically smallest (or the last row to be lexicographically largest), whatever the values assigned to the other rows. For g > 2, we can combine these ideas; for instance, we can set the first row of the matrix to be all 0s and order the number of occurrences of the values 1 to g − 1 in each column. In the alternative model, we can similarly set the first or last row of the matrix (constraining every value in the first row to be 0 or, in the binary case, constraining every value in the last row to be 2t^ − 1). However, we cannot easily impose an equivalent to the constraints on the number of occurrences of each value in the assignments to an individual parameter. Because the integrated model has both sets of variables, we can break the symmetry of the models in the most convenient and effective way. (We cannot break the same symmetry twice, by constraints on both sets of variables, since this would risk losing solutions.) Hence, we can break the column symmetry by ordering the columns of the original matrix; the row symmetry by ordering the rows of either the original or the alternative matrix; and the value symmetry in each column by constraining the original matrix. Since the different forms of symmetry can be combined with each other, the size of the symmetry group is k! × b! × (g!)k. For a symmetry group of this
(^4) Note that this symmetry was not identified in the earlier paper on this work [17].
size, adding symmetry-breaking constraints to reduce the symmetry was the only practical method available. Many of these transformations may have the same effect on any given assignment; even so, the number of possible symmetric equivalents must clearly be very large and it is essential to consider as few of them as possible; as we show later, the symmetry-breaking constraints are vital to solving the CP models.
We used the different models to solve the covering array problem for different values of the alphabet size, g, the coverage strength t, and the number of pa- rameters, k. As well as, in some cases, finding new solutions to the problem, this allowed us to evaluate the models. First we report on experiments using a Pentium M 1.7GHz PC running ILOG Solver 6.0.^5 In our experiments we used instances of the covering test problem with cover- age strengths t of 3 and 4 over a binary alphabet Z 2 = { 0 , 1 }. In each experiment we vary the number k of parameters. Initial experiments with the na¨ıve model showed that it was very inefficient and always outperformed by the other models. For this reason, we excluded it from further analysis and do not present results for this model. In the integrated model, we can use either the original variables or the com- pound variables as search variables. We found that assigning values to the com- pound variables was far better; this is understandable, since the coverage con- straints are expressed on the compound variables, and no propagation can take place until sufficient compound variables have been assigned. Using the original variables as the search variables delays this propagation. Hence, in the exper- iments reported below that use the integrated model, the search variables are the compound variables. In the experiments with the alternative and integrated models, we tried a variety of labelling strategies. In every case, the values of each compound vari- able were assigned in ascending order. Given a two-dimensional matrix model, two obvious overall strategies to consider are labelling by rows and labelling by columns. In this case, labelling by rows, i.e. labelling all the compound variables corresponding to one row of the matrix before labelling the variables correspond- ing to the next row, proved to be much worse than labelling by columns. This is not surprising since the main constraints in the problem are the coverage con- straints on the columns, which will only propagate when most of the compound variables in any column have been assigned. Hence, the labelling strategy chose a column and assigned the variables corresponding to that column (in some order) before going on to the next column. The columns corresponding to the tuples (1,2,3), (1,2,4), (1,2,5),... , (1,2,k) were labelled, in that order; clearly, the matrix is then completely specified. We tried labelling sets of non-overlapping columns (as far as possible given the value of k), for instance, those corresponding to
(^5) http://www.ilog.com/products/optimization.
Alternative Model Integrated Model Upper No. of All intersection Minimal Extensional Linear bound back- constraints set constraints constraints k b in [16] soluble tracks no. time no. time time time 4 8* 8 + 0 6 0 6 0 0 0 5 8 12 – 1 45 0.01 20 0.01 0.01 0. 5 9 12 – 9 45 0.01 20 0.01 0.01 0. 5 10* 12 + 5 45 0.01 20 0.01 0.01 0. 6 10 12 – 93 180 0.33 45 0.06 0.04 0. 6 11 12 – 820 180 1.82 45 0.31 0.19 0. 6 12* 12 + 53 180 0.16 45 0.04 0.03 0. 7 12* 13 + 124 525 1.32 84 0.13 0.06 0. 8 12* 13 + 124 1,260 3.67 140 0.23 0.11 0. 9 12* 18 + 467 2,646 31.04 216 1.54 0.58 0. 10 12* 18 + 479 5,040 62.08 315 2.50 1.02 0. 11 12* 18 + 493 8,910 112.12 440 3.77 1.71 0. 12 12 18 – 8,476 14,850 > 300 594 48.52 29.96 5. 12 13 18 – 316,791 14,850 > 300 594 > 300 > 300 269.
Table 1. Finding bmin = CAN (3, k, 2) for different parameters k using the alternative and integrated models. The alternative model has either all the intersection constraints or a minimal set; the number of constraints for each row of the matrix is shown in each case. In the integrated model, the channelling constraints between each compound variable and its constituent variables are either extensionally defined (and generalized arc consistency is maintained) or linear (and bounds consistency is maintained). The run-time is given in seconds, on a Pentium M 1.7GHz PC, running ILOG Solver 6.0. The run-time limit is 5 minutes.
much faster to enforce generalized arc consistency on these than on the 594 non-redundant intersection constraints of the alternative model, even though the channelling constraints are in this case 4-ary whereas the intersection constraints are binary. Note also that our results use the symmetry-breaking constraints in all tested models. In fact, the symmetry-breaking constraints play a vital part. For exam- ple, to prove that there is no covering array CA(3, 6 , 2) of size 10 can be done with 93 backtracks and 0.02 sec., with the integrated model, as shown in Table 1; without the symmetry breaking the same problem takes 975,024 backtracks and 63 sec. with the same search strategy. Finally, our approach improved on several of the results given in [16] for t = 3 and k ≤ 11 and proved optimality. We ran a further set of experiments to find covering arrays CA(4, k, 2) for varying k. We observe in Table 2 that the best integrated model could find CAN (4, k, 2) for k ≤ 6 in 1 hour, and the improvements of the bounds that we obtained are significantly larger than the improvements we got on CAN (3, k, 2). Overall, with the presented approach we can find provably optimal covering test suites for those instances which in- duce a moderate number of variables in our models. This translates to getting
Upper bound No. of k b in [16] soluble backtracks time 5 16* 24 + 0 0. 6 16 28 – 1 0. 6 17 28 – 12 0. 6 18 28 – 146 0. 6 19 28 – 1,863 0. 6 20 28 – 20,381 2. 6 21* 28 + 160 0. 7 21 38 – 184,661 35. 7 22 38 – 1,419,407 247. 7 23 38 – 9,518,449 1504.
Table 2. Finding covering arrays CA(4, k, 2) of size b, or proving that there is none, for different parameters k using the integrated model. The runtime limit is 1 hour.
CAN (3, k, 2) for up to k = 11 parameters (around 2000 variables) within a CPU time limit of 5 minutes. However, as problem size becomes larger the required amount of search proves computationally prohibitive, and for larger problems we turn to local search methods.
Constraint solvers typically alternate variable assignment with constraint prop- agation; when propagation leads to an empty variable domain, backtracking occurs. An alternative way of finding solutions to constraint problems is local search. Usually starting from a randomly-chosen assignment of all variables, sin- gle variables (or sometimes more than one) are selected and reassigned to a different value, each reassignment being a local move. The choice of variable and value is made heuristically, with no attempt to maintain completeness of search. This is in contrast to backtrack search, which is complete and can therefore find all solutions, or prove that no solutions exist. The advantage of local search is that it can sometimes solve much larger problems than backtrack search. We decided to evaluate local search on our problem, and chose SAT as a framework in which to experiment. SAT problems may be viewed as CSPs with binary do- mains and non-binary constraints, and many effective local search algorithms have been designed for SAT. After experiments with different algorithms we chose a new variant of the Walksat algorithm [26], described below. We could simply SAT-encode our best CP model using one of the well-known standard approaches, but the best model for local search is not necessarily the best model for backtrack search [23]. In fact our SAT model is not identical to any of the previous matrix models, for reasons given below. As before we suppose a b × k matrix M of integers in Zg. For each row i, column j and value x define a Boolean variable mijx which is true if and only if x occurs in position (i, j). We
We use a new SAT local search algorithm, which works as follows. Starting from a random initial truth assignment to all Boolean variables, it repeatedly selects a violated clause (one in which all literals are false) and flips the truth value of a heuristically-selected variable (if it is true then set it to false, and vice-versa). Such a flip is guaranteed to satisfy the selected clause, but may cause others to become unsatisfied. The key ingredient in such algorithms is the variable selection heuristic. In our algorithm, with a given probability p we randomly select a variable, where p is a noise parameter for the algorithm (this is called a random walk move in the literature). Otherwise, with probability 1 − p, we select the variable with smallest score. The score for a variable v is defined as the change in the total number of unsatisfied clauses that would result from flipping v, divided by the total number of flips on all variables other than v. Ties are broken by selecting the variable that was least-recently flipped. However, if the clause contains several variables such that flipping them would not create new unsatisfied clauses, then instead we randomly select one of these variables; in the literature this is sometimes called a freebie move. The aim of this scoring function is to minimise the number of unsatisfied clauses, while preferring variables that have been flipped fewest times in the search so far. This new variant of Walksat is a simple hybrid of two well-known variants that has not, to the best of our knowledge, been described in the literature: it is HWSAT [15] augmented with the freebie moves of SKC [26]. We shall call it HWFSAT, and in experiments on covering arrays it gave better results than other variants tested. Our results were found using HWFSAT with the noise parameter p set to 0.2, 0.3 or 0.4. In each case we chose the most promising value, after monitoring the progress of the algorithm under each value. We ran it on a 733 MHz Pentium III, using decreasing values of b until no solution was found after an hour. The results for various values of t, k, g are shown in Tables 3 and 4 with the best result for each instance shown in bold, and unavailable results denoted by “—”. We compare HWFSAT results with those from several recent papers: HW denotes HWFSAT; HR, Hartmann and Raskin [16]; CK, Chateaneuf and Kreher [4] using a mathematical construction; MS, Meagher and Stevens [20] using group theory; and NU, Nurmela [22] using Tabu search. HWFSAT was able to reproduce the improved bounds found by ILOG Solver, and to further improve some bounds. On some instances we could not match the best results of the other approaches, and constructive methods are able to pro- vide bounds for much larger instances than we can handle. But SAT-based local search can find solutions that are competitive with the best known results on many instances, and in two cases we improve on the best known results, as far as we can ascertain: upper bounds of 40 for CAN (3, 7 , 3) and 24 for CAN (4, 10 , 2). Because of the earlier finding that there is no CA(4, 7 , 2) with value 23, shown in Table 2, the solution with value 24 found by HWFSAT for CA(4, 10 , 2) is optimal, and 24 is also the optimal value for k = 7, 8 and 9. Examples of these results are shown in Figures 4 and 5, with rows and columns transposed for space reasons. Our CAN (4, k, g) results also beat those of Hartman & Raskin.
Though we do not expect the SAT approach to scale to much larger problems be- cause of increasing SAT model sizes, a local search algorithm using a higher-level constraint model could avoid this problem.
0 1 1 0 1 0 0 0 1 1 1 0 0 1 1 0 1 0 1 0 0 0 1 1 1 0 1 0 0 1 1 0 1 0 0 0 0 1 1 1 1 0 1 1 1 0 0 0 0 1 1 1 0 0 1 0 0 1 1 0 1 0 1 0 0 1 1 1 1 0 0 0 1 0 0 1 0 1 0 0 0 1 0 0 0 1 1 0 0 1 1 0 1 1 1 1 0 1 1 0 0 1 0 1 1 1 0 1 0 1 0 0 0 1 0 1 1 0 0 1 1 0 1 1 0 0 1 1 0 1 1 1 0 1 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 0 1 1 0 0 0 1 0 0 1 1 1 0 1 0 0 0 0 0 1 1 0 0 1 1 0 1 0 1 0 1 1 0 1 0 1 1 1 1 0 0 1 0 1 0 1 0 0 1 0 1 1 0 1 0 0 0 1 0 0 0 0 1 0 1 0 1 1 0 1 0 1 0 1 1 0 1 1 1 0
Fig. 4. An optimal covering array CA(4, 10 , 2) of size 24 (rows and columns transposed)
0 2 1 2 0 1 0 0 0 2 0 1 0 1 1 2 2 2 2 2 1 1 2 1 2 0 0 2 2 1 2 0 0 0 0 1 1 2 1 1 2 2 1 1 0 0 0 2 2 2 1 0 2 0 0 0 1 0 2 0 2 0 2 1 2 0 0 0 1 1 1 2 1 1 1 1 2 1 2 2 2 0 1 0 1 1 2 0 1 2 2 2 0 1 0 2 1 1 2 2 1 0 1 2 2 0 1 0 2 2 0 2 1 1 0 0 1 1 2 0 2 2 1 0 1 0 0 2 1 2 1 1 0 1 2 2 1 0 1 2 0 0 2 0 0 0 2 1 1 2 2 0 0 2 1 1 2 0 0 1 1 2 0 1 1 0 1 1 0 0 0 0 0 2 0 2 2 2 1 1 1 1 1 2 2 2 0 0 2 1 0 2 1 2 2 1 2 0 0 2 2 0 2 2 2 1 0 1 1 2 1 1 2 0 2 2 1 2 0 1 2 0 0 2 1 1 0 0 2 0 1 0 1 2 0 1 1 0 0 2 1 2 1 0 0 0 2 0 2 0 0 1 1 2 2 0 0 1 1 2 2 1 0 1 2 2 1 0 2 0 1 0 1 2 1 2 1 2 2 0
Fig. 5. A solution showing that CAN (3, 7 , 3) ≤ 40 (rows and columns transposed)
For reasons of clarity, we presented our models assuming a fixed binary alphabet and uniform coverage. However, our models can easily be extended to model different practical extensions:
The last three extensions (heterogeneous alphabets, partial coverage and side constraints) would reduce the symmetry inherent in the problem, and the symmetry-breaking constraints would need to be adjusted accordingly.
We have presented constraint models of a core problem in combinatorial soft- ware testing: the covering test problem. We consider four matrix models for the problem:
The problems are highly symmetric, and it is important when using complete backtracking search to deal with the symmetry effectively; we have shown that this can be done. We show that for moderate problem sizes with a CP approach one can find provably optimal solutions, which improve on the published results. We further showed that a local search algorithm on a SAT-encoding of the problem can find improved solutions for somewhat larger instances. We proved optimality for one instance (CA(4, 10 , 2)) by a combination of local search to find the optimal solution and complete search using the CP approach to prove that there is no
smaller CA(4, 7 , 2), and therefore no smaller CA(4, 10 , 2) either. These results show the applicability of constraint-based techniques to the problem, at least for instances up to a certain size. This approach may find application to less pure versions of the problem with side constraints, such as those found in some industrial applications. The easy handling of side constraints (simply by adding them to the model) is one of the advantages of CP. In future work we will aim to further improve the presented results. One possible direction for improvement could be exploring the effects of different value ordering heuristics on backtrack search. Another direction is to design a dedicated local search algorithm for the problem; this would greatly reduce model sizes, which currently forms a bottleneck on the size of problems that we are able to solve. The alternative and integrated models show the usefulness of compound vari- ables in expressing complex constraints so that they can propagate effectively. Although similar variables have been used in the well-known dual graph transla- tion of a CSP with non-binary constraints into one with only binary constraints, this work shows that they have wider application in making non-binary con- straints easier to express, without necessarily eliminating them. Further work will explore other applications of this modelling pattern.