Partition algorithm for the dominating set problem