SlideShare a Scribd company logo
1 of 31
Download to read offline
"Danilo Berta" - Page 1 of 31
"Danilo Berta - berta_danilo@hotmail.com"
25 June 2015
"Minimum Pair Wise test set calculation and connections with Graph Theory"
Contents
Contents .....................................................................................................................................1
List of Figures .............................................................................................................................1
Abstract.......................................................................................................................................3
Four variables with three values each one’s................................................................................5
Building the graph connected to pair wise problem .....................................................................7
Mapping graph’s path to pairs...................................................................................................10
Experimental data rescue!.........................................................................................................14
Final conjectures.......................................................................................................................16
Appendix 1................................................................................................................................20
Appendix 2................................................................................................................................21
Appendix 3 – Latin Square Generalization ................................................................................24
List of Figures
Picture 1 – Graph associated with pair wise problem ..................................................................7
Picture 2 – Graph associated with pair wise problem – First level edges.....................................8
"Danilo Berta" - Page 2 of 31
Picture 3 – Complete graph associated with pair wise problem...................................................9
Picture 4 – Kuratowski’s K3,3 graph ...........................................................................................12
Picture 5 – Graph’s Paths for block # 1 in Table 9.....................................................................18
Picture 6 – Graph’s Paths for block # 2 in Table 9.....................................................................18
Picture 7 – Graph’s Paths for block # 3 in Table 9.....................................................................19
Picture 8 – Overlapping Picture 5,Picture 6 and Picture 7 to get Eulerian Path (full graph) .......19
Picture 9 – Graph’s Paths for block # 1 in Table 9 – ACTS combinations..................................22
Picture 10 – Graph’s Paths for block # 2 in Table 9 – ACTS combinations................................22
Picture 11 – Graph’s Paths for block # 3 in Table 9 – ACTS combinations................................23
Picture 12 – Overlapping Picture 9, Picture 10 and Picture 11 to get Eulerian Path (full graph) –
ACTS Combinations..................................................................................................................23
Picture 13 – Hamiltonian Path from Picture 5, Picture 6 and Picture 7 (minimum pair wise
problem manual solution)..........................................................................................................24
Picture 14 – Hamiltonian Path from Picture 13 in tabular format ...............................................24
Picture 15 – The other configuration .........................................................................................26
Picture 16 – Hamiltonian Path from Picture 9, Picture 10 and Picture 11 (ACTS minimum pair
wise problem solution) ..............................................................................................................26
Picture 17 – Hamiltonian Path from Picture 14 in tabular format ...............................................27
Picture 18 – RM1 and RM2 from first matrix in Picture 17.........................................................27
Picture 19 – Steps # 1, 2 and 3 to build graph in tabular format ................................................29
Picture 20 – Steps # 4, 5 and 6 to build graph in tabular format ................................................30
Picture 21 – Steps # 7, 8 and 9 to build graph in tabular format ................................................31
"Danilo Berta" - Page 3 of 31
Abstract
The problem we will engage here is the following: having N variables with different values each
one, what is – if exist – a minimal test set allowing a full pair wise coverage? In other words,
consider the following table:
A_1 A_2 A_3 … A_K
1 1 1 1
2 2 2 2
… … … … …
N1 N2 N3 … NK
Table 1 – K variables with different values each ones
Consider now the ordered sequence (N1, N2, N3, …, NK) where N1 ≥ N2 ≥ N3 ≥ … > NK. We
may expect that the minimal pair wise test set has no more and no less than N1●N2 test cases.
In the following for “Minimal Pair Wise Test Set” we consider not a generic test set that should
be extracted with some kind of algorithm, but the test set for which each variables pairs appears
one and only one times. In other words, the frequency map of all variables pair is exactly equal
to one. This should be a little importance for practical test problems, but it should be interesting
from a theoretical point of view. For example, for the variables and values below:
A_1 A_2 A_3 A_4
1 1 1 1
2 2 2 2
3 3 3
4 4 4
5
Table 2 – 4 variables with different values each ones as Example
We forecast a minimum test set is composed by 5●4 = 20 test cases.
Such minimal test cases exist in some particular cases, for example when we have 4 variables
with 3 values each one (as we will see in the following paragraph), so the answer to the
question should not be always “YES” or always “NO”. Investigating on the problem, using the
IPOG algorithm used by NIST ACTS tool, we will find a correlation among: combinatorial pair
wise problems, k-partite graph (Graph Theory) and prime number.
"Danilo Berta" - Page 4 of 31
As an empirical conjecture we will find that there is a solution of the problem (which we will call
in the following “Minimal Pair Wise Problem), when:
• We have N variables with N values or (N+1) variables with N values each.
• N is prime
• Finding solution for the Minimal Pair Wise Problem for N variables with N values means
find the Hamiltonian Circuits for KN,N,…N (with N indexes) Kuratowski’s graph.
• The solution for the Minimal Pair Wise Problem for (N+1) variables with N values do not
imply the existence of Hamiltonian Circuits for KN,N,…N (with N+1 indexes) Kuratowski’s
graph.
Connections between Graph Theory and pair wise testing was already discussed in the article
“Pairwise Test Set Calculation using k-partite Graphs” written by Elke Salecker, Sabine Glesner
(TU Berlin), 2010 IEEE International Conference on Software Maintenance (ICSM)” but with a
different purpose.
For Graph Theory definitions and theorems we referred the book: “Graph Theory, with
applications to engineering and computer science “ – Narsingh Deo – PHI Editions.
"Danilo Berta" - Page 5 of 31
Four variables with three values each one’s
Consider the case of four three-value variables:
A B C D
1 1 1 1
2 2 2 2
3 3 3 3
Table 3 – Four variables with three values each ones
We know that all the possible combinations are 3•3•3•3=34
= 81.
Problem: What is the minimal test set that guarantee 100% wise-2 (all pairs) coverage? It
should be at least composed by 3•3 = 9 cases.
Solution: Considering all the six pairs coming out from the A, B, C and D variables: AB, AC, AD,
BC, BD and CD. If we freely set the first three pairs, AB, AC and AD the pairs BC, BD and CD
are automatically defined. So the “green right” side of the Table 4 depends from the “white left”
side of the same. The grey column is just the final string.
Block # AB AC AD BC BD CD A B C D
1
1 11 12 13 12 13 23 1 1 2 3
2 13 11 12 31 32 12 1 3 1 2
3 12 13 11 23 21 31 1 2 3 1
2
4 22 21 23 21 23 13 2 2 1 3
5 23 22 21 32 31 21 2 3 2 1
6 21 23 22 13 12 32 2 1 3 2
3
7 31 31 31 11 11 11 3 1 1 1
8 32 32 32 22 22 22 3 2 2 2
9 33 33 33 33 33 33 3 3 3 3
Table 4 – Four variables with 3 values each one’s – wise-2 Minimal Test Set
To get the minimal test set in Table 4, steps performed are the following:
First Step: Fix A = 0 and build the Latin Square for variable B, C and D, so we are sure that just
one value appears on the same row and column (as from definition of Latin Square1
).
# B C D
1 1 2 3
1
Latin square is an n × n array filled with n different symbols, each occurring exactly once in each row
and exactly once in each column. For small squares it is possible to generate permutations and test
whether the Latin square property is met.
"Danilo Berta" - Page 6 of 31
2 3 1 2
3 2 3 1
Table 5 – B, C and D variable Latin Square # 1
Rows from #1 to # 3 (block 1) of Table 4 are generated from Table 5 Latin Square # 1 “left side
pasting” A=1 in all the B, C and D columns.
Second Step: Fix A=1 and, as before, we “walk” on the diagonal (bright yellow) of Table 5
getting the following table:
# B C D
1 2 1 3
2 3 2 1
3 1 3 2
Table 6 – B, C and D variable, Latin Square # 2
Rows from #4 to # 6 (block 2) of Table 4 are generated from Table 5 Latin Square # 2 “left side
pasting” A=1 in all the B, C and D columns.
Third Step: Fix A=3 and, if we walk again on the diagonal (bright green) of Table 6, we come
back to the sequence (B, C, D) = (1, 2, 3). We use instead the other diagonal (2, 2, 2) and, with
a few of imagination, draw the following table:
# B C D
1 1 1 1
2 2 2 2
3 3 3 3
Table 7 – B, C and D variable, not Latin Square
Table 7 is not a Latin square and there is not a strict logic behind. It’s … well … like a guessing
game. Rows from # 7 to # 9 (block 3) of Table 4 are generated from Table 7 not Latin Square
“left side pasting” A=3 in all the B, C and D columns.
The string A B C (grey column) coming out in Table 4 has 100% wise-2 coverage, because all
the pairs appears - only once - for a total of just 9 combinations (the frequency map(2
) is
2
If we draw a Cartesian graph having on X axis the pairs (27 in this case) an on Y axis the frequency
each pair appear in the final test set, a minimal test set has a frequency map that is a straight line
parallel to X axis and with Y = 1 (all pairs are covered just once).
"Danilo Berta" - Page 7 of 31
constant = 1); just note that ACTS give exactly the same number of combinations, also if the
combinations themselves are different.
Building the graph connected to pair wise problem
To build the Graph associated with the four variables, three values pair wise problem, start with
a simple table. The table has as rows the variables’ name and as columns the values for each
variable, as follow:
1 2 3
A
B
C
D
Table 8 – First representation of graph associated with pair wise problem
In the cross between rows and columns we have the node of the Graph. In a more pictorial
form:
Picture 1 – Graph associated with pair wise problem
"Danilo Berta" - Page 8 of 31
All values of A variable (1, 2, 3) must be connected with all values of variable B, that are always
(1, 2, 3); node A-1 must be connected with all B’s nodes.
The same happen for node A-2 and A-3. We get the following (partial) graph:
Picture 2 – Graph associated with pair wise problem – First level edges
The edges connect all levels A with all levels B. We do not connect levels A with levels C or D,
just each level with the next, starting from the top (level A) that is considered the first level. In
this way we connect all A-s level with all B-s levels (Cartesian product), all B-s levels with all C-s
levels (Cartesian product) and all C-s levels with all D-s levels (Cartesian product).
At the end of the process, we have the complete graph in Picture 3. The meaning of dotted line
from D to A is to connect (Cartesian product) all D-s levels (D1, D2, D3) with all A-s levels (A1,
A2, A3) getting all the combinations ((D1, A1), (D1, A2), (D1, A3), …,(D3, A1), (D3, A2), (D3,
A3)). This is the so called 4-partite graph (3
), because nodes at the same levels aren’t
connected, forming four disjoint sets. We will come back on k-partite graph in what follows. In
3
The article “Pairwise Test Set Calculation using k-partite Graphs” written by Elke Salecker, Sabine
Glesner (TU Berlin), 2010 IEEE International Conference on Software Maintenance (ICSM) use a similar
approach but with the purpose to find an algorithm to solve pair wise problem. In the article the authors
create complete connections with all levels.
"Danilo Berta" - Page 9 of 31
the next paragraph what we will do is to map Table 4 with all the pair’s wise combinations on the
paths of the graph (4
).
Picture 3 – Complete graph associated with pair wise problem
In sake of completeness, the following table is the adjacency matrix (5
) of the graph:
A1 A2 A3 B1 B2 B3 C1 C2 C3 D1 D2 D3
A1 0 0 0 1 1 1 0 0 0 0 0 0
A2 0 0 0 1 1 1 0 0 0 0 0 0
A3 0 0 0 1 1 1 0 0 0 0 0 0
B1 0 0 0 0 0 0 1 1 1 0 0 0
B2 0 0 0 0 0 0 1 1 1 0 0 0
B3 0 0 0 0 0 0 1 1 1 0 0 0
C1 0 0 0 0 0 0 0 0 0 1 1 1
C2 0 0 0 0 0 0 0 0 0 1 1 1
C3 0 0 0 0 0 0 0 0 0 1 1 1
D1 1 1 1 0 0 0 0 0 0 0 0 0
D2 1 1 1 0 0 0 0 0 0 0 0 0
D3 1 1 1 0 0 0 0 0 0 0 0 0
Table 9 – Adjacency matrix of graph
4
A walk is defined as a finite alternating sequences of vertices and edges, beginning and ending with
vertices, such that each edge is incident with the vertices preceding and following it. No edge appears (is
covered or traversed) more than once in a walk It is possible for a walk to begin and end at the same
vertex: such a walk is called closed walk. A walk that is not closed (i.e., the terminal vertices are distinct)
is called and open walk. (from: Narsingh Deo)A path (or trail) is a open walk in which no vertex appears
more than once. In other words, a path does not intersect itself (from: Narsingh Deo). Depending on the
book you get on Graph Theory, the definitions change a bit.
5
The adjacency matrix of a finite graph G on n nodes is the n × n matrix where the non-diagonal entry aij
is the number of edges from vertex i to vertex j, and the diagonal entry aii, depending on the convention,
is either once or twice the number of edges (loops) from node i to itself.
"Danilo Berta" - Page 10 of 31
Mapping graph’s path to pairs.
Start rewriting Table 4 considering only the variables A, B, C and D, disregarding columns with
pairs and re-ordering rows on values of variables A and B:
Block # A B C D
1
1 1 1 2 3
2 1 2 3 1
3 1 3 1 2
2
4 2 1 3 2
5 2 2 1 3
6 2 3 2 1
3
7 3 1 1 1
8 3 2 2 2
9 3 3 3 3
Table 10 – Four variables with 3 values - Minimal pair wise Test Set
The values in each row just define the path through the graph, so (A, B, C, D) = (1, 1, 2, 3)
match the path (A-1, B-1, C-2, D-3). For all the nine rows (3 blocks), we have the (partial)
graphs in Picture 5, Picture 6 and Picture 7 (just look at the left size, for the moment). Really,
they are not “real” graphs, because not connected nodes are presents; it’s better to call them a
“not connected” graphs. Overlapping all this three partial graphs, you get the complete graph in
Picture 3. For now, disregards not connected nodes: they do not change the substance of the
argument we are discussing.
We got some definitions from the book: “Graph Theory, with applications to engineering and
computer science “ – Narsingh Deo – PHI Editions.
Eulerian walk: An Euler line of a connected graph is characterized by the property of being a
closed walk that traverses every edges of the graph exactly once.
Hamiltonian circuit in a connected graph is defined as a closed walk that traverses every
vertex of G exactly once, except – of course – the starting vertex at which the walk also
terminate.
Now, look at Picture 5 (but the same is valid also for Picture 6 and Picture 7). If we do not
consider the first level (A), the “low” part of the graph is Hamiltonian and the different arrows
"Danilo Berta" - Page 11 of 31
colors show a Hamiltonian circuit (the picture in the right side); remember that last level D is
completely connected with level A.
Some important definitions and theorems on Hamiltonian and Eulerian graphs:
a) Complete Graph (universal graph, clique): a simple graph in which there exists an
edge between every pair of vertices.
b) Regular Graph: a graph in which all vertices are of equal degree. The degree of a
vertex is the number of incident edges on the same vertex (with self loop counted twice,
but in our graph we do not have such loops). In a digraph, the degree of a vertex is
sometime referred as the difference (as absolute value) from incoming edges to
outgoing edges.
c) Number of Hamiltonian Circuits in a Graph: a given graph may contain more than
one Hamiltonian circuit. Of interest are all the edge-disjoint Hamiltonian circuits in a
graph. The determination of the exact number of edge-disjoint Hamiltonian Circuits (or
paths) in a graph in general is also an unsolved problem. We can just say (G. A. Dirac
Theorem) that a sufficient (but by no means necessary) condition for a simple graph G to
have a Hamiltonian Circuit is that the degree of every vertex in G be at least n/2, where
n is the number of vertices in G. However, the number of edge-disjoint Hamiltonian
circuits in a Complete Graph with odd number of vertices is given by the following
theorem: “In a Complete Graph with n vertices there are (n-1)/2 edge-disjoint
Hamiltonian Circuits, if n is an odd number and n ≥ 3”.
d) Eulerian Condition: a given connected graph G is an Euler graph if and only if all
vertices of G are of even degree.
e) K-partite graph: a graph G is called k-partite (bi-partite, 3-partite,…) if it’s vertex set V
can be decomposed into K (two, three,….) disjoint subsets V1, V2, …, Vk such that every
edge in G joins a vertex in Vi with a vertex in Vi+1 with (i=1,2,…,k) (note that adjacent
"Danilo Berta" - Page 12 of 31
vertices set has to be connected). We already cited this kind of graph some pages
before.
f) Kuratowski’s graph K3,3: The graph in Picture 4 is the so called Kuratowski’s graph
K3,3, having the following properties:
a. Is a regular graph
b. Is a non-planar graph
c. Is 2-partite graph
After this information’s roundup we should note that:
Picture 4 – Kuratowski’s K3,3 graph
1. Graph in Picture 3 is nothing else but two K3,3 graphs “piled up” and cyclic (where with
“cyclic” we means that bottom level D is completely connected with top level A).
2. K3,3 graph:
a. Is not a complete graph, so we cannot use theorem in point c) to calculate the
Number of Hamiltonian Circuits for this graph
b. It’s a regular graph of degree 3
c. Is a 2-partite graph.
3. We got from the previous point that Picture 3 graph (the complete graph):
a. Is not a complete graph, so we cannot use theorem in point c) to calculate the
Number of Hamiltonian Circuits.
b. Is a regular graph of degree 3 (or 0 if you do the difference incoming – outgoing
edges)
"Danilo Berta" - Page 13 of 31
c. Is a 4-partite graph
4. Graph on the right side of Picture 5 (the same for Picture 6 and Picture 7):
a. Is not a complete graph, so we cannot use theorem in point c) to calculate the
Number of Hamiltonian Circuits.
b. Is a regular graph of degree 3 (or 0 if you do the difference incoming – outgoing
edges)
c. Is a 3-partite graph
d. Should be build from two K3,3 piled up together. We can call it K3,3,3 graph. More
generally the index’s number (in this case = 3) is equal to columns number (that
is number of values’ variable for the equivalent combinatorial problem), while the
number of indexes (in this case are always 3 = 3,3,3) is equal to the number of
levels (that is the number of variable for the equivalent combinatorial problem).
Another example: the original graph in Picture 3 is a K3,3,3,3 because we have 4
variables (= 4 levels A, B, C and D) and 3 values (= 3 columns 1, 2 and 3).
5. Overlapping graphs on the right side of Picture 5, Picture 6 and Picture 7 you got the
complete graph or, what is the same, an Eulerian Path for the graph. In other word,
behaves like vectorial spaces bases; the Hamiltonian edge-disjoint Circuit seems
to form a base for the graph, because if you “add” (means, overlap or set union) them
you got the complete graph or an Eulerian Path.
To summarize:
“Graph theory (for what is in my knowledge) has not a general theorem that allow to count
and/or calculate Hamiltonian Path for graph on the right side of Picture 5 (the same for Picture 6
and Picture 7), but we got it using combinatorial test method, as described in the previous
paragraph”.
It’ seems to be a strict connection between combinatorial minimal test set problems calculation
of N and (N+1) variables with N values with k-partite regular (not complete) graph.
"Danilo Berta" - Page 14 of 31
So, if we are able to calculate the Hamiltonian Circuits (N circuits) for a generic KN,N,…N (with N
indexes) graph we are able to find a minimal pair wise combinatorial test set for N variables with
N values each with (N●N = N2
) test cases; reverse, if we are able to calculate minimal pair wise
combinatorial test set for N variables with N values each with (N●N = N2
), we get also the
Hamiltonian Circuits (N circuits) for the KN,N,…N (with N indexes) graph.
And this seems to be valid for any possible N ≥ 3. Considering that we do not have the
possibility to calculate the Hamiltonian circuits (a theorem does not exist and problem seems to
fall into category of NP-hard problems), we can operate in the “reverse way” using IPOG
algorithm (implemented by NIST ACTS).
Experimental data rescue!
I created twenty NIST ACTS (IPOG Algorithm) projects with different variables and values
combinations, as summarized in Table 11:
# File # Variables # Values Theoretical # of Expected Combinations ACTS # of Combinations
3x2 3 2 4 4
3x3 3 3 9 9
4x3 4 3 9 9
4x4 4 4 16 20
5x4 5 4 16 24
5x5 5 5 25 25
6x5 6 5 25 25
6x6 6 6 36 48
7x6 7 6 36 54
7x7 7 7 49 49
8x7 8 7 49 49
8x8 8 8 64 100
9x8 9 8 64 100
9x9 9 9 81 116
10x9 10 9 81 119
10x10 10 10 100 157
11x10 11 10 100 164
11x11 11 11 121 121
12X11 12 11 121 121
… … … … …
29X29 29 29 841 841
Table 11 – NIST ACTS (IPOG Algorithm) number of test cases for different combinations
"Danilo Berta" - Page 15 of 31
The “Theoretical # of Expected Combinations” is just the square of “# Values”. Three different
series of ACTS projects where prepared:
1. The number of variables and variables number of values are the same (look at Table
11)
2. The number of variables is one more than number of values each variable has (look at
Table 11)
3. The number of variables vary from 2 to 10 and the number of values is fixed = 5 (look at
Table 12)
# File # Variables # Values Theoretical # of Expected Combinations ACTS # of combinations
2x5 2 5 25 25
3x5 3 5 25 25
4x5 4 5 25 25
5x5 5 5 25 25
6x5 6 5 25 25
7x5 7 5 25 45
8x5 8 5 25 45
9x5 9 5 25 45
10x5 10 5 25 45
Table 12 – NIST ACTS (IPOG Algorithm) number of test cases for different # variables with fixed
number of values=5
For example, in the 3-rd row of Table 11 we have 4 variables (A, B, C and D) with 3 values each
(1, 2 and 3); it’s our original problem. In 4-rd row of Table 11 we have 4 variables (A, B, C and
D) with 4 values each (1, 2, 3 and 4). From Table 12 we see that expected vs. calculated
combinations are the same from 2 variables to a number of variables that is equal to variable’s
value +1 (in this case = 6). In the previous paragraph we said that it is expected that for all N ≥ 3
combinatorial problems with N variables with N values each, minimal test set has N●N = N2
test
cases, that is equivalent to find the Hamiltonian Circuits (N circuits) for the KN,N,…N (with N
indexes) graph.
"Danilo Berta" - Page 16 of 31
Experimental data (i.e. IPOG algorithm) shows that this is false! This is not a mathematical
proof, but should be a good starting point. What “experimental data” shows are quite more
interesting!
Looking at green rows in Table 11 we see that their come in pairs and that have in common:
• Same number of values for each variable. For example, the second group of green rows
(Variable, Values) = (5, 5) and (5, 6) have 6 (number of values) that is the same
• Same number of “ACTS # of Combinations”. For example, the second group of green
rows (Variable, Values) = (5, 5) and (5, 6) have 36 (number of minimal test set’s cases)
that is the same.
• For green lines, “ACTS # of Combinations” values coincide with “Theoretical # of
Expected Combinations”.
It’s much easier to see looking at the table than to explain by words. But, more interesting,
looking at the series of “# Values” (just green row), we got: (2, 3, 5, 7, 11, …, 29) that is the
prime numbers list !
Final conjectures
With all possible caution, prudence, circumspection and carefulness, considering that we do not
have a valid statistical sample of experimental data (that is, I run the test with ACTS just for the
first 12 numbers and I one more try with prime number 29, not considering that we don’t want to
investigate deeply on the results in Table 12) we can deduce (as a conjectures that should be
investigated):
a) Necessary (but by no means sufficient) condition to have a Minimal Test Set is that the
associated graph (in general terms, no need to be a KN,N,…N graph) is an Eulerian Graph.
b) Find Minimal Test Set for N variable with N values each, test set having N●N = N2
test
cases, is equivalent to find N Hamiltonian Circuits for KN,N,…N (with N indexes) graph.
"Danilo Berta" - Page 17 of 31
c) Find minimal Test Set problems for N variable with N values each (previous point (b)),
test set having N●N = N2
test cases, allow finding also minimal test set with the same
N●N = N2
test cases also for (N+1) variable with N values each, but N Hamiltonian
Circuits for KN,N,…N (with N+1 indexes) graph does not exist. I will try to give a proof in
Appendix 1.
d) NIST ACTS IPOG algorithms seems to found a minimal test set solution for N or (N+1)
variables with N values each just when N is prime. For this reason we can argue that:
a. Minimal Test Set exists just when N is a prime number
b. N Hamiltonian Circuits for KN,N,…N (with N indexes) graph exist just when N is a
prime number.
e) If we are able to create (with some algorithm) a NxN “Generalized Latin Square” (look at
Appendix 3 – Latin Square Generalization), rotating it N-1 times we (probably) get the
solution of the Minimal Pair Wise Test Problem for N and N+1 variables with N values
each one but we are not (probably) able to find Hamiltonian Circuits for KN,N,…N (with N or
N+1 indexes).
Sound “odd” that IPOG algorithm produce a minimal test set just when the variables values
are prime numbers; seems it’s not to be just an accident. It’s should be a good idea to verify
that, for a longer list of prime numbers, the relation: Number of Tests in Minimal Test Set =
(Number of values for each variable == prime number P) 2
is still effective using ACTS/IPOG
algorithm. Another verification that should be considered for a longer list of prime numbers,
is that the P2
test records for a minimal test set really map to P Hamiltonian path for graph
KN,N,…N (with P indexes), being P a prime number.
We would like to finish with a question: why for number of variables greater than (number of
variables’ value +1) the number of tests increments with constant step (Table 12)?
"Danilo Berta" - Page 18 of 31
Picture 5 – Graph’s Paths for block # 1 in Table 9
Picture 6 – Graph’s Paths for block # 2 in Table 9
"Danilo Berta" - Page 19 of 31
Picture 7 – Graph’s Paths for block # 3 in Table 9
Picture 8 – Overlapping Picture 5,Picture 6 and Picture 7 to get Eulerian Path (full graph)
"Danilo Berta" - Page 20 of 31
Appendix 1
Here we would like to prove that right Picture 5 path is not Hamiltonian.
It’s quite easy to see that (despite the isolated node A-2 and A-3), node A-1 is crossed 3 times.
Has to be remembered that level D (D-1, D-2, D-3) are all connected with A-1. So, for the
definition of Hamiltonian Circuit (i.e., a closed walk that traverses every vertex of G exactly
once), the vertex A-1 is crossed 3 times, so the closed walk should not be Hamiltonian.
We can introduce a new definition (I do not know if it’s already exist, I didn’t find it anywhere) of
Hamiltonian-like Circuits or almost-Hamiltonian Circuits that is: “a closed walk that traverses
every vertex of G exactly once except one vertices that should be crossed more than
once”. Introducing this definition, we can rephrase the conjectures as:
1) Find Minimal Test Set for N variable with N values each or (N+1) variable with N
values each, test set having N●N = N2
test cases, is equivalent to find N Hamiltonian
Circuits for KN,N,…N (with N indexes) graph or equivalent to find N almost-Hamiltonian
Circuits for KN,N,…N (with N+1 indexes) graph.
2) Minimal Test Set exists only if N is a prime number.
"Danilo Berta" - Page 21 of 31
Appendix 2
The minimal Test Set we got in Table 10 (originated from Table 4) has the same number of test
extracted by ACTS and reported in Table 13. ACTS also get a minimal test set (following our
original definition), but records are different (generation methods are different).
We would like to verify if the test set from ACTS should be mapped onto three Hamiltonian
Circuits.
Block # A B C D
1 1 1 1 2 2
2 1 2 3 3
3 1 3 1 1
2 4 2 1 3 1
5 2 2 1 2
6 2 3 2 3
3 7 3 1 1 3
8 3 2 2 1
9 3 3 3 2
Table 13 – Four variables with 3 values - Minimal pair wise Test Set from ACTS
Looking at Picture 9, Picture 10 and Picture 11 we should see at a glance that it’s possible
maps each block to a different Hamiltonian Circuits, that is different from the Hamiltonian
Circuits (Picture 5 , Picture 6 and Picture 7 ) created using the first Minimal Test Set (Table 10
originated from Table 4).
This give us one more chance to think that the connection among Minimal Pair Wise Test Set,
Hamiltonian Circuits for KN,N,…N graph and prime numbers is not just an accidental circumstance.
"Danilo Berta" - Page 22 of 31
Picture 9 – Graph’s Paths for block # 1 in Table 9 – ACTS combinations
Picture 10 – Graph’s Paths for block # 2 in Table 9 – ACTS combinations
"Danilo Berta" - Page 23 of 31
Picture 11 – Graph’s Paths for block # 3 in Table 9 – ACTS combinations
Picture 12 – Overlapping Picture 9, Picture 10 and Picture 11 to get Eulerian Path (full graph) – ACTS
Combinations
"Danilo Berta" - Page 24 of 31
Appendix 3 – Latin Square Generalization
Consider the following well know pictures referring the Graph coming from combinatorial
minimum problem solved using pairs in Table 10 (produced “by hand” and not calculated with
ACTS).
Picture 13 – Hamiltonian Path from Picture 5, Picture 6 and Picture 7 (minimum pair wise problem
manual solution)
It’s possible to present all the Hamiltonian Paths (that’s it, the complete Graph) above in the
following tabular format:
Picture 14 – Hamiltonian Path from Picture 13 in tabular format
The steps to build the two tables are in Picture 19, Picture 20 and Picture 21. Just pick a graph
and follows, in an ordered way, the arrows.
"Danilo Berta" - Page 25 of 31
We have three “sets”: numbers (1, 2, 3), Latin letters (A, B, C) and Greek letters (α, β, γ). Each
group of objects have a “seat”: blue for numbers, red for Latin letters and white for Greek letters.
Some considerations:
a) In each row and each column appears one and only one kind of set, represented by one
of their elements. For example in row # 1 and column # 1appear only Îą that belongs to
set of Greek letters.
b) The table # 2 in Picture 14 should be derived from the table # 1 rotating clockwise set of
numbers and set of Latin letters keeping the seats of the corresponding set (colors), as
we try to represent in the next picture. Greek letters are to stay steady because on the
diagonal.
What’s written in point (a) should be used for the definition of a “General Latin Square” where
has not to be considered single value, but the membership to a set.
If we rotate again table # 2 in Picture 14, get we another table that represent another possible
configuration (i.e.: other Hamiltonian path) or not? In other words, if we consider:
• Table # 2 from Picture 14
• Table # 2 from Picture 14 rotated clockwise (that is equivalent to get the Table # 1 from
Picture 14 and rotate it clockwise two times)
• Put the right header to the two tables. So Table # 2 from Picture 14 get the header Bs
and Cs, while Table # 3 ==(Table # 2 from Picture 14 rotated clockwise) get the header
Cs and Ds
"Danilo Berta" - Page 26 of 31
We get the following configuration:
Picture 15 – The other configuration
Now, notwithstanding the tables in Picture 14 are different from the tables in Picture 15, the
finale configuration is exactly the same. To verify this we just need to “match back” tabular
format on the three pictorial graphs format. But, if we try to do this… well for sure we can get all
the edges of the (one) complete graph, but – from tabular format – we do not know where to
start reading matrices to recreate the same three graphs in Picture 13. The best way to
understand this is to try. In other words, with tabular format we lost information. Rephrased,
this means that we lost the information about the Hamiltonian Circuits of K3, 3, 3 Graph, but, if we
are only interested to solve the combinatorial problem, it’s enough.
Let’s now look at the Test Set array generated by ACTS. From Picture 9, Picture 10 and Picture
11 we have:
Picture 16 – Hamiltonian Path from Picture 9, Picture 10 and Picture 11 (ACTS minimum pair wise
problem solution)
"Danilo Berta" - Page 27 of 31
Using the same methods as before, we get the following tables:
Picture 17 – Hamiltonian Path from Picture 14 in tabular format
The two matrices are “General Latin Square” but they cannot be “mapped” one to another by a
simple rotation around the diagonal, also because diagonals (both) are different. But we can
follow another way. Pick the first matrix (6
) in Picture 17 and:
• Rotate clockwise first time around diagonal (as we did before) getting RM1 matrix;
• Rotate clockwise again RM1 around diagonal and get a new matrix RM2.
The result is the following:
Picture 18 – RM1 and RM2 from first matrix in Picture 17
Again as before, we can derive the complete K3, 3, 3 Graph but we lost the information about the
single Hamiltonian Path.
6
I did not try, but I think it will be the same if you pick the second matrix.
"Danilo Berta" - Page 28 of 31
The conclusion is that if we are able to create a NxN “Generalized Latin Square”, rotating it N-1
times we (probably) get the solution of the Minimal Pair Wise Test Problem for N and N+1
variables with N values each one but we are not (probably) able to find Hamiltonian Circuits for
KN,N,…N (with N or N+1 indexes). But, from what we wrote before, seems that it’s just possible
when N is a prime number.
"Danilo Berta" - Page 29 of 31
Picture 19 – Steps # 1, 2 and 3 to build graph in tabular format
"Danilo Berta" - Page 30 of 31
Picture 20 – Steps # 4, 5 and 6 to build graph in tabular format
"Danilo Berta" - Page 31 of 31
Picture 21 – Steps # 7, 8 and 9 to build graph in tabular format

More Related Content

What's hot

2 4 solving rational equations
2 4 solving rational equations2 4 solving rational equations
2 4 solving rational equations
math123b
 
Module 4 exponential and logarithmic functions
Module 4   exponential and logarithmic functionsModule 4   exponential and logarithmic functions
Module 4 exponential and logarithmic functions
Aya Chavez
 
7.7 Solving Radical Equations
7.7 Solving Radical Equations7.7 Solving Radical Equations
7.7 Solving Radical Equations
swartzje
 
Foundation c2 exam august 2012 sols
Foundation c2 exam august 2012 solsFoundation c2 exam august 2012 sols
Foundation c2 exam august 2012 sols
fatima d
 
Ch 5 book - systems of linear equations
Ch 5 book - systems of linear equationsCh 5 book - systems of linear equations
Ch 5 book - systems of linear equations
Septiya Wulandari
 
Linear equations inequalities and applications
Linear equations inequalities and applicationsLinear equations inequalities and applications
Linear equations inequalities and applications
vineeta yadav
 
2 3linear equations ii
2 3linear equations ii2 3linear equations ii
2 3linear equations ii
math123a
 

What's hot (20)

Rational equations
Rational equationsRational equations
Rational equations
 
2 4 solving rational equations
2 4 solving rational equations2 4 solving rational equations
2 4 solving rational equations
 
1.5 comparison statements, inequalities and intervals t
1.5 comparison statements, inequalities and intervals t1.5 comparison statements, inequalities and intervals t
1.5 comparison statements, inequalities and intervals t
 
Module 4 exponential and logarithmic functions
Module 4   exponential and logarithmic functionsModule 4   exponential and logarithmic functions
Module 4 exponential and logarithmic functions
 
Factoring by Gemma Maniago
Factoring by Gemma ManiagoFactoring by Gemma Maniago
Factoring by Gemma Maniago
 
Free221
Free221Free221
Free221
 
7.7 Solving Radical Equations
7.7 Solving Radical Equations7.7 Solving Radical Equations
7.7 Solving Radical Equations
 
Zarebski_Memoire_FCS2
Zarebski_Memoire_FCS2Zarebski_Memoire_FCS2
Zarebski_Memoire_FCS2
 
Module 2 exponential functions
Module 2   exponential functionsModule 2   exponential functions
Module 2 exponential functions
 
Foundation c2 exam august 2012 sols
Foundation c2 exam august 2012 solsFoundation c2 exam august 2012 sols
Foundation c2 exam august 2012 sols
 
Ch 5 book - systems of linear equations
Ch 5 book - systems of linear equationsCh 5 book - systems of linear equations
Ch 5 book - systems of linear equations
 
D0366025029
D0366025029D0366025029
D0366025029
 
Numerical solution of system of linear equations
Numerical solution of system of linear equationsNumerical solution of system of linear equations
Numerical solution of system of linear equations
 
Algebraic fractions (2)
Algebraic fractions (2)Algebraic fractions (2)
Algebraic fractions (2)
 
Module 3 exponential and logarithmic functions
Module 3   exponential and logarithmic functionsModule 3   exponential and logarithmic functions
Module 3 exponential and logarithmic functions
 
Nbhm m. a. and m.sc. scholarship test 2009
Nbhm m. a. and m.sc. scholarship test 2009Nbhm m. a. and m.sc. scholarship test 2009
Nbhm m. a. and m.sc. scholarship test 2009
 
Linear equations inequalities and applications
Linear equations inequalities and applicationsLinear equations inequalities and applications
Linear equations inequalities and applications
 
Business Math Chapter 2
Business Math Chapter 2Business Math Chapter 2
Business Math Chapter 2
 
Business Math Chapter 3
Business Math Chapter 3Business Math Chapter 3
Business Math Chapter 3
 
2 3linear equations ii
2 3linear equations ii2 3linear equations ii
2 3linear equations ii
 

Similar to Berta_Danilo_Pairwise_Graph_v2

Museum Paper Rubric50 pointsRubric below is a chart form of .docx
Museum Paper Rubric50 pointsRubric below is a chart form of .docxMuseum Paper Rubric50 pointsRubric below is a chart form of .docx
Museum Paper Rubric50 pointsRubric below is a chart form of .docx
gilpinleeanna
 
Power Full Exposition
Power Full ExpositionPower Full Exposition
Power Full Exposition
Heesu Hwang
 
Andrew_Hair_Assignment_3
Andrew_Hair_Assignment_3Andrew_Hair_Assignment_3
Andrew_Hair_Assignment_3
Andrew Hair
 
Mit6 006 f11_quiz1
Mit6 006 f11_quiz1Mit6 006 f11_quiz1
Mit6 006 f11_quiz1
Sandeep Jindal
 
Thesis
ThesisThesis
Thesis
Brian Wu
 
Introductory Algebra Lesson 11 – Linear Functions, Part 2 .docx
Introductory Algebra   Lesson 11 – Linear Functions, Part 2 .docxIntroductory Algebra   Lesson 11 – Linear Functions, Part 2 .docx
Introductory Algebra Lesson 11 – Linear Functions, Part 2 .docx
mariuse18nolet
 

Similar to Berta_Danilo_Pairwise_Graph_v2 (20)

Museum Paper Rubric50 pointsRubric below is a chart form of .docx
Museum Paper Rubric50 pointsRubric below is a chart form of .docxMuseum Paper Rubric50 pointsRubric below is a chart form of .docx
Museum Paper Rubric50 pointsRubric below is a chart form of .docx
 
A Factor Graph Approach To Constrained Optimization
A Factor Graph Approach To Constrained OptimizationA Factor Graph Approach To Constrained Optimization
A Factor Graph Approach To Constrained Optimization
 
Imo 2008
Imo 2008 Imo 2008
Imo 2008
 
Imo2008 sl
Imo2008 slImo2008 sl
Imo2008 sl
 
Power Full Exposition
Power Full ExpositionPower Full Exposition
Power Full Exposition
 
Andrew_Hair_Assignment_3
Andrew_Hair_Assignment_3Andrew_Hair_Assignment_3
Andrew_Hair_Assignment_3
 
Mit6 006 f11_quiz1
Mit6 006 f11_quiz1Mit6 006 f11_quiz1
Mit6 006 f11_quiz1
 
Chapter-3.pdf
Chapter-3.pdfChapter-3.pdf
Chapter-3.pdf
 
Chapter-3.pdf
Chapter-3.pdfChapter-3.pdf
Chapter-3.pdf
 
01.01 vector spaces
01.01 vector spaces01.01 vector spaces
01.01 vector spaces
 
Solucao_Marion_Thornton_Dinamica_Classic (1).pdf
Solucao_Marion_Thornton_Dinamica_Classic (1).pdfSolucao_Marion_Thornton_Dinamica_Classic (1).pdf
Solucao_Marion_Thornton_Dinamica_Classic (1).pdf
 
Thesis
ThesisThesis
Thesis
 
Lesson 1 matrix
Lesson 1 matrixLesson 1 matrix
Lesson 1 matrix
 
M112rev
M112revM112rev
M112rev
 
Deturck wilf
Deturck wilfDeturck wilf
Deturck wilf
 
Complex Numbers
Complex NumbersComplex Numbers
Complex Numbers
 
Introductory Algebra Lesson 11 – Linear Functions, Part 2 .docx
Introductory Algebra   Lesson 11 – Linear Functions, Part 2 .docxIntroductory Algebra   Lesson 11 – Linear Functions, Part 2 .docx
Introductory Algebra Lesson 11 – Linear Functions, Part 2 .docx
 
A Comparative Analysis Of Assignment Problem
A Comparative Analysis Of Assignment ProblemA Comparative Analysis Of Assignment Problem
A Comparative Analysis Of Assignment Problem
 
Discrete mathematics
Discrete mathematicsDiscrete mathematics
Discrete mathematics
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 

Berta_Danilo_Pairwise_Graph_v2

  • 1. "Danilo Berta" - Page 1 of 31 "Danilo Berta - berta_danilo@hotmail.com" 25 June 2015 "Minimum Pair Wise test set calculation and connections with Graph Theory" Contents Contents .....................................................................................................................................1 List of Figures .............................................................................................................................1 Abstract.......................................................................................................................................3 Four variables with three values each one’s................................................................................5 Building the graph connected to pair wise problem .....................................................................7 Mapping graph’s path to pairs...................................................................................................10 Experimental data rescue!.........................................................................................................14 Final conjectures.......................................................................................................................16 Appendix 1................................................................................................................................20 Appendix 2................................................................................................................................21 Appendix 3 – Latin Square Generalization ................................................................................24 List of Figures Picture 1 – Graph associated with pair wise problem ..................................................................7 Picture 2 – Graph associated with pair wise problem – First level edges.....................................8
  • 2. "Danilo Berta" - Page 2 of 31 Picture 3 – Complete graph associated with pair wise problem...................................................9 Picture 4 – Kuratowski’s K3,3 graph ...........................................................................................12 Picture 5 – Graph’s Paths for block # 1 in Table 9.....................................................................18 Picture 6 – Graph’s Paths for block # 2 in Table 9.....................................................................18 Picture 7 – Graph’s Paths for block # 3 in Table 9.....................................................................19 Picture 8 – Overlapping Picture 5,Picture 6 and Picture 7 to get Eulerian Path (full graph) .......19 Picture 9 – Graph’s Paths for block # 1 in Table 9 – ACTS combinations..................................22 Picture 10 – Graph’s Paths for block # 2 in Table 9 – ACTS combinations................................22 Picture 11 – Graph’s Paths for block # 3 in Table 9 – ACTS combinations................................23 Picture 12 – Overlapping Picture 9, Picture 10 and Picture 11 to get Eulerian Path (full graph) – ACTS Combinations..................................................................................................................23 Picture 13 – Hamiltonian Path from Picture 5, Picture 6 and Picture 7 (minimum pair wise problem manual solution)..........................................................................................................24 Picture 14 – Hamiltonian Path from Picture 13 in tabular format ...............................................24 Picture 15 – The other configuration .........................................................................................26 Picture 16 – Hamiltonian Path from Picture 9, Picture 10 and Picture 11 (ACTS minimum pair wise problem solution) ..............................................................................................................26 Picture 17 – Hamiltonian Path from Picture 14 in tabular format ...............................................27 Picture 18 – RM1 and RM2 from first matrix in Picture 17.........................................................27 Picture 19 – Steps # 1, 2 and 3 to build graph in tabular format ................................................29 Picture 20 – Steps # 4, 5 and 6 to build graph in tabular format ................................................30 Picture 21 – Steps # 7, 8 and 9 to build graph in tabular format ................................................31
  • 3. "Danilo Berta" - Page 3 of 31 Abstract The problem we will engage here is the following: having N variables with different values each one, what is – if exist – a minimal test set allowing a full pair wise coverage? In other words, consider the following table: A_1 A_2 A_3 … A_K 1 1 1 1 2 2 2 2 … … … … … N1 N2 N3 … NK Table 1 – K variables with different values each ones Consider now the ordered sequence (N1, N2, N3, …, NK) where N1 ≥ N2 ≥ N3 ≥ … > NK. We may expect that the minimal pair wise test set has no more and no less than N1●N2 test cases. In the following for “Minimal Pair Wise Test Set” we consider not a generic test set that should be extracted with some kind of algorithm, but the test set for which each variables pairs appears one and only one times. In other words, the frequency map of all variables pair is exactly equal to one. This should be a little importance for practical test problems, but it should be interesting from a theoretical point of view. For example, for the variables and values below: A_1 A_2 A_3 A_4 1 1 1 1 2 2 2 2 3 3 3 4 4 4 5 Table 2 – 4 variables with different values each ones as Example We forecast a minimum test set is composed by 5●4 = 20 test cases. Such minimal test cases exist in some particular cases, for example when we have 4 variables with 3 values each one (as we will see in the following paragraph), so the answer to the question should not be always “YES” or always “NO”. Investigating on the problem, using the IPOG algorithm used by NIST ACTS tool, we will find a correlation among: combinatorial pair wise problems, k-partite graph (Graph Theory) and prime number.
  • 4. "Danilo Berta" - Page 4 of 31 As an empirical conjecture we will find that there is a solution of the problem (which we will call in the following “Minimal Pair Wise Problem), when: • We have N variables with N values or (N+1) variables with N values each. • N is prime • Finding solution for the Minimal Pair Wise Problem for N variables with N values means find the Hamiltonian Circuits for KN,N,…N (with N indexes) Kuratowski’s graph. • The solution for the Minimal Pair Wise Problem for (N+1) variables with N values do not imply the existence of Hamiltonian Circuits for KN,N,…N (with N+1 indexes) Kuratowski’s graph. Connections between Graph Theory and pair wise testing was already discussed in the article “Pairwise Test Set Calculation using k-partite Graphs” written by Elke Salecker, Sabine Glesner (TU Berlin), 2010 IEEE International Conference on Software Maintenance (ICSM)” but with a different purpose. For Graph Theory definitions and theorems we referred the book: “Graph Theory, with applications to engineering and computer science “ – Narsingh Deo – PHI Editions.
  • 5. "Danilo Berta" - Page 5 of 31 Four variables with three values each one’s Consider the case of four three-value variables: A B C D 1 1 1 1 2 2 2 2 3 3 3 3 Table 3 – Four variables with three values each ones We know that all the possible combinations are 3•3•3•3=34 = 81. Problem: What is the minimal test set that guarantee 100% wise-2 (all pairs) coverage? It should be at least composed by 3•3 = 9 cases. Solution: Considering all the six pairs coming out from the A, B, C and D variables: AB, AC, AD, BC, BD and CD. If we freely set the first three pairs, AB, AC and AD the pairs BC, BD and CD are automatically defined. So the “green right” side of the Table 4 depends from the “white left” side of the same. The grey column is just the final string. Block # AB AC AD BC BD CD A B C D 1 1 11 12 13 12 13 23 1 1 2 3 2 13 11 12 31 32 12 1 3 1 2 3 12 13 11 23 21 31 1 2 3 1 2 4 22 21 23 21 23 13 2 2 1 3 5 23 22 21 32 31 21 2 3 2 1 6 21 23 22 13 12 32 2 1 3 2 3 7 31 31 31 11 11 11 3 1 1 1 8 32 32 32 22 22 22 3 2 2 2 9 33 33 33 33 33 33 3 3 3 3 Table 4 – Four variables with 3 values each one’s – wise-2 Minimal Test Set To get the minimal test set in Table 4, steps performed are the following: First Step: Fix A = 0 and build the Latin Square for variable B, C and D, so we are sure that just one value appears on the same row and column (as from definition of Latin Square1 ). # B C D 1 1 2 3 1 Latin square is an n × n array filled with n different symbols, each occurring exactly once in each row and exactly once in each column. For small squares it is possible to generate permutations and test whether the Latin square property is met.
  • 6. "Danilo Berta" - Page 6 of 31 2 3 1 2 3 2 3 1 Table 5 – B, C and D variable Latin Square # 1 Rows from #1 to # 3 (block 1) of Table 4 are generated from Table 5 Latin Square # 1 “left side pasting” A=1 in all the B, C and D columns. Second Step: Fix A=1 and, as before, we “walk” on the diagonal (bright yellow) of Table 5 getting the following table: # B C D 1 2 1 3 2 3 2 1 3 1 3 2 Table 6 – B, C and D variable, Latin Square # 2 Rows from #4 to # 6 (block 2) of Table 4 are generated from Table 5 Latin Square # 2 “left side pasting” A=1 in all the B, C and D columns. Third Step: Fix A=3 and, if we walk again on the diagonal (bright green) of Table 6, we come back to the sequence (B, C, D) = (1, 2, 3). We use instead the other diagonal (2, 2, 2) and, with a few of imagination, draw the following table: # B C D 1 1 1 1 2 2 2 2 3 3 3 3 Table 7 – B, C and D variable, not Latin Square Table 7 is not a Latin square and there is not a strict logic behind. It’s … well … like a guessing game. Rows from # 7 to # 9 (block 3) of Table 4 are generated from Table 7 not Latin Square “left side pasting” A=3 in all the B, C and D columns. The string A B C (grey column) coming out in Table 4 has 100% wise-2 coverage, because all the pairs appears - only once - for a total of just 9 combinations (the frequency map(2 ) is 2 If we draw a Cartesian graph having on X axis the pairs (27 in this case) an on Y axis the frequency each pair appear in the final test set, a minimal test set has a frequency map that is a straight line parallel to X axis and with Y = 1 (all pairs are covered just once).
  • 7. "Danilo Berta" - Page 7 of 31 constant = 1); just note that ACTS give exactly the same number of combinations, also if the combinations themselves are different. Building the graph connected to pair wise problem To build the Graph associated with the four variables, three values pair wise problem, start with a simple table. The table has as rows the variables’ name and as columns the values for each variable, as follow: 1 2 3 A B C D Table 8 – First representation of graph associated with pair wise problem In the cross between rows and columns we have the node of the Graph. In a more pictorial form: Picture 1 – Graph associated with pair wise problem
  • 8. "Danilo Berta" - Page 8 of 31 All values of A variable (1, 2, 3) must be connected with all values of variable B, that are always (1, 2, 3); node A-1 must be connected with all B’s nodes. The same happen for node A-2 and A-3. We get the following (partial) graph: Picture 2 – Graph associated with pair wise problem – First level edges The edges connect all levels A with all levels B. We do not connect levels A with levels C or D, just each level with the next, starting from the top (level A) that is considered the first level. In this way we connect all A-s level with all B-s levels (Cartesian product), all B-s levels with all C-s levels (Cartesian product) and all C-s levels with all D-s levels (Cartesian product). At the end of the process, we have the complete graph in Picture 3. The meaning of dotted line from D to A is to connect (Cartesian product) all D-s levels (D1, D2, D3) with all A-s levels (A1, A2, A3) getting all the combinations ((D1, A1), (D1, A2), (D1, A3), …,(D3, A1), (D3, A2), (D3, A3)). This is the so called 4-partite graph (3 ), because nodes at the same levels aren’t connected, forming four disjoint sets. We will come back on k-partite graph in what follows. In 3 The article “Pairwise Test Set Calculation using k-partite Graphs” written by Elke Salecker, Sabine Glesner (TU Berlin), 2010 IEEE International Conference on Software Maintenance (ICSM) use a similar approach but with the purpose to find an algorithm to solve pair wise problem. In the article the authors create complete connections with all levels.
  • 9. "Danilo Berta" - Page 9 of 31 the next paragraph what we will do is to map Table 4 with all the pair’s wise combinations on the paths of the graph (4 ). Picture 3 – Complete graph associated with pair wise problem In sake of completeness, the following table is the adjacency matrix (5 ) of the graph: A1 A2 A3 B1 B2 B3 C1 C2 C3 D1 D2 D3 A1 0 0 0 1 1 1 0 0 0 0 0 0 A2 0 0 0 1 1 1 0 0 0 0 0 0 A3 0 0 0 1 1 1 0 0 0 0 0 0 B1 0 0 0 0 0 0 1 1 1 0 0 0 B2 0 0 0 0 0 0 1 1 1 0 0 0 B3 0 0 0 0 0 0 1 1 1 0 0 0 C1 0 0 0 0 0 0 0 0 0 1 1 1 C2 0 0 0 0 0 0 0 0 0 1 1 1 C3 0 0 0 0 0 0 0 0 0 1 1 1 D1 1 1 1 0 0 0 0 0 0 0 0 0 D2 1 1 1 0 0 0 0 0 0 0 0 0 D3 1 1 1 0 0 0 0 0 0 0 0 0 Table 9 – Adjacency matrix of graph 4 A walk is defined as a finite alternating sequences of vertices and edges, beginning and ending with vertices, such that each edge is incident with the vertices preceding and following it. No edge appears (is covered or traversed) more than once in a walk It is possible for a walk to begin and end at the same vertex: such a walk is called closed walk. A walk that is not closed (i.e., the terminal vertices are distinct) is called and open walk. (from: Narsingh Deo)A path (or trail) is a open walk in which no vertex appears more than once. In other words, a path does not intersect itself (from: Narsingh Deo). Depending on the book you get on Graph Theory, the definitions change a bit. 5 The adjacency matrix of a finite graph G on n nodes is the n × n matrix where the non-diagonal entry aij is the number of edges from vertex i to vertex j, and the diagonal entry aii, depending on the convention, is either once or twice the number of edges (loops) from node i to itself.
  • 10. "Danilo Berta" - Page 10 of 31 Mapping graph’s path to pairs. Start rewriting Table 4 considering only the variables A, B, C and D, disregarding columns with pairs and re-ordering rows on values of variables A and B: Block # A B C D 1 1 1 1 2 3 2 1 2 3 1 3 1 3 1 2 2 4 2 1 3 2 5 2 2 1 3 6 2 3 2 1 3 7 3 1 1 1 8 3 2 2 2 9 3 3 3 3 Table 10 – Four variables with 3 values - Minimal pair wise Test Set The values in each row just define the path through the graph, so (A, B, C, D) = (1, 1, 2, 3) match the path (A-1, B-1, C-2, D-3). For all the nine rows (3 blocks), we have the (partial) graphs in Picture 5, Picture 6 and Picture 7 (just look at the left size, for the moment). Really, they are not “real” graphs, because not connected nodes are presents; it’s better to call them a “not connected” graphs. Overlapping all this three partial graphs, you get the complete graph in Picture 3. For now, disregards not connected nodes: they do not change the substance of the argument we are discussing. We got some definitions from the book: “Graph Theory, with applications to engineering and computer science “ – Narsingh Deo – PHI Editions. Eulerian walk: An Euler line of a connected graph is characterized by the property of being a closed walk that traverses every edges of the graph exactly once. Hamiltonian circuit in a connected graph is defined as a closed walk that traverses every vertex of G exactly once, except – of course – the starting vertex at which the walk also terminate. Now, look at Picture 5 (but the same is valid also for Picture 6 and Picture 7). If we do not consider the first level (A), the “low” part of the graph is Hamiltonian and the different arrows
  • 11. "Danilo Berta" - Page 11 of 31 colors show a Hamiltonian circuit (the picture in the right side); remember that last level D is completely connected with level A. Some important definitions and theorems on Hamiltonian and Eulerian graphs: a) Complete Graph (universal graph, clique): a simple graph in which there exists an edge between every pair of vertices. b) Regular Graph: a graph in which all vertices are of equal degree. The degree of a vertex is the number of incident edges on the same vertex (with self loop counted twice, but in our graph we do not have such loops). In a digraph, the degree of a vertex is sometime referred as the difference (as absolute value) from incoming edges to outgoing edges. c) Number of Hamiltonian Circuits in a Graph: a given graph may contain more than one Hamiltonian circuit. Of interest are all the edge-disjoint Hamiltonian circuits in a graph. The determination of the exact number of edge-disjoint Hamiltonian Circuits (or paths) in a graph in general is also an unsolved problem. We can just say (G. A. Dirac Theorem) that a sufficient (but by no means necessary) condition for a simple graph G to have a Hamiltonian Circuit is that the degree of every vertex in G be at least n/2, where n is the number of vertices in G. However, the number of edge-disjoint Hamiltonian circuits in a Complete Graph with odd number of vertices is given by the following theorem: “In a Complete Graph with n vertices there are (n-1)/2 edge-disjoint Hamiltonian Circuits, if n is an odd number and n ≥ 3”. d) Eulerian Condition: a given connected graph G is an Euler graph if and only if all vertices of G are of even degree. e) K-partite graph: a graph G is called k-partite (bi-partite, 3-partite,…) if it’s vertex set V can be decomposed into K (two, three,….) disjoint subsets V1, V2, …, Vk such that every edge in G joins a vertex in Vi with a vertex in Vi+1 with (i=1,2,…,k) (note that adjacent
  • 12. "Danilo Berta" - Page 12 of 31 vertices set has to be connected). We already cited this kind of graph some pages before. f) Kuratowski’s graph K3,3: The graph in Picture 4 is the so called Kuratowski’s graph K3,3, having the following properties: a. Is a regular graph b. Is a non-planar graph c. Is 2-partite graph After this information’s roundup we should note that: Picture 4 – Kuratowski’s K3,3 graph 1. Graph in Picture 3 is nothing else but two K3,3 graphs “piled up” and cyclic (where with “cyclic” we means that bottom level D is completely connected with top level A). 2. K3,3 graph: a. Is not a complete graph, so we cannot use theorem in point c) to calculate the Number of Hamiltonian Circuits for this graph b. It’s a regular graph of degree 3 c. Is a 2-partite graph. 3. We got from the previous point that Picture 3 graph (the complete graph): a. Is not a complete graph, so we cannot use theorem in point c) to calculate the Number of Hamiltonian Circuits. b. Is a regular graph of degree 3 (or 0 if you do the difference incoming – outgoing edges)
  • 13. "Danilo Berta" - Page 13 of 31 c. Is a 4-partite graph 4. Graph on the right side of Picture 5 (the same for Picture 6 and Picture 7): a. Is not a complete graph, so we cannot use theorem in point c) to calculate the Number of Hamiltonian Circuits. b. Is a regular graph of degree 3 (or 0 if you do the difference incoming – outgoing edges) c. Is a 3-partite graph d. Should be build from two K3,3 piled up together. We can call it K3,3,3 graph. More generally the index’s number (in this case = 3) is equal to columns number (that is number of values’ variable for the equivalent combinatorial problem), while the number of indexes (in this case are always 3 = 3,3,3) is equal to the number of levels (that is the number of variable for the equivalent combinatorial problem). Another example: the original graph in Picture 3 is a K3,3,3,3 because we have 4 variables (= 4 levels A, B, C and D) and 3 values (= 3 columns 1, 2 and 3). 5. Overlapping graphs on the right side of Picture 5, Picture 6 and Picture 7 you got the complete graph or, what is the same, an Eulerian Path for the graph. In other word, behaves like vectorial spaces bases; the Hamiltonian edge-disjoint Circuit seems to form a base for the graph, because if you “add” (means, overlap or set union) them you got the complete graph or an Eulerian Path. To summarize: “Graph theory (for what is in my knowledge) has not a general theorem that allow to count and/or calculate Hamiltonian Path for graph on the right side of Picture 5 (the same for Picture 6 and Picture 7), but we got it using combinatorial test method, as described in the previous paragraph”. It’ seems to be a strict connection between combinatorial minimal test set problems calculation of N and (N+1) variables with N values with k-partite regular (not complete) graph.
  • 14. "Danilo Berta" - Page 14 of 31 So, if we are able to calculate the Hamiltonian Circuits (N circuits) for a generic KN,N,…N (with N indexes) graph we are able to find a minimal pair wise combinatorial test set for N variables with N values each with (N●N = N2 ) test cases; reverse, if we are able to calculate minimal pair wise combinatorial test set for N variables with N values each with (N●N = N2 ), we get also the Hamiltonian Circuits (N circuits) for the KN,N,…N (with N indexes) graph. And this seems to be valid for any possible N ≥ 3. Considering that we do not have the possibility to calculate the Hamiltonian circuits (a theorem does not exist and problem seems to fall into category of NP-hard problems), we can operate in the “reverse way” using IPOG algorithm (implemented by NIST ACTS). Experimental data rescue! I created twenty NIST ACTS (IPOG Algorithm) projects with different variables and values combinations, as summarized in Table 11: # File # Variables # Values Theoretical # of Expected Combinations ACTS # of Combinations 3x2 3 2 4 4 3x3 3 3 9 9 4x3 4 3 9 9 4x4 4 4 16 20 5x4 5 4 16 24 5x5 5 5 25 25 6x5 6 5 25 25 6x6 6 6 36 48 7x6 7 6 36 54 7x7 7 7 49 49 8x7 8 7 49 49 8x8 8 8 64 100 9x8 9 8 64 100 9x9 9 9 81 116 10x9 10 9 81 119 10x10 10 10 100 157 11x10 11 10 100 164 11x11 11 11 121 121 12X11 12 11 121 121 … … … … … 29X29 29 29 841 841 Table 11 – NIST ACTS (IPOG Algorithm) number of test cases for different combinations
  • 15. "Danilo Berta" - Page 15 of 31 The “Theoretical # of Expected Combinations” is just the square of “# Values”. Three different series of ACTS projects where prepared: 1. The number of variables and variables number of values are the same (look at Table 11) 2. The number of variables is one more than number of values each variable has (look at Table 11) 3. The number of variables vary from 2 to 10 and the number of values is fixed = 5 (look at Table 12) # File # Variables # Values Theoretical # of Expected Combinations ACTS # of combinations 2x5 2 5 25 25 3x5 3 5 25 25 4x5 4 5 25 25 5x5 5 5 25 25 6x5 6 5 25 25 7x5 7 5 25 45 8x5 8 5 25 45 9x5 9 5 25 45 10x5 10 5 25 45 Table 12 – NIST ACTS (IPOG Algorithm) number of test cases for different # variables with fixed number of values=5 For example, in the 3-rd row of Table 11 we have 4 variables (A, B, C and D) with 3 values each (1, 2 and 3); it’s our original problem. In 4-rd row of Table 11 we have 4 variables (A, B, C and D) with 4 values each (1, 2, 3 and 4). From Table 12 we see that expected vs. calculated combinations are the same from 2 variables to a number of variables that is equal to variable’s value +1 (in this case = 6). In the previous paragraph we said that it is expected that for all N ≥ 3 combinatorial problems with N variables with N values each, minimal test set has N●N = N2 test cases, that is equivalent to find the Hamiltonian Circuits (N circuits) for the KN,N,…N (with N indexes) graph.
  • 16. "Danilo Berta" - Page 16 of 31 Experimental data (i.e. IPOG algorithm) shows that this is false! This is not a mathematical proof, but should be a good starting point. What “experimental data” shows are quite more interesting! Looking at green rows in Table 11 we see that their come in pairs and that have in common: • Same number of values for each variable. For example, the second group of green rows (Variable, Values) = (5, 5) and (5, 6) have 6 (number of values) that is the same • Same number of “ACTS # of Combinations”. For example, the second group of green rows (Variable, Values) = (5, 5) and (5, 6) have 36 (number of minimal test set’s cases) that is the same. • For green lines, “ACTS # of Combinations” values coincide with “Theoretical # of Expected Combinations”. It’s much easier to see looking at the table than to explain by words. But, more interesting, looking at the series of “# Values” (just green row), we got: (2, 3, 5, 7, 11, …, 29) that is the prime numbers list ! Final conjectures With all possible caution, prudence, circumspection and carefulness, considering that we do not have a valid statistical sample of experimental data (that is, I run the test with ACTS just for the first 12 numbers and I one more try with prime number 29, not considering that we don’t want to investigate deeply on the results in Table 12) we can deduce (as a conjectures that should be investigated): a) Necessary (but by no means sufficient) condition to have a Minimal Test Set is that the associated graph (in general terms, no need to be a KN,N,…N graph) is an Eulerian Graph. b) Find Minimal Test Set for N variable with N values each, test set having N●N = N2 test cases, is equivalent to find N Hamiltonian Circuits for KN,N,…N (with N indexes) graph.
  • 17. "Danilo Berta" - Page 17 of 31 c) Find minimal Test Set problems for N variable with N values each (previous point (b)), test set having N●N = N2 test cases, allow finding also minimal test set with the same N●N = N2 test cases also for (N+1) variable with N values each, but N Hamiltonian Circuits for KN,N,…N (with N+1 indexes) graph does not exist. I will try to give a proof in Appendix 1. d) NIST ACTS IPOG algorithms seems to found a minimal test set solution for N or (N+1) variables with N values each just when N is prime. For this reason we can argue that: a. Minimal Test Set exists just when N is a prime number b. N Hamiltonian Circuits for KN,N,…N (with N indexes) graph exist just when N is a prime number. e) If we are able to create (with some algorithm) a NxN “Generalized Latin Square” (look at Appendix 3 – Latin Square Generalization), rotating it N-1 times we (probably) get the solution of the Minimal Pair Wise Test Problem for N and N+1 variables with N values each one but we are not (probably) able to find Hamiltonian Circuits for KN,N,…N (with N or N+1 indexes). Sound “odd” that IPOG algorithm produce a minimal test set just when the variables values are prime numbers; seems it’s not to be just an accident. It’s should be a good idea to verify that, for a longer list of prime numbers, the relation: Number of Tests in Minimal Test Set = (Number of values for each variable == prime number P) 2 is still effective using ACTS/IPOG algorithm. Another verification that should be considered for a longer list of prime numbers, is that the P2 test records for a minimal test set really map to P Hamiltonian path for graph KN,N,…N (with P indexes), being P a prime number. We would like to finish with a question: why for number of variables greater than (number of variables’ value +1) the number of tests increments with constant step (Table 12)?
  • 18. "Danilo Berta" - Page 18 of 31 Picture 5 – Graph’s Paths for block # 1 in Table 9 Picture 6 – Graph’s Paths for block # 2 in Table 9
  • 19. "Danilo Berta" - Page 19 of 31 Picture 7 – Graph’s Paths for block # 3 in Table 9 Picture 8 – Overlapping Picture 5,Picture 6 and Picture 7 to get Eulerian Path (full graph)
  • 20. "Danilo Berta" - Page 20 of 31 Appendix 1 Here we would like to prove that right Picture 5 path is not Hamiltonian. It’s quite easy to see that (despite the isolated node A-2 and A-3), node A-1 is crossed 3 times. Has to be remembered that level D (D-1, D-2, D-3) are all connected with A-1. So, for the definition of Hamiltonian Circuit (i.e., a closed walk that traverses every vertex of G exactly once), the vertex A-1 is crossed 3 times, so the closed walk should not be Hamiltonian. We can introduce a new definition (I do not know if it’s already exist, I didn’t find it anywhere) of Hamiltonian-like Circuits or almost-Hamiltonian Circuits that is: “a closed walk that traverses every vertex of G exactly once except one vertices that should be crossed more than once”. Introducing this definition, we can rephrase the conjectures as: 1) Find Minimal Test Set for N variable with N values each or (N+1) variable with N values each, test set having N●N = N2 test cases, is equivalent to find N Hamiltonian Circuits for KN,N,…N (with N indexes) graph or equivalent to find N almost-Hamiltonian Circuits for KN,N,…N (with N+1 indexes) graph. 2) Minimal Test Set exists only if N is a prime number.
  • 21. "Danilo Berta" - Page 21 of 31 Appendix 2 The minimal Test Set we got in Table 10 (originated from Table 4) has the same number of test extracted by ACTS and reported in Table 13. ACTS also get a minimal test set (following our original definition), but records are different (generation methods are different). We would like to verify if the test set from ACTS should be mapped onto three Hamiltonian Circuits. Block # A B C D 1 1 1 1 2 2 2 1 2 3 3 3 1 3 1 1 2 4 2 1 3 1 5 2 2 1 2 6 2 3 2 3 3 7 3 1 1 3 8 3 2 2 1 9 3 3 3 2 Table 13 – Four variables with 3 values - Minimal pair wise Test Set from ACTS Looking at Picture 9, Picture 10 and Picture 11 we should see at a glance that it’s possible maps each block to a different Hamiltonian Circuits, that is different from the Hamiltonian Circuits (Picture 5 , Picture 6 and Picture 7 ) created using the first Minimal Test Set (Table 10 originated from Table 4). This give us one more chance to think that the connection among Minimal Pair Wise Test Set, Hamiltonian Circuits for KN,N,…N graph and prime numbers is not just an accidental circumstance.
  • 22. "Danilo Berta" - Page 22 of 31 Picture 9 – Graph’s Paths for block # 1 in Table 9 – ACTS combinations Picture 10 – Graph’s Paths for block # 2 in Table 9 – ACTS combinations
  • 23. "Danilo Berta" - Page 23 of 31 Picture 11 – Graph’s Paths for block # 3 in Table 9 – ACTS combinations Picture 12 – Overlapping Picture 9, Picture 10 and Picture 11 to get Eulerian Path (full graph) – ACTS Combinations
  • 24. "Danilo Berta" - Page 24 of 31 Appendix 3 – Latin Square Generalization Consider the following well know pictures referring the Graph coming from combinatorial minimum problem solved using pairs in Table 10 (produced “by hand” and not calculated with ACTS). Picture 13 – Hamiltonian Path from Picture 5, Picture 6 and Picture 7 (minimum pair wise problem manual solution) It’s possible to present all the Hamiltonian Paths (that’s it, the complete Graph) above in the following tabular format: Picture 14 – Hamiltonian Path from Picture 13 in tabular format The steps to build the two tables are in Picture 19, Picture 20 and Picture 21. Just pick a graph and follows, in an ordered way, the arrows.
  • 25. "Danilo Berta" - Page 25 of 31 We have three “sets”: numbers (1, 2, 3), Latin letters (A, B, C) and Greek letters (Îą, β, Îł). Each group of objects have a “seat”: blue for numbers, red for Latin letters and white for Greek letters. Some considerations: a) In each row and each column appears one and only one kind of set, represented by one of their elements. For example in row # 1 and column # 1appear only Îą that belongs to set of Greek letters. b) The table # 2 in Picture 14 should be derived from the table # 1 rotating clockwise set of numbers and set of Latin letters keeping the seats of the corresponding set (colors), as we try to represent in the next picture. Greek letters are to stay steady because on the diagonal. What’s written in point (a) should be used for the definition of a “General Latin Square” where has not to be considered single value, but the membership to a set. If we rotate again table # 2 in Picture 14, get we another table that represent another possible configuration (i.e.: other Hamiltonian path) or not? In other words, if we consider: • Table # 2 from Picture 14 • Table # 2 from Picture 14 rotated clockwise (that is equivalent to get the Table # 1 from Picture 14 and rotate it clockwise two times) • Put the right header to the two tables. So Table # 2 from Picture 14 get the header Bs and Cs, while Table # 3 ==(Table # 2 from Picture 14 rotated clockwise) get the header Cs and Ds
  • 26. "Danilo Berta" - Page 26 of 31 We get the following configuration: Picture 15 – The other configuration Now, notwithstanding the tables in Picture 14 are different from the tables in Picture 15, the finale configuration is exactly the same. To verify this we just need to “match back” tabular format on the three pictorial graphs format. But, if we try to do this… well for sure we can get all the edges of the (one) complete graph, but – from tabular format – we do not know where to start reading matrices to recreate the same three graphs in Picture 13. The best way to understand this is to try. In other words, with tabular format we lost information. Rephrased, this means that we lost the information about the Hamiltonian Circuits of K3, 3, 3 Graph, but, if we are only interested to solve the combinatorial problem, it’s enough. Let’s now look at the Test Set array generated by ACTS. From Picture 9, Picture 10 and Picture 11 we have: Picture 16 – Hamiltonian Path from Picture 9, Picture 10 and Picture 11 (ACTS minimum pair wise problem solution)
  • 27. "Danilo Berta" - Page 27 of 31 Using the same methods as before, we get the following tables: Picture 17 – Hamiltonian Path from Picture 14 in tabular format The two matrices are “General Latin Square” but they cannot be “mapped” one to another by a simple rotation around the diagonal, also because diagonals (both) are different. But we can follow another way. Pick the first matrix (6 ) in Picture 17 and: • Rotate clockwise first time around diagonal (as we did before) getting RM1 matrix; • Rotate clockwise again RM1 around diagonal and get a new matrix RM2. The result is the following: Picture 18 – RM1 and RM2 from first matrix in Picture 17 Again as before, we can derive the complete K3, 3, 3 Graph but we lost the information about the single Hamiltonian Path. 6 I did not try, but I think it will be the same if you pick the second matrix.
  • 28. "Danilo Berta" - Page 28 of 31 The conclusion is that if we are able to create a NxN “Generalized Latin Square”, rotating it N-1 times we (probably) get the solution of the Minimal Pair Wise Test Problem for N and N+1 variables with N values each one but we are not (probably) able to find Hamiltonian Circuits for KN,N,…N (with N or N+1 indexes). But, from what we wrote before, seems that it’s just possible when N is a prime number.
  • 29. "Danilo Berta" - Page 29 of 31 Picture 19 – Steps # 1, 2 and 3 to build graph in tabular format
  • 30. "Danilo Berta" - Page 30 of 31 Picture 20 – Steps # 4, 5 and 6 to build graph in tabular format
  • 31. "Danilo Berta" - Page 31 of 31 Picture 21 – Steps # 7, 8 and 9 to build graph in tabular format