Algorithms for solving the conditional covering problem on paths