The idea behind the concept of minimal frequent VULS mining is that the time complex- ity advantages of both minimal and frequent VULS mining can be combined. However, it was anticipated that fewer VULS would be discovered than when finding only minimal or only frequent VULS, and thus coverage might be adversely affected (this is explored further in Chapter 7 and 8). As in the case of the minVULSM algorithm we can pro- ceed in a breadth first manner and exclude subgraphs who have a parent graph that is a minimal VULS.
The pseudo code for the minFreqVULSM algorithm is presented in Algorithm 9. The algorithm is almost identical to Algorithm 8 except that, on each iteration, we store the identified non-minimal VULS in a set Tk (line 39) and then use this set to generate the
Algorithm 9 minFreqVULSM algorithm
1: procedure main(Gtrain,max)
2: k= 1
3: G=Gtrain(Part of input graph not covered by minimal VULS) 4: Gk=the set of k-edge subgraphs in G(candidate VULS) 5: Tk=∅(the set of k-edge subgraphs which are not VULS)
6: U =∅
7: while (k < max)do
8: U =U ∪ genFminVULS(k,Gk)
9: Gk+1=subgraph M ining(G, k+ 1)(Algorithm 6 wheree∈Tk)
10: k=k+ 1
11: end while
12: end procedure
13: procedure genF minV U LS(k, Gk) 14: /* Calculate σ */
15: Sup= Array of length |GK|to hold occurrence counts
16: total = 0
17: for each g∈Gk do
18: Sup[g] = Occurrence count of g inG 19: total=total+sup[g]
20: end for
21: σ = total|Gk| (Equation 5.1)
22: /* Identify frequent candidate VULS */
23: G0k=∅
24: for each edgeg∈Gk do
25: if Sup[g]≥σ then 26: G0k =G0k∪g 27: end if 28: end for 29: U0 =∅ 30: for all c∈G0k do
31: if isVULS(c) then/* Algorithm 5 */
32: U0 =U0∪c
33: coverage= compute coverage using Equ (4.1)
34: if coverage== 100% then 35: exit 36: end if 37: G=G−c 38: else 39: Tk=Tk∪c 40: end if 41: end for 42: if Tk==∅ then 43: exit 44: end if 45: return U0 46: end procedure
Iteration
Number (𝜎) Candidate VULS Labeled candidate VULS (Occurrence count) Minimal frequent VULS Yes/No ? K=1 (𝜎= !!!!! ! =2) 2 Not VULS 1 3 Minimal frequent VULS K=2 (𝜎=!!! ! =1) Candidate VULS
Labeled candidate VULS (Occurrence count) Minimal frequent VULS Yes/No ? 1 Not VULS 1 K=3 (𝜎=! !=1) Candidate VULS
Labeled candidate VULS
(Occurrence count) Minimal frequent VULS Yes/No ?
1
Minimal frequent VULS
Figure 5.12: Worked example of minimal frequent VULSM mining wheremax= 3
A Worked example of the process of generating all minimal frequent VULS using Algorithm 9, with max= 3, is given in Figure 5.12. The input to the Worked example is again the training graph presented in Figure 5.2. On the first iteration where K=1 (second row in Figure 5.12), two one-edge candidate VULS were identified: h 0, 1, , green, i and h 0, 1, , blue, i, For each of these candidates a vertex label list, S0, was generated using the function F(c) → S0. Using the set S0 three vertex labelled candidate VULS were identified: h 0, 1, A, green, A i, h 0, 1, A, green, B i and h 0, 1, B, blue, B i. Meanwhile, threshold σ is calculated using equation 5.1 as 2. h 0, 1, B, blue, B i is a minimal frequent VULS because it has a unique vertex labelling, it does not contain any subgraphs that are themselves VULS and its occurrence count of 3 exceeds the thresholdσ= 2. Then the minimal frequent VULSh0, 1, B, blue, Biwill be removed fromG(G=Gtrain) so that it won’t be extended further. As K is increased to
2 (coverage is not 100% and the max value for K has not been reached), on the second iteration (K=2), one two-edge candidate VULS is generated from the set of non-VULS,
G1, by right most extension. In the same manner as before, for all c ∈G2 the vertex
set of labelled candidate VULS were identified: (h 0, 1, A, green, B i, h 0, 2, A, green, A i), and (h0, 1, A, green, B i,h 0, 2, A, green, Bi).
The threshold σ is calculated as 1. (h 0, 1, , green, i,h 0, 2, , green, i) is not a VULS because it has the same structure but two potential vertex labelings:
(h 0, 1, A, green, Bi,h 0, 2, A, green, Ai), and (h 0, 1, A, green, Bi,h 0, 2, A, green, B i).
and thus it can’t be minimal frequent VULS. We then move on to K=3 (coverage is not yet 100% and the max value has not been reached.) In this case, one three-edge candidate VULS (G3) is generated from the set of non-VULS,G2, by right most extension. Vertex
label lists were again generated as before to giving:
(h 0, 1, A, green, Bi,h 0, 2, A, green, Ai,h0, 3, A, green, B i).
This is a minimal frequent VULS since it does not contain any subgraphs that are themselves VULS and the occurrence count of 1 is greater than or equal to σ = 1. K has reached the specified maximum value ofmax= 3, and thus the algorithm stops. All minimal frequent VULS of size less than or equal to 3 have been identified.
It should be noted that the value for σ is not necessarily the same when mining frequent VULS and minimal frequent VULS, although it is computed using the same equation, as the calculation depends on the occurrence count distribution of the gener- ated candidate subgraphs on each iteration, hence slightly different sets of VULS may be generated and consequently slightly different coverage results obtained with respect to frequent VULS and minimal frequent VULS as will be demonstrated later in Chapter 7.
As in the case of mining minimal VULS, fewer VULS candidates will be generated when mining minimal frequent VULS than when mining the complete set of VULS. Thus mining minimal frequent VULS is likely to be more efficient than when mining the complete set of VULS as will be confirmed by the evaluation presented in Chapters 7 and 8.
5.6
Summary
This chapter has described the theory and operation of four different algorithms for finding the four different identified categories of VULS. The algorithms were as follows:
1. compVULSM for finding the complete set of VULS.
2. minVULSMfor finding minimal VULS.
3. freqVULSM for finding frequent VULS.
4. minFreqVULSM for finding minimal frequent VULS.
In the next chapter, the Backward-Match-Voting algorithm for vertex classification will be presented and illustrated using a work example.
Algorithm for Vertex
Classification
6.1
Introduction
In the previous chapter the generation (mining) of VULS was considered. In this short chapter their utility (in the context of vertex classification) is considered. This chap- ter presents the Backward-Match-Voting algorithm for vertex classification using pre- labelled subgraphs such as the VULS identified using the VULS mining algorithms pre- sented in the previous chapter. A schematic of the vertex classification process is given in Figure 6.1. Similar to the VULS training process presented in the previous chapter, with respect to Figure 6.1, it is again assumed that the new 3D surface data is not in the appropriate graph format (as in the case of the sheet metal forming and satellite image applications) and thus requires translation. Once in the correct grid graph format pre-labelled subgraphs, such as VULS, can be applied to this new graph data so that the labels of the vertices in the new graph can be predicted (labelled).
Figure 6.1: Schematic for predicting vertex labels given a new 3D surface data set.
Using the presented Backward-Match-Voting (BMV) algorithm labels will be at- tached to as many vertices in the new graph as possible. In the case of vertices that
are still unlabelled, a default label can be applied or alternatively the most frequently occurring label that features in the pre-labelled subgraphs used for training purposes can be used. The BMV algorithm is intended for application using collections of iden- tified VULS, but this does not have to be the case, it can be used with respect to other subgraph collections.
The rest of this chapter is organized as follows. The BMV algorithm for vertex label classification (prediction) is presented in Section 6.2. A Working Example illustrating how the BMV algorithm operates is presented in Section 6.3. Section 6.4 then concludes the chapter with a brief summary.