dominates algorithm