Algorithm to find a minimal dominating set