กำหนดการพลวัต ( Dynamic programming )

  • View
    188

  • Download
    0

Embed Size (px)

DESCRIPTION

กำหนดการพลวัต ( Dynamic programming ). Dynamic programming จะเหมาะกับการแก้ปัญหา optimization ตัวอย่างเช่น Longest Common Subsequence. Longest Common Subsequence. X = มี subsequences < H , E , L, L, O >  < H , E >< H , E , L, L, O >  < H , E , O > - PowerPoint PPT Presentation

Text of กำหนดการพลวัต ( Dynamic programming )

Divide & Conquer

(Dynamic programming)1Dynamic programming optimization Longest Common Subsequence2

3

Longest Common SubsequenceX = subsequences Y = Common subsequence(X, Y) longest common subsequence(X, Y) LCS

4 25 = 325

LCS6

7Recurrence L(i,j)

8Recurrence L(i,j)

9Recurrence L(i,j)

10LCS: Top-down11

LCS :

12

LCS: Best case ?

13Top-down + Memoization

14LCS: memoization

15LCS : Bottom-up

16

LCS : Dynamic Programming

17

LCS :

18

19

20

21LCS_Soln(x,y,L)

22

:

23Minimum Edit Distance

24 Dynamic Prog.

25Optimal substructures

26Longest Simple Path

270/1 Knapsack

280/1 Knapsack

29

30

31 :

32 recurrence V(i, j)

33Knapsack : Top-down

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49