A covering array is an N
by k
array in which each element is one of {0, 1, ..., v-1} (so v
symbols in total), and for any t
columns chosen (so an N
x t
array) contains all possible v^t
tuples at least once. The applications of Covering Arrays range from software and hardware testing, interaction testing, and many other fields. A research question (and which will be a follow-up to this question) is to find the minimal Covering Array of given t
,k
,and v
; an analogue of this would be designing a software system with the minimal number of tests required to test all t
-way interactions of the system. Only for t=v=2
is the optimal case known for all k
(some values of t
and v
have some optimal CA designs for one value of k
, but this is not the common case).
Here, we focus on validation of Covering Arrays, as this is a very time-consuming process for very large Covering Arrays.
Input: A file that contains the Covering Array. The format is described in Scoring below.
Output: Valid
if the input is a valid covering array, and Invalid
if it is not.
Goal: in any language you want, write a program that validates if the input is a covering array in the fastest time. I will run programs on my machine, which is a Mac Pro 3.5 Ghz 6-Core Intel Xeon E5 (2013) with 16 GB RAM (1866 MHz).
Rules:
- Any language is allowed, as long as it can read from a file, where the filename is given as input.
- All you need to print is
Valid
orInvalid
, nothing else. - No third-party libraries; you can only use the libraries/modules that are already built-in to the language.
- No use of the Internet for validation (i.e., the validation must be done within the program itself).
- You are allowed to have multi-threading/multi-core solutions. However, I will test it on the machine described above.
- If your program requires a compilation, describe in your answer what compilation options that you selected (i.e., like
g++ -O3 validator.cpp ca.5.6^7.txt
).
Scoring: the total score is the total amount of time in milliseconds to produce all of the valid outputs. I will test your program against a number of CAs, and it reports the total amount of time required to execute validation of all sample CAs as input. The CAs will be selected from this link (the text files are provided there, and is linked to from the first link above also).
The format of the files posted there is provided as follows: the first line of the file is N
, the name of the file is ca.t
.v
^k
.txt, and the next N
rows of the file contain k
space-separated integers.
Fastest code (i.e., lowest score) wins!
Edit: after looking at some sample covering arrays on the site, the format is not entirely consistent. If you can change (or provide the file) the format to match the format described above, that would be very helpful.
#include <math.h>
)? As you probably know, it's a part of the c stdlib, but it was separated from the other parts because it is relatively big ... \$\endgroup\$