The solution we obtain from the NNLS solver has two
drawbacks: (i) it does not incorporate the constraint of having
at most p labels, and (ii) most importantly, it does not have
a clear interpretation as a set X, since the variables xi may
take any non-negative value, not only 0–1. We address both of
these problems with a greedy post-processing of the fractional
solution: We first sort the variables xi
in decreasing order,
breaking ties arbitrarily. We then obtain a set Xq by setting
the first q variables xi
to 1 and the rest to 0. We vary q from 1
to p. Out of the p different sets Xq that we obtain this way, we
select the one that minimizes the cost d(Xq, {hSj , zj i}), and
return this as the solution to the JACCARD-TRIANGULATION
problem.