Actually we dont' calculate the variance of all three portfolios, we just measure the variance of the 'gap portfolio'.
A simple example if the optimal was in two instruments (-0.5, 1.5) and the rounded portfolio we were checking was (-1.0, 1.0) then the gap portfolio would be (-0.5, -0.5) and...