Vous êtes sur la page 1sur 135

Instructions

Computer

Buttons and User Defined functions are linked to the Add-in with which they are created.
This causes problems when opening a file created in one computer in a second computer.
When opening a file with links, a dialog may appear asking whether links are to be reestablished.
Always
to this
question.
When opening
a file answer
that hasno
been
created
on a different computer, always have the
appropriate Add-in installed using the Add-in Command under the Tools menu or the
OR_MM Control dialog.
When an add-in is installed, the OR_MM menu item is placed on the Standard toolbar and
the commands unique to the add-in are placed on the OR_MM menu. Select items from this
menu to initiate the add-in procedures.
For worksheets with buttons, we have included a Relink Buttons command. This command
creates new buttons linked to the resident Add-in. If buttons don't work correctly, choose
the
Relink Buttons
command.
For worksheets
with
user defined functions, functions already on the worksheet must be
linked to the Add-in for the new computer. Be sure the add-in that provides these functions
is installed.
If user defined functions are not working, select the Links command on the Edit menu.
Select the Update Source command. Browse to find the Add-in to which the functions are to
be linked. Pressing the Change button causes the function commands to be update

Dynamic Programming Models


12.1

12.3

12.4

Add-ins Used
Teach DP-Knapsack
Teach DP-Knapsack

Resource Allocation Problems


Example 1 Binary Knapsack Problem with weight limitation
Example 2 Binary Knapsack with Two Constraints
Example 3 Personnel Assignment Problem

BinKnap
BinKnap2
Personnel
Line1
Expansion
Inventory
UnBndKnap

An Investment Example
Investment Example with graphics
Detailed output of state space for the investment example

Invest
Invest_Details

Teach DP-BinKnapsack
Teach DP-BinKnapsack
Teach DP-General

Line Partitioning Problems


Example
Example
Example
Example

4
5
6
7

- Line Partitioning
Capacity Expansion
Production scheduling
Unbounded Knapsack

Teach
Teach
Teach
Teach

Page 1

DP-Line
DP-Line
DP-Line
DP-UnbKnapsack

Instructions

12.5

12.6
Seq4
TSP

Path Problems
Example 8 Grid Problem
Example 9 Grid Problem with Turn Penalties
Example illustrating the Network data format

Grid
Grid_T
Network

Teach DP-Grid
Teach DP-Grid
Teach DP-Network

Sequencing Problems
Example 10 Job Sequencing with Tardiness Penalties
Example 11 Traveling Salesman Problem

Page 2

Teach DP-Sequence
Teach DP-TSP

Instructions

The name after the hyphen indicates the model type


ch DP-Knapsack
ch DP-Knapsack

ch DP-BinKnapsack
ch DP-BinKnapsack
ch DP-General

ch DP-UnbKnapsack

Page 3

Instructions

ch DP-Network

ch DP-Sequence

Page 4

Teach Dynamic Prog

Name: Invest
Type:Knapsack
State Var.:
2
Decision Var.:
1
Goal: Max
Option: Run
States/Stop: 100

Solve

Strategy
Generation: Forward
Recursion:Backward
Recovery: Forward
Output:Decisions
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

2
1

Definitions
s1: Index of the item
s2: Amount used of resource 1
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

1
Decision
Feas.
Min
Max
Step
2
5

2
1
0
4
1
5
1

Definitions
d1: Number to bring
Forward Transition Equations
Specify the forward transition equations.
State
Decision

1
2
1

Next State

2
2

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State
Decision

1
2

Next State

Backward Recursive Eq. Decision Objective


f(s)
19.5
Z(s , d, sn)
5.8

f(sn)

13.7

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
0
1

2
1
1
1
1
1
1
1

0
1
0
0
1
1
1

Value
1
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
11

2
1
0
9
9
1
1
11

0
1
0
10
1
11
1

Value
0
5

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
0
88

2
2
1
2
9
1
8
11

2
1
0
10
1
11
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

1
2

Formulas for State Variable Names

S(1):
S(2):

Stage 1:

Formulas for Decision Variable Names


D(1):
###
Action

###

Optimum Solution by Forward Recovery


State
Decision
Index
1
2
1
Value Action
1
1
0
2
22.3 Stage 1:
2
2
2
1
16.5 Stage 2:
3
3
3
1
14.7 Stage 3:
4
4
4
2
13.2 Stage 4:
5
5
6
1
9.4
Stage 5:
6
6
7
2
8.1
Stage 6:
7
7
9
1
2.2
Stage 7:
8
8
10
0
0
Stage 8:
9
9
10
-0
Final
The decisions leave the states.

Bring
Bring
Bring
Bring
Bring
Bring
Bring
Bring

2
1
1
2
1
2
1
0

of
of
of
of
of
of
of
of

Item
Item
Item
Item
Item
Item
Item
Item

1
2
3
4
5
6
7
8

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

81
90
3
4
2
1
10

seconds
seconds
seconds
seconds
seconds

Item Benefits
1
2
0
0
0
1
4.1
1.8
2
5.8
3
3
6.5
3.9
4
6.8
4.5
Maximum
4
4
Resources
Max.
1
10

Required per unit


1
2
1
1

0
1.5
2.5
3.3
3.8
4

0
2.2
3.8
4.8
5.5
4

4
1

0
1.3
2.4
3.2
3.9
4

5
1

0
4.2
5.9
6.6
6.8
4

6
1

0
2.2
3.5
4.2
4.6
4

7
1

8
0
1
1.7
2.3
2.8
4

8
1

Slack Value
0.5

State S(1) S(2) Value D(1)


1
1
0 22.3
2
2
2
0
19
2
3
2
1 17.8
1
4
2
2 16.5
1
5
2
3 15.2
1
6
2
4 13.7
1
7
3
0 18.1
1
8
3
1 17.1
1
9
3
2
16
1
10
3
3 14.7
1
11
3
4 13.4
1
12
3
5 11.9
0
13
3
6 10.3
0
14
3
7
8.6
0
15
3
8
6.4
0
16
4
0 17.6
3
17
4
1 16.6
2
18
4
2 15.6
2
19
4
3 14.5
2
20
4
4 13.2
2
21
4
5 11.9
2
22
4
6 10.3
1
23
4
7
8.6
1
24
4
8
6.4
0
25
4
9
4.2
0
26
4
10
0
0
27
5
0
15
3
28
5
1 14.3
3
29
5
2 13.6
3
30
5
3 12.8
2
31
5
4 11.8
2
32
5
5 10.7
1
33
5
6
9.4
1
34
5
7
8.1
0
35
5
8
6.4
0
36
5
9
4.2
0
37
5
10
0
0
38
6
0 13.6
3
39
6
1 13.1
3
40
6
2 12.5
3
41
6
3 11.8
2
42
6
4 11.1
3
43
6
5 10.4
2
44
6
6
9.4
2
45
6
7
8.1
2
46
6
8
6.4
1
47
6
9
4.2
1
48
6
10
0
0
49
7
0
8.5
3

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

7
7
7
7
7
7
7
7
7
7
8
8
8
8
8
8
8
8
8
8
8
9
9
9
9
9
9
9
9
9
9
9

1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10

8
7.5
7
6.5
5.9
5.2
4.5
3.5
2.2
0
5.8
5.3
4.8
4.3
3.8
3.3
2.8
2.3
1.7
1
0
5
4.5
4
3.5
3
2.5
2
1.5
1
0.5
0

3
3
3
3
3
2
2
2
1
0
3
3
3
3
3
3
3
3
2
1
0
***
***
***
***
***
***
***
***
***
***
***

Teach Dynamic Prog

Name: BinKnap
Type:
BinKnapsack
State Var.:
2
Decision Var.:
1
Goal: Max
Option: Run
States/Stop: 100

Solve

Strategy
Generation:Exhaustive
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

2
1

Definitions
s1: Index of the item
s2: Amount used of resource 1
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

1
Decision
Feas.
Min
Max
Step
0
2

0
1
0
1
1
2
1

Definitions
d1: Number to bring
Forward Transition Equations
Specify the forward transition equations.
State
Decision

1
0
1

Next State

2
2

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State
Decision

1
0

Next State

Backward Recursive Eq. Decision Objective


f(s)
47.7
Z(s , d, sn)
0

f(sn)

47.7

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
0
1

2
1
1
1
1
1
1
1

0
1
0
0
1
1
1

Value
1
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
31

2
1
0
16
16
1
1
31

0
1
0
30
1
31
1

Value
0
0

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
464
465

2
2
1
2
16
1
15
31

0
1
0
30
1
31
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

1
0

Formulas for State Variable Names

S(1):
S(2):

Stage 1:

Formulas for Decision Variable Names


D(1):
###
Action

###

Optimum Solution by Forward Recovery


State
Decision
Index
1
2
1
Value Action
1
1
0
0
57
Stage 1: Bring 0 of Item 1
2
2
0
0
57
Stage 2: Bring 0 of Item 2
3
3
0
0
57
Stage 3: Bring 0 of Item 3
4
4
0
0
57
Stage 4: Bring 0 of Item 4
5
5
0
0
57
Stage 5: Bring 0 of Item 5
6
6
0
0
57
Stage 6: Bring 0 of Item 6
7
7
0
0
57
Stage 7: Bring 0 of Item 7
8
8
0
0
57
Stage 8: Bring 0 of Item 8
9
9
0
0
57
Stage 9: Bring 0 of Item 9
10
10
0
1
57
Stage 10: Bring 1 of Item 10
11
11
14
0
32
Stage 11: Bring 0 of Item 11
12
12
14
1
32
Stage 12: Bring 1 of Item 12
13
13
30
0
0
Stage 13: Bring 0 of Item 13
14
14
30
0
0
Stage 14: Bring 0 of Item 14
15
15
30
0
0
Stage 15: Bring 0 of Item 15
16
16
30
-0
Final
The decisions leave the states.

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

466
482
3
13
2
0
18

seconds
seconds
seconds
seconds
seconds

Items
1
Benefit
8
Maximum
1

2
9.5
1

Resources
Max.
1
30

Required per unit


1
2
5
6

3
11.5
1

4
12.8
1

5
14.1
1

6
18.6
1

7
19.8
1

10

11

8
22.4
1

9
23.6
1

10

10

12

13

25
1

14

11
29.1
1

12

11

12
15

13
32
1

33
1

13
16

17

14
34.6
1

15
37.2
1

14

15
18

19

Slack Value
0

Teach Dynamic Prog

Name:BinKnap2
Type:
BinKnapsack
State Var.:
3
Decision Var.:
1
Goal: Max
Option: Run
States/Stop: 100

Solve

Strategy
Generation: Forward
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

2
1

3
0

Definitions
s1: Index of the item
s2: Amount used of resource 1
s3: Amount used of resource 2
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

1
Decision
Feas.
Min
Max
Step
0
2

0
1
0
1
1
2
1

Definitions
d1: Number to bring
Forward Transition Equations
Specify the forward transition equations.
State
Decision

1
0
1

Next State

2
2

3
0

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State

Decision
Next State

0
2

Backward Recursive Eq. Decision Objective


f(s)
43.6
Z(s , d, sn)
0

f(sn)

43.6

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
0
1

2
1
1
1
1
1
1
1

3
0
1
0
0
1
1
1

0
1
0
0
1
1
1

Value
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
961

1
0
16
16
1
1
961

3
0
1
0
30
1
31
31

0
1
0
30
1
31
1

Value
0
0

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
0
14415

2
1
2
16
1
15
961

3
0
1
0
30
1
31
31

0
1
0
30
1
31
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

1
0

Formulas for State Variable Names


S(1):
Stage 1:
S(2):
S(3):
Formulas for Decision Variable Names
D(1):
###
Action

###

Optimum Solution by Forward Recovery


State
Decision
Index
1
2
3
1
Value
1
1
0
0
0
55.8
2
2
0
0
0
55.8
3
3
0
0
0
55.8
4
4
0
0
0
55.8
5
5
0
0
0
55.8
6
6
0
0
1
55.8
7
7
10
10
0
37.2
8
8
10
10
0
37.2
9
9
10
10
0
37.2
10
10
10
10
0
37.2
11
11
10
10
0
37.2
12
12
10
10
0
37.2
13
13
10
10
0
37.2
14
14
10
10
0
37.2
15
15
10
10
1
37.2
16
16
29
30
-0
The decisions leave the states.

Action
Stage 1: Bring 0 of Item 1
Stage 2: Bring 0 of Item 2
Stage 3: Bring 0 of Item 3
Stage 4: Bring 0 of Item 4
Stage 5: Bring 0 of Item 5
Stage 6: Bring 1 of Item 6
Stage 7: Bring 0 of Item 7
Stage 8: Bring 0 of Item 8
Stage 9: Bring 0 of Item 9
Stage 10: Bring 0 of Item 10
Stage 11: Bring 0 of Item 11
Stage 12: Bring 0 of Item 12
Stage 13: Bring 0 of Item 13
Stage 14: Bring 0 of Item 14
Stage 15: Bring 1 of Item 15
Final

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

729
1064
18
24
2
0
44

seconds
seconds
seconds
seconds
seconds

Items
1
Benefit
8
Maximum
1
Resources
Max.
1
30
2
30

2
9.5
1

Required per unit


1
2
5
6
5
6

3
11.5
1

4
12.8
1

5
14.1
1

6
18.6
1

7
7

8
11

9
9

10
10

7
19.8
1

8
22.4
1

9
23.6
1

10

10

11
15

12
16

13
14

25
1

14
14

11
29.1
1

12

11

12
15
18

13
32
1

33
1

13
16
19

17
19

14
34.6
1

15
37.2
1

14

15
18
22

19
20

1
2

Slack Value
0
0

Slack Value

Teach Dynamic Prog

Name:Personnel
Type: Gen
State Var.:
3
Decision Var.:
2
Goal: Min
Option: Run
States/Stop: 100

Solve

Strategy
Generation: Forward
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

2
1

3
3

Definitions
s1: State 1
s2: State 2
s3: State 3
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

1
1

Decision
Feas.
Min
Max
Step
6
9

2
2
1
0
2
1
3
3

0
1
0
2
1
3
1

Definitions
d1: Decision 1
d2: Decision 2
Forward Transition Equations
Specify the forward transition equations.
State
Decision

1
2
1

Next State

3
0
2

3
1

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).

State
Decision
Next State

1
2
2

3
0
1

3
3

Backward Recursive Eq. Decision Objective


f(s)
176
Z(s , d, sn)
21

f(sn)

155

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
0
1

2
1
1
1
1
1
1
1

3
3
1
3
3
1
1
1

3
1
3
3
1
1
1

Value
1
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
16

2
1
0
5
5
1
1
16

3
3
1
0
3
1
4
4

3
1
0
3
1
4
1

Value
0
0

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
0
64

2
2
1
2
5
1
4
16

3
1
1
0
3
1
4
4

3
1
0
3
1
4
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

1
2

3
0

Formulas for State Variable Names


S(1):
Job A
S(2):
S(3):
Formulas for Decision Variable Names
D(1): : Use 2 ME,
D(2): Use 0 EE.
Action

Job A: Use 2 ME, Use 0 EE.

Optimum Solution by Forward Recovery


State
Decision
Index
1
2
3
1
1
1
3
3
2
2
2
1
3
1
3
3
0
2
0
4
4
0
0
0
5
5
0
0
-The decisions leave the states.

2
0
1
2
0
--

Value
140
119
99
75
0

Action
Job A: Use 2 ME, Use 0 EE.
Job B: Use 1 ME, Use 1 EE.
Job C: Use 0 ME, Use 2 EE.
Job D: Use 0 ME, Use 0 EE.
Final

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

58
79
3
5
1
0
9

seconds
seconds
seconds
seconds
seconds
ME

Job A
EE

0
1
2

45
47
21

0
1
2

0
9999
9999
27

49
15
9999

2
30
9999
9999

ME
Job B
EE

1
73
20
9999

2
15
9999
9999

ME

Job C
EE

0
1
2

1
60
78
54

52
9999
9999

2
24
9999
9999

ME
Job D
EE

0
1
2

1
75
61
80

70
57
9999

2
57
9999
9999

ME, Use 0 EE.


ME, Use 1 EE.
ME, Use 2 EE.
ME, Use 0 EE.

Teach Dynamic Prog

Name: Line1
Type: Line
State Var.:
1
Decision Var.:
1
Goal: Min
Option: Run
States/Stop: 100

Solve

Strategy
Generation: Exhaustive
Recursion: Backward
Recovery: Forward
Output:
None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

Definitions
s1: Node number
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

3
1

Decision
Feas.
Min
Max
Step
2
7

3
1
1
7
1
7
1

Definitions
d1: Segment length
Forward Transition Equations
Specify the forward transition equations.
State
Decision

3
3
1

Next State

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State
Decision
Next State

3
3
6

Fixed Cost

10

Backward Recursive Eq. Decision Objective


f(s)
19
Z(s , d, sn)
19

f(sn)

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
0
1

3
0
0
0
1
1
1

Value
0
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
1

3
0
10
10
1
1
1

Value
0

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
9
10

6
1
1
10
1
10
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

3
3
Formulas for State Variable Names

S(1):

Segment 4:

Formulas for Decision Variable Names


D(1): length = 3
Action

Segment 4: length = 3

Optimum Solution by Forward Recovery


State Decision
Index
1
1
Value Action
1
0
3
64
Segment 1: length = 3
2
3
3
45
Segment 4: length = 3
3
6
4
26
Segment 7: length = 4
4
10
-0
Final
The decisions leave the states.

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

11
11
0
1
1
0
2

seconds
seconds
seconds
seconds
seconds

Teach Dynamic Prog

Name:Expansion
Type: Line
State Var.:
1
Decision Var.:
1
Goal: Min
Option: Run
States/Stop: 100

Solve

Strategy
Generation:Exhaustive
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

Definitions
s1: Node number
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

3
1

Decision
Feas.
Min
Max
Step
3
10

4
1
1
10
1
10
1

Definitions
d1: Segment length
Forward Transition Equations
Specify the forward transition equations.
State
Decision

3
4
1

Next State

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State
Decision
Next State

3
4
7

Backward Recursive Eq. Decision Objective


f(s) 20.732
Z(s , d, sn) 20.732

f(sn)

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
0
1

3
0
0
0
1
1
1

Value
0
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
1

3
0
20
20
1
1
1

Value
0

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
19
20

7
1
1
20
1
20
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

3
4
Formulas for State Variable Names

S(1):

Time 3:

Formulas for Decision Variable Names


D(1): Size 4
Action

Time 3: Size 4

Optimum Solution by Forward Recovery


State Decision
Index
1
1
Value Action
1
0
6
83.73 Time 0: Size 6
2
6
6
49.73 Time 6: Size 6
3
12
4
24.359 Time 12: Size 4
4
16
4
10.995 Time 16: Size 4
5
20
-0
Final
The decisions leave the states.

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time
Interest

1
2
3
4
5
6
7
8
9
10

21
21
4
1
1
0
6

seconds
seconds
seconds
seconds
seconds

5%
Line Data
15
16
19
24
30
34
39
45
49
54

1
Facility Cost

2
15

3
16

4
19

5
24

30

7
34

8
39

9
45

10
49

54

Teach Dynamic Prog

Name:Inventory
Type: Line
State Var.:
1
Decision Var.:
1
Goal: Min
Option: Run
States/Stop: 100

Solve

Strategy
Generation:Exhaustive
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

Definitions
s1: Production Time
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

0
1

Decision
Feas.
Min
Max
Step
5
10

6
1
1
10
1
10
1

Definitions
d1: Time covered
Forward Transition Equations
Specify the forward transition equations.
State
Decision

0
6
1

Next State

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State
Decision
Next State

0
6
6

= INDEX(Inventory_Data, $C$47,
$C$46+1)

Backward Recursive Eq. Decision Objective


f(s)
555
Z(s , d, sn)
107

f(sn)

448

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
0
1

0
1
0
0
1
1
1

Value
1
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
1

0
0
20
20
1
1
1

Value
0

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
19
20

6
1
1
20
1
20
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

0
6
Formulas for State Variable Names

S(1):

Time 0:

Formulas for Decision Variable Names


D(1): Interval 6
Action

Time 0: Interval 6

Optimum Solution by Forward Recovery


State Decision
Index
1
1
Value Action
1
0
6
555 Time 0: Interval 6
2
6
4
448 Time 6: Interval 4
3
10
3
344 Time 10: Interval 3
4
13
3
252 Time 13: Interval 3
5
16
4
157 Time 16: Interval 4
6
20
-0
Final
The decisions leave the states.

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

Fixed
Variable
Inventory

asible decisions.

Line Data
Starting Node
Segment 0
1
30
1
42
34
4
2
47
69
1
3
89
69
4
89
69
5
89
85
6
107
157
7
187
177
8
209
210
9
245
234
10
271
351
Period
Demand

21
21
0
2
1
0
3

seconds
seconds
seconds
seconds
seconds

58
58
58
72
136
154
184
206
314
366

30
30
42
98
114
141
161
260
308
321

30
40
88
102
126
144
234
278
290
394

38
78
90
111
127
208
248
259
355
394

62
72
90
104
176
212
222
310
346
385

38
53
65
128
160
169
249
282
318
422

2
1

3
7

4
0

5
0

6
2

7
8

0
0

1
3

Example
Decision State
0
6
6
4
10
3
13
3
16
4
20

Prod.
13
15
14
14
24

Inv
Cost
25
107
14
104
6
92
9
95
31
157

80

555

Period
Demand

1
3

2
1

3
7

4
0

5
0

6
2

7
8

8
2

Period
Demand

11
9

12
4

13
1

14
8

15
3

16
3

17
8

18
6

10

11

12

13

14

15

16

17

18

42
52
106
134
142
214
244
277
373
451

38
83
107
114
178
205
235
323
395
460

66
86
92
148
172
199
279
345
405
470

46
51
99
120
144
216
276
331
391
x

34
74
92
113
177
231
281
336
x
x

62
77
95
151
199
244
294
x
x
x

42
57
105
147
187
232
x
x
x
x

42
82
118
153
193
x
x
x
x
x

62
92
122
157
x
x
x
x
x
x

54
79
109
x
x
x
x
x
x
x

50
75
x
x
x
x
x
x
x
x

8
2

9
3

10
2

11
9

12
4

13
1

14
8

15
3

16
3

17
8

18
6

9
3

10
2

19
5

20
5

19
50
x
x
x
x
x
x
x
x
x
19
5

20
5

24

Teach Dynamic Prog

Name: UnbndKnap
Type: UnbKnapsack
State Var.:
1
Decision Var.:
1
Goal:
Max
Option:
Run
States/Stop:
100

Solve

Strategy
Generation: Forward
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

Definitions
s1: State 1: Amount Used of resource 0
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

0
1

Decision
Feas.
Min
Max
Step
4
11

4
1
0
10
1
11
1

Definitions
d1: Index to bring
Forward Transition Equations
Specify the forward transition equations.
State
Decision

0
4
1

Next State

12

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State
Decision
Next State

0
4
12

Resource Left
35
Backward Recursive Eq.
Decision Objective
f(s)
49.4
Z(s , d, sn)
14.8

f(sn)

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
0
1

0
1
0
0
1
1
1

Value
1
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
1

0
0
35
35
1
1
1

Value
0

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
0
36

12
1
0
35
1
36
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

0
4
Formulas for State Variable Names

34.6

S(1):
Formulas for Decision Variable Names
D(1): Bring 4
Action

Bring 4

Optimum Solution by Forward Recovery


State Decision
Index
1
1
Value Action
1
0
4
42.7 Bring 4
2
12
4
27.9 Bring 4
3
24
5
13.1 Bring 5
4
35
-0
Final
The decisions leave the states.

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

31
31
3
3
1
0
7

Items
1
Benefit
18

2
16.6

Resources
Max.
1
35

seconds
seconds
seconds
seconds
seconds

Required per unit


1
2
15
14

3
15

3
13

4
14.8

5
13.1

6
11.3

7
10.5

8
8.6

12

11

10

9
6.7

10
5.2

10
7

Slack Value
0

Teach Dynamic Prog

Name:
Type:
State Var.:
Decision Var.:
Goal:
Option:
States/Stop:

Solve

Grid
Grid
2
1
Min
Run
100

Strategy
Generation:Exhaustive
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

2
1

Definitions
s1: x1
s2: x2
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

1
Decision
Feas.
Min
Max
Step
0
2

0
1
0
1
1
2
1

Definitions
d1: Next Direction
Forward Transition Equations
Specify the forward transition equations.
State
Decision

1
0
1

Next State

2
1

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State
Decision

1
0

Next State

Backward Recursive Eq. Decision Objective


f(s)
9
Z(s , d, sn)
0

f(sn)

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
0
1

2
1
1
1
1
1
1
1

1
1
1
1
1
1
1

Value
1
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
1

2
1
0
10
10
1
1
1

1
0
10
10
1
1
1

Value
0
0

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
99
100

2
1
1
1
10
1
10
10

2
1
1
10
1
10
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

1
0

Formulas for State Variable Names

S(1):
S(2):

x(1
,1):

Formulas for Decision Variable Names


D(1): Go Up
Action

x(1,1):Go Up

Optimum Solution by Forward Recovery


State
Decision
Index
1
2
1
Value Action
1
1
1
0
9
x(1,1):Go Up
2
1
2
1
9
x(1,2):Go Right
3
2
2
0
8
x(2,2):Go Up
4
2
3
1
8
x(2,3):Go Right
5
3
3
0
7
x(3,3):Go Up
6
3
4
1
7
x(3,4):Go Right
7
4
4
0
6
x(4,4):Go Up
8
4
5
1
6
x(4,5):Go Right
9
5
5
0
5
x(5,5):Go Up
10
5
6
1
5
x(5,6):Go Right
11
6
6
0
4
x(6,6):Go Up
12
6
7
1
4
x(6,7):Go Right
13
7
7
0
3
x(7,7):Go Up
14
7
8
1
3
x(7,8):Go Right
15
8
8
0
2
x(8,8):Go Up
16
8
9
1
2
x(8,9):Go Right
17
9
9
0
1
x(9,9):Go Up
18
9
10
1
1
x(9,10):Go Right
19
10
10
-0
Final
The decisions leave the states.

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

10
9
8
7
6
5
4
3
2
1

9
8
7
6
5
4
3
2
1

100
110
1
4
2
0
7

seconds
seconds
seconds
seconds
seconds

Right Lengths
9
8
8
7
7
6
6
5
5
4
4
3
3
2
2
1
1
0
0
1
1
2

7
6
5
4
3
2
1
0
1
2
3

6
5
4
3
2
1
0
1
2
3
4

5
4
3
2
1
0
1
2
3
4
5

4
3
2
1
0
1
2
3
4
5
6

3
2
1
0
1
2
3
4
5
6
7

2
1
0
1
2
3
4
5
6
7
8

Up Lengths
8
7
6
5
4
3
2
1
0
1

6
5
4
3
2
1
0
1
2
3

5
4
3
2
1
0
1
2
3
4

4
3
2
1
0
1
2
3
4
5

3
2
1
0
1
2
3
4
5
6

2
1
0
1
2
3
4
5
6
7

1
0
1
2
3
4
5
6
7
8

7
6
5
4
3
2
1
0
1
2

1
0
1
2
3
4
5
6
7
8
9 x1

0
1
2
3
4
5
6
7
8
9

1
2
3
4
5
6
7
8
9
10 x1

Teach Dynamic Prog

Name: Grid_T
Type: Grid
State Var.:
3
Decision Var.:
1
Goal: Min
Option: Run
States/Stop: 100

Solve

Strategy
Generation:Exhaustive
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

2
1

3
1

Definitions
s1: x1
s2: x2
s3: Last Direction
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

1
Decision
Feas.
Min
Max
Step
0
2

0
1
0
1
1
2
1

Definitions
d1: Next Direction
Forward Transition Equations
Specify the forward transition equations.
State
Decision

1
0
1

Next State

2
1

3
2

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State

Decision
Next State

0
1

Backward Recursive Eq. Decision Objective


f(s)
51
Z(s , d, sn)
0

f(sn)

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
1
2

2
1
1
1
1
1
1
2

3
1
1
1
1
1
1
2

0
1
0
1
1
2
1

Value
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
2

2
1
0
10
10
1
1
2

3
1
0
10
10
1
1
2

0
1
0
1
1
2
1

Value
0
0

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
199
200

2
1
1
1
10
1
10
20

3
2
1
1
10
1
10
2

0
1
0
1
1
2
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

1
0

51

Formulas for State Variable Names


S(1):
x(1
S(2):
,1):
S(3):
Formulas for Decision Variable Names
D(1): Go Up
Action

x(1,1):Go Up

Optimum Solution by Forward Recovery


State
Decision
Index
1
2
3
1
Value
1
1
1
0
0
47
2
1
2
0
0
47
3
1
3
0
0
46
4
1
4
0
1
44
5
2
4
1
1
36
6
3
4
1
1
34
7
4
4
1
1
33
8
5
4
1
1
33
9
6
4
1
1
32
10
7
4
1
0
30
11
7
5
0
0
17
12
7
6
0
0
15
13
7
7
0
0
14
14
7
8
0
0
14
15
7
9
0
0
13
16
7
10
0
1
11
17
8
10
1
1
3
18
9
10
1
1
1
19
10
10
1
-0
The decisions leave the states.

Action
x(1,1):Go Up
x(1,2):Go Up
x(1,3):Go Up
x(1,4):Right Turn: Go Right
x(2,4):Go Right
x(3,4):Go Right
x(4,4):Go Right
x(5,4):Go Right
x(6,4):Go Right
x(7,4):Left Turn: Go Up
x(7,5):Go Up
x(7,6):Go Up
x(7,7):Go Up
x(7,8):Go Up
x(7,9):Go Up
x(7,10):Right Turn: Go Right
x(8,10):Go Right
x(9,10):Go Right
Final

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

200
310
2
8
3
0
13

seconds
seconds
seconds
seconds
seconds

Turn penalties
Right:
5
Left:
10

10
9
8
7
6
5
4
3
2
1

9
8
7
6
5
4
3
2
1

Right Lengths
9
8
8
7
7
6
6
5
5
4
4
3
3
2
2
1
1
0
0
1
1
2

7
6
5
4
3
2
1
0
1
2
3

6
5
4
3
2
1
0
1
2
3
4

5
4
3
2
1
0
1
2
3
4
5

4
3
2
1
0
1
2
3
4
5
6

3
2
1
0
1
2
3
4
5
6
7

Up Lengths
8
7
6
5
4
3
2
1
0
1

6
5
4
3
2
1
0
1
2
3

5
4
3
2
1
0
1
2
3
4

4
3
2
1
0
1
2
3
4
5

3
2
1
0
1
2
3
4
5
6

2
1
0
1
2
3
4
5
6
7

7
6
5
4
3
2
1
0
1
2

2
1
0
1
2
3
4
5
6
7
8

1
0
1
2
3
4
5
6
7
8
9 x1

1
0
1
2
3
4
5
6
7
8

0
1
2
3
4
5
6
7
8
9

1
2
3
4
5
6
7
8
9
10 x1

Teach Dynamic Prog

Name: Network
Type: Network
State Var.:
1
Decision Var.:
1
Goal: Min
Option: Run
States/Stop: 100

Solve

Strategy
Generation:Exhaustive
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

Definitions
s1: Node Number
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

1
1

Decision
Feas.
Min
Max
Step
0
1

1
1
1
1
1
1
1

Definitions
d1: Arc Number
Forward Transition Equations
Specify the forward transition equations.
State
Decision

1
1
1

Next State

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State
Decision
Next State

1
1
2

Backward Recursive Eq. Decision Objective


f(s)
22
Z(s , d, sn)
8

f(sn)

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
0
1

1
1
1
1
1
1
1

Value
1
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
1

1
0
10
10
1
1
1

Value
0

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
9
10

2
1
1
10
1
10
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

1
1
Formulas for State Variable Names

14

S(1):

Node 1:

Formulas for Decision Variable Names


D(1): Arc 1
Action

Node 1: Arc 1

Optimum Solution by Forward Recovery


State Decision
Index
1
1
Value Action
1
1
1
22
Node 1: Arc
2
2
2
14
Node 2: Arc
3
3
3
8
Node 3: Arc
4
4
5
2
Node 4: Arc
5
6
10
1
Node 6: Arc
6
10
-0
Final
The decisions leave the states.

1
2
3
5
10

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

Arc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Network Data
Arc Data
From
To
1
2
2
3
3
4
4
5
4
6
5
6
5
6
6
7
6
8
6
10
7
8
7
8
7
8
8
9
8
10
8
10
9
10
9
10
9
10
9
10

10
10
1
0
1
0
2

Cost
8
6
6
3
1
4
1
8
1
1
1
1
1
8
1
1
9
1
1
1

seconds
seconds
seconds
seconds
seconds

Node
1
2
3
4
5
6
7
8
9
10

Node Data
Start
End
1
1
2
2
3
3
4
5
6
7
8
10
11
13
14
16
17
20
21
21

Teach Dynamic Prog

Name: Seq4
Type:Sequence
State Var.:
4
Decision Var.:
1
Goal: Min
Option: Run
States/Stop: 100

Solve

Strategy
Generation:Exhaustive
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

2
0

3
0

4
0

Definitions
s1: J1
s2: J2
s3: J3
s4: J4
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

1
Decision
Feas.
Min
Max
Step
2
4

3
1
1
4
1
4
1

Definitions
d1: Next Job
Forward Transition Equations
Specify the forward transition equations.
State
Decision

0
3
1

Next State

2
0

3
0

4
1

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).

State
Decision
Next State

0
3
0

Backward Recursive Eq. Decision Objective


f(s)
2280
Z(s , d, sn)
0
Initial States
Finish:
Specify the logical conditions for tLate:
1
State
Initial
Min
Max
Step
0
1

2
0
1
0
0
1
1
1

3
0
1
0
0
1
1
1

f(sn)

2280

7
0
4

0
1
0
0
1
1
1

0
1
0
0
1
1
1

Value
1
0

0
0
1
1
1
1
1

Value
0
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
1

2
0
0
1
1
1
1
1

3
0
0
1
1
1
1
1

4
0
0
1
1
1
1
1

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
15
16

2
0
1
0
1
1
2
8

3
0
1
0
1
1
2
4

4
1
1
0
1
1
2
2

0
1
0
1
1
2
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

0
3

Formulas for State Variable Names


S(1):
S(2):
S(3):
S(4):
Formulas for Decision Variable Names
D(1): J3
Action

J3

Optimum Solution by Forward Recovery


State
Decision
Index
1
2
3
4
1
Value
1
0
0
0
0
3
860
2
0
0
1
0
1
860
3
1
0
1
0
2
860
4
1
1
1
0
4
420
5
1
1
1
1
-0
The decisions leave the states.

Action
J3
J1
J2
J4
Final

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

16
30
1
1
1
0
3

Job
1
2
3
4
Total

seconds
seconds
seconds
seconds
seconds

Time
5
9
7
10
31

Due
12
10
10
17

Penalty
80
40
100
30

Teach Dynamic Prog

Name:
Type:
State Var.:
Decision Var.:
Goal:
Option:
States/Stop:

Solve

TSP
TSP
9
1
Min
Run
100

Strategy
Generation:Exhaustive
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

2
1

3
0

4
0

5
0

6
0

7
0

8
0

9
0

Definitions
s1: City 1
s2: City 2
s3: City 3
s4: City 4
s5: City 5
s6: City 6
s7: City 7
s8: City 8
s9: Last Visited
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

1
Decision
Feas.
Min
Max
Step
3
7

5
1
2
8
1
7
1

Definitions
d1: Next City
Forward Transition Equations
Specify the forward transition equations.
State
Decision

1
5
1

Next State

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State
Decision
Next State

1
5
1

Backward Recursive Eq. Decision Objective


f(s) 48.212
Z(s , d, sn) 4.5177
Initial States
Specify the logical conditions for t
1
State
Initial
Min
Max
Step
0
1

2
1
1
1
1
1
1
1

x_D:
y_D:
3

0
1
0
0
1
1
1

f(sn) 43.694

0.4
4.5
4

0
1
0
0
1
1
1

5
0
1
0
0
1
1
1

6
0
1
0
0
1
1
1

7
0
1
0
0
1
1
1

8
0
1
0
0
1
1
1

9
0
1
0
0
1
1
1

1
1
1
1
1
1
1

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
7

2
1
1
1
1
1
1
7

3
0
0
1
1
1
1
7

4
0
0
1
1
1
1
7

5
0
0
1
1
1
1
7

6
0
0
1
1
1
1
7

7
0
0
1
1
1
1
7

8
0
0
1
1
1
1
7

9
0
0
1
1
1
1
7

1
0
2
8
1
7
1

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
895
896

1
1
1
1
1
1
896

2
0
1
0
1
1
2
448

3
0
1
0
1
1
2
224

4
0
1
0
1
1
2
112

6
1
1
0
1
1
2
56

7
0
1
0
1
1
2
28

8
0
1
0
1
1
2
14

9
0
1
0
1
1
2
7

5
1
2
8
1
7
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

1
5

Formulas for State Variable Names


S(1):
S(2):
S(3):
S(4):
S(5):
S(6):
S(7):
S(8):
S(9):
C1Formulas for Decision Variable Names
D(1): C5
Action

C1-C5

Optimum Solution by Forward Recovery


State
Index
1
2
3
4
1
1
0
0
0
2
1
0
0
0
3
1
0
0
0
4
1
0
1
0
5
1
1
1
0
6
1
1
1
1
7
1
1
1
1
8
1
1
1
1
The decisions leave the states.

5
0
1
1
1
1
1
1
1

6
0
0
0
0
0
0
0
1

7
0
0
0
0
0
0
1
1

8
0
0
1
1
1
1
1
1

9
1
5
8
3
2
4
7
6

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

449
704
6
49
2
0
57

seconds
seconds
seconds
seconds
seconds

p:
City
1
2
3
4
5
6
7
8

x
7
20
20.6
9
6.6
4.2
4.3
13.9

Value
1
0

Value
0
0
x_D:
y_D:

0
0

Decision
1
Value
5
47.112
8
42.595
3
35.226
2
28.04
4
22.01
7
10.863
6
5.3925
-4.8826

Action
C1-C5
C5-C8
C8-C3
C3-C2
C2-C4
C4-C7
C7-C6
Final

2
y
9.2
9.3
15.3
7.5
13.7
5.2
4.7
12.7

Teach Dynamic Programming

Solve

DP1_Params

Name: DP1
Type:Knapsack
State Var.:
3
Decision Var.:
1
Goal: Max
Option: Run
States/Stop: 100

Strategy
Generation: Forward
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

DP1_Strategy

State Vector
Define the state variables.
1
State

2
6

3
6

DP1_StateVector

Definitions
s1: Index of the item
s2: Amount used of resource 1
s3: Amount used of resource 2
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

DP1_StateDecVector

1
Decision
Feas.
Min
Max
Step
2
3

2
1
0
2
1
3
1

DP1_DecVector
DP1_DecFeas
DP1_DecLogic
DP1_DecMin
DP1_DecMax
DP1_DecStep

DP1_DecInd
Definitions
DP1_DecIndMax
d1: Number to bring
Forward Transition Equations
Specify the forward transition equations.
State
Decision

6
2
1

Next State

2
7

DP1_StateForVector
DP1_DecForVector

DP1_NextStateVector

3
14

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State

DP1_StateObjVector

Decision
Next State

2
7

14

DP1_DecObjVector
DP1_NextStateObjVector

Backward Recursive Eq. Decision Objective


f(s)
43
Z(s , d, sn)
20
DP1_StateValue

f(sn)

DP1_DecValue

23
DP1_NextStateValue

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
0
1

2
6
0
1
1
1
1
1

3
6
0
0
0
1
1
1

1
0
0
0
1
1
1

DP1_StateIniVector
Value
DP1_IniStateValue
0
0
DP1_IniStateFeas
DP1_IniStateLogic
DP1_IniStateMin, Max, and Step
DP1_IniStateInd
DP1_IniStateIndMax

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
216

6
0
11
11
1
1
216

3
6
1
0
23
1
24
9

1
1
0
8
1
9
1

DP1_StateFinVector
Value
0
0
DP1_FinStateValue
DP1_FinStateFeas
DP1_FinStateLogic
DP1_FinStateMin, Max, and Step
DP1_FinStateInd
DP1_FinStateIndMax

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
0
2160

7
1
2
11
1
10
216

3
14
1
0
23
1
24
9

2
1
0
8
1
9
1

DP1_FeasStateVector
DP1_FeasStateFeas
1
DP1_FeasStateLogic
DP1_FeasStateMin, Max, and Step
DP1_FeasStateInd
DP1_FeasStateIndMax

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

6
2

DP1_StateNamVector
DP1_DecNamVector

Formulas for State Variable Names


S(1):
Stage 6:
S(2):
DP1_StateNames
S(3):
Formulas for Decision Variable Names
D(1):
###
DP1_DecNames
Action

###
DP1_Action

Optimum Solution by Forward Recovery


State
Decision
Index
1
2
3
1
Value
1
1
0
0
0
63
2
2
0
0
0
63
3
3
0
0
2
63
4
4
6
1
0
43
5
5
6
1
0
43
6
6
6
1
2
43
7
7
14
2
1
23
8
8
15
3
0
20
9
9
15
3
0
20
10
10
15
3
2
20
11
11
23
4
-0
The decisions leave the states.

Action
Stage 1: Bring 0 of Item 1
Stage 2: Bring 0 of Item 2
Stage 3: Bring 2 of Item 3
Stage 4: Bring 0 of Item 4
Stage 5: Bring 0 of Item 5
Stage 6: Bring 2 of Item 6
Stage 7: Bring 1 of Item 7
Stage 8: Bring 0 of Item 8
Stage 9: Bring 0 of Item 9
Stage 10: Bring 2 of Item 10
Final

DP1_Strategy

Number of States
Number of tree entries
Time to Generate
Time to Optimize
Time to Recover
Time to Show Results
Total Time

496
691
11
15
2
0
28

seconds
seconds
seconds
seconds
seconds

Items
1
Benefit
6
Maximum
2
Resources Required per unit
Max.
1
1
23
3
2
8
1

Obj

38
63

3
10
2

4
10
2

3
6
1

5
3
2

6
7
2

10
2

3
1

2
1

8
1

4
1

2 1.6667 3.3333
0
0
2

1.5
0

0.875
0

2.5
2

NextStateValue

x, and Step

8
3
2

9
6
2

10
4
2

10
2

10

1
1

3
1

4
1

4
1

3
1

2
0

1
0

2.5
2

1
2

Slack Value
0
0

Teach Dynamic Prog

Name: DP_1
Type:Knapsack
State Var.:
3
Decision Var.:
1
Goal: Max
Option: Run
States/Stop: 100

Solve

Strategy
Generation: Forward
Recursion:Backward
Recovery: Forward
Output: None
Graphics:
No
Bounds:
No

State Vector
Define the state variables.
1
State

2
1

3
0

Definitions
s1: Index of the item
s2: Amount used of resource 1
s3: Amount used of resource 2
Decision Vector
Define the elements of the decision vector and the logical conditions for feasible decisions.
State

1
Decision
Feas.
Min
Max
Step
0
3

0
1
0
2
1
3
1

Definitions
d1: Number to bring
Forward Transition Equations
Specify the forward transition equations.
State
Decision

1
0
1

Next State

2
2

3
0

Decision Objective and Recursive Equations


Put formulas in the cells f(s) and Z(s, d, sn).
State

Decision
Next State

0
2

Backward Recursive Eq. Decision Objective


f(s)
0
Z(s , d, sn)
0

f(sn)

Initial States
Specify the logical conditions for the initial states.
1
State
Initial
Min
Max
Step
0
1

2
1
1
1
1
1
1
1

3
0
1
0
0
1
1
1

0
1
0
0
1
1
1

Value
0

Final States
Specify the logical conditions for the final states.
1
State
Final
Min
Max
Step
0
286

1
0
11
11
1
1
286

3
0
1
0
10
1
11
26

0
1
0
25
1
26
1

Value
0
0

State Feasibility
Specify the logical conditions for state feasibility.
1
State
Feas.
Min
Max
Step
0
2860

2
1
2
11
1
10
286

3
0
1
0
10
1
11
26

0
1
0
25
1
26
1

State and Decision Variable Names


Provide formulas that determine names for state and decision variables.
State
Decision

1
0

Formulas for State Variable Names


S(1):
Stage 1:
S(2):
S(3):
Formulas for Decision Variable Names
D(1):
###
Action

###

Items
1
Benefit
8
Maximum
2
Resources Required per unit
Max.
1
1
10
5
2
25
1

3
6
2

4
6
2

3
9
6

5
3
2

4
8
5

6
4
2

5
4
3

8
2

6
10
7

9
7

8
1
2

9
8
2

8
1
3

10
9
2

9
10
3

8
2

10
4
9

6
9

1
2

Slack Value
0
0

Vous aimerez peut-être aussi