How? That is an algorithm for a completely different problem, which is not obviously reducible to this one.