Statement of the problem of general dynamic programming

I wonder if the objective function of the general dynamic programming task can always be formulated in the same way as in dynamic wiki programming , where the objective function is the sum of objects for actions and states at each stage? Or is this just a specific case and what is the general wording?


EDIT:

By "dynamic programming problem" I mean a problem that can be solved using the dynamic programming method. Such problems have the property of an optimal problem and an optimal structure .

But renting it is sometimes difficult for me to identify such problems, perhaps because I'm not used to this kind of verbal description. When I came across the WIKI page for the Bellman equation, I feel that the mathematical formulation of the cost function will help somehow. I suspect that the overall cost / benefit function can always be represented as the accumulation of costs / profits from all stages? and can accumulation be additive or multiplicative or something else?

When I posted my question, I realized that it’s more appropriate to discuss dynamic programming in some place, more oriented to mathematical optimization. But at Stackoverflow.com there are quite a few discussions of computer algorithms. Therefore, I did not consider it necessary to ask my question here.

+3
3

, ( ). , & beta; t , . , , , F .

, set & beta; 1, . ; ​​, F .

, , , .

+2

, . : :

F (n) = F (n-1) + F (n-2) :

int fibonacci(n):
  if (n < 2): return 1
  else: return fibonacci(n-1) + fibonacci(n-2)

, , , , .

F(8) = F(7) + F(6) = [F(6) + F(5)] + [F(5) + F(4)] = ... 

, , (5) . "memoize" "cache" , :

integer_map store;
int memofibo(n):
  if (n < 2) : return 1
  else if (store.find_key(n)): return store.find_value(n)
  else:
    int f = memofibo(n-1) + memofibo(n-2)
    store.set(n, f)
    return f

, n, n- O (n log n) ( O (log n)) "".

, , , , / ( ), + memoization . , .

+2

,

() -, , .

Soapbox:

, , , , , , . , , - . , OR CS .

( - ), MIT : , , , , , , Bellman-Ford, , , . MIT.

, , , , , .

+1

Source: https://habr.com/ru/post/1732622/


All Articles