Use bit manipulation in bipartition_indices