|
Algorithm 3 SFDM2
|
-
Input:
Stream , distance metric d, parameter , size constraints ()
-
Output:
A set s.t. ,
-
▹
Stream processing
-
1:
-
2:
Initialize for every and
-
3:
for all do
-
4:
for all and do
-
5:
Run Lines 3–6 of Algorithm 1 to update w.r.t. x
-
6:
if then
-
7:
Run Lines 3–6 of Algorithm 1 to update w.r.t. x
-
▹
Post-processing
-
8:
-
9:
for all do
-
10:
For each group , pick elements arbitrarily from as
-
11:
Let and
-
12:
Create l clusters , each of which contains one element in
-
13:
while there exist s.t. for some and do
-
14:
Merge into a new cluster
-
15:
-
16:
Let and be two matroids, where iff , and iff ,
-
17:
Run Algorithm 4 to augment such that is a maximum cardinality set in
-
18:
return
|