algorithms for optimization problems