sparsify and approximate edge weights.