A lab course on dynamic programming