Pseudo-polynomial time algorithms