however , the key in dynamic programming is to determine the structure of optimal solutions .
in general , dynamic programming is used on optimisation problems , where the most efficient solution is needed .