13.07.2015 Views

TOPOLOGICAL OPTIMIZATION OF THE EVALUATION ... - BearSpace

TOPOLOGICAL OPTIMIZATION OF THE EVALUATION ... - BearSpace

TOPOLOGICAL OPTIMIZATION OF THE EVALUATION ... - BearSpace

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

14 R. C. KIRBY AND A. LOGG AND L. R. SCOTT AND A. R. TERRELof vectors that have that entry in that position. This is presented in Algorithm 2, inwhich y i j denotes the jth entry of y i .Algorithm 2 Mapping unique entries at each position to vectors containing themfor all 1 ≤ i ≤ d doH i an empty table mapping numbers to sets of vector labels from {i} n i=1end forfor all 1 ≤ i ≤ n dofor all 1 ≤ j ≤ m doif yj i is a key of H j thenH j [yj i] ← H j[yj i] ∪ {i}elseend ifend forend forH j [yj i ] := {i}This process runs in expected O(nm) time. From these tables, we can constructa table that gives the Hamming distance between any two vectors, as seen in Algorithm3. This algorithm counts down from d each time it discovers an entry that twovectors share. Our algorithm reflects the symmetry of the Hamming distance.Algorithm 3 Computing Hamming distances efficientlyD an empty tablefor all 1 ≤ i ≤ n doD[i] an empty tableend forfor all 1 ≤ i ≤ m dofor all a in the keys of H i dofor all unique combinations k, l of labels in H i [a] doα := min(k, l), β := max(k, l)if D[α] has a key β thenD[α][β] ← D[α][β] − 1elseD[α][β] := m − 1end ifend forend forend forOn output, for 1 ≤ i < j ≤ n, if D[i][j] has no entry, the distance between v iand v j is m. Otherwise, the table contains the Hamming distance between the twovectors.Regarding complexity, there is a double loop over the entries of each H i . Hence,the algorithm is quadratic in the maximum number of vectors that share the sameentry at the same location. Presumably, this is considerably less than n on most datasets.5.2. Using a sparse graph. If we create a graph (Y, Ẽ) with significantly feweredges than (Y, E), we may be able to get most of the reduction in operation count

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!