General Concept of Dynamic Programming