Sei sulla pagina 1di 29

Instructions

Chapter 6
Operations Research Models and Methods
Paul A. Jensen and Jonathan F. Bard

Network Flow Programming Methods


http://www.me.utexas.edu/~jensen/ORMM/computation/unit/mp_add/index.html
http://www.me.utexas.edu/~jensen/ORMM/methods/unit/network/subunits/teachnet/index.html
http://www.me.utexas.edu/~jensen/ORMM/computation/unit/mp_add/subunits/solver/nfsolver.html

Instructions

Sect.
1

Network Flow Programming Methods


Transportation Problem
Example Problem for the Transportation Algorithm

Example

3
4

Math Programming - Netw


Math Programming - Netw

Maximum Flow Problem


Example for the section

MaxFlow

Add-ins used
Teach Transportation

Shortest Path Problem


Example for the section
Example for the section with length of arc (2, 7) changed to -10

SPT
SPT2

PureNet
PureNet1
PureNet2

To use this workbook, you must first load the Teach Transportation and Teach Network add-ins. See
the Excel help file topic "About add-ins" before continuing.
For cases using the Network Solver you must first load the Math Programming and Jensen Network
Solver add-ins.
This workbook comes without control buttons. To make the buttons choose the Relink Buttons
commands from both the Teach Transportation and Teach Network add-ins. This adds buttons to all the
worksheets. Also choose the Add Buttons command of the Math Programming add-in.

Math Programming - Netw

Pure Minimum Cost Flow


Example with basis nB = {2, 4, 7, 8}, n1 = {5}
Example with basis nB = {2, 3, 5, 6}, n1 = {4,7}
Example with iterations to optimal

Teach Network
Teach Network
Teach Network

Transportation Example with the Teach Transportation add-in


TeachTrans

Example for the section

Teach Transportation

Page 1

Instructions

d-ins used
ach Transportation

th Programming - Network/Network Solver


th Programming - Network/Network Solver

th Programming - Network/Network Solver

ach Network
ach Network
ach Network

ach Transportation

Page 2

Teach Transportation

Name: Example
Enter transportation data and press the button.
Type: TeachTrans
Supplies:
3
No_Sup:
5
Select the Relink Buttons command from the OR_MM menu before clickin
Option: Demo Trans. Cost
1
2
3
4
5
Delay:
1
Name D 1
D2
D3
D4
D 5 Supply
1
S1
15
15
16
11
11
15
2
S2
13
11
15
9
6
15
3
S3
8
12
11
7
8
15
Demand 5
10
15
5
10

Iter:
6
Cost:
475
Status: Optimum
Enter:
Leave:

Press the button to restart the Simplex process.

1
2

Suppliers
3
Key
Cost
Flow

Red. Costmand
N/B
al(v)

1
15
0
13
0
8
5
5

Demanders
2
2
15
0
B
N
5
4
11
0
B
N
5
0
12
2
B
0
N
10
13
15

3
16
5
15
0
11
10
15

0
B

3
N
0
B

16

4
11
5
9
0
7
0
5

0
B

2
N
1
N
11

5
11
0
6
10
8
0
10

1
N
0
B

3
N
10

_MM menu before clicking a button.

Suppl Dual(
0
15
-4
15
-5
15

sup.

dem. type
3
1 D
3
4 D
2
5 D
2
2 S
3
3 S
1
2 D
1
3 D
Flow Change: 5

Seq
1
2
3
4
5
6
7

Delta
0
-1
0
0
1
0
-1

Flow
5
5
10
5
5
5
10

Network Model
1
0
1
1
0
100
100
0
60
1
1
1

Change

Name:
Type:
Goal:
Objective:

SPT
Net
Min
118

Solver:
Type:
Sens.:
Side:

Jensen Network
Linear
No
No

Solve
Vary
Vary
Arc Data and Flows
Num. Name Flow Origin Term.
1
Arc 1
0
1
2
2
Arc 2
8
1
3
3
Arc 3
1
1
4
4
Arc 4
0
2
7
5
Arc 5
0
2
5
6
Arc 6
6
3
6
7
Arc 7
1
3
2
8
Arc 8
0
3
4
9
Arc 9
0
4
6
10
Arc 10
0
5
3
11
Arc 11
2
5
7
12
Arc 12
0
5
6
13
Arc 13
4
6
8
14
Arc 14
1
6
9
15
Arc 15
1
7
10
16
Arc 16
0
7
8
17
Arc 17
3
8
5
18
Arc 18
0
8
10
19
Arc 19
0
9
4
20
Arc 20
0
9
10
21
Arc 21
0
0
1

Cost
40
8
10
10
6
2
4
12
1
2
4
2
4
3
1
20
0
20
6
20
0

Node Data and Balance Cons


Red. Co Num. Name Fixed
28
1
Node 1
9
0
2
Node 2
-1
0
3
Node 3
-1
4
4
Node 4
-1
4
5
Node 5
-1
0
6
Node 6
-1
0
7
Node 7
-1
10
8
Node 8
-1
1
9
Node 9
-1
8
10 Node 10
-1
0
6
0
0
0
24
0
15
9
14
0

en Network

Ph. 1 Iter.
12
Total Iter.
15
Comp. Time 00:01
Status Optimal

Dual Va Basis
and Balance Cons
0
21
Balance
12
7
0
8
2
0
10
3
0
14
17
0
10
6
0
18
11
0
14
13
0
13
14
0
19
15
0
0

Algorithmic Details for problem SPT.


Jensen Network Solution Algorithm
Start Solution
Add Artificial Arcs
Artifical Arc: -26 added to basis tree. Arc goes from 13 to 1.
Artifical Arc: 27 added to basis tree. Arc goes from 13 to 2.
Artifical Arc: 28 added to basis tree. Arc goes from 13 to 3.
Artifical Arc: 29 added to basis tree. Arc goes from 13 to 4.
Artifical Arc: 30 added to basis tree. Arc goes from 13 to 5.
Artifical Arc: 31 added to basis tree. Arc goes from 13 to 6.
Artifical Arc: 32 added to basis tree. Arc goes from 13 to 7.
Artifical Arc: 33 added to basis tree. Arc goes from 13 to 8.
Artifical Arc: 34 added to basis tree. Arc goes from 13 to 9.
Artifical Arc: 35 added to basis tree. Arc goes from 13 to 10.
Artifical Arc: 36 added to basis tree. Arc goes from 13 to 11.
Artifical Arc: 37 added to basis tree. Arc goes from 13 to 12.
Start PHASE_1
Iterations Iter.
Enters
Leaves
Red. Cost Flow Chg
1
1
27
-2
1
2
2
28
-2
1
3
3
29
-2
1
4
4
32
-2
1
5
5
30
-2
1
6
6
31
-2
1
7
13
33
-2
1
8
14
34
-2
1
9
15
-26
-2
1
10
22
36
-1
0
11
25
37
-1
0
12
21
35
-1
0
Start PHASE_2
Iterations Iter.
Enters
Leaves
Red. Cost Flow Chg
13
7
1
-28
4
14
17
5
-4
1
15
11
4
-4
2
Finish
Optimal: z = 118

Select
First
First
First
First
First
First
First
First
First
First
First
First
Select
First
First
First

Network Model
1
0
1
1
0
100
100
0
60
1
1
1

Change

Name: SPT2
Type: Net
Goal: Min
Objective:
86

Solver:
Type:
Sens.:
Side:

Jensen Network
Linear
No
No

Solve
Vary
Vary
Arc Data and Flows
Num. Name Flow Origin Term.
1
Arc 1
0
1
2
2
Arc 2
8
1
3
3
Arc 3
1
1
4
4
Arc 4
2
2
7
5
Arc 5
0
2
5
6
Arc 6
4
3
6
7
Arc 7
3
3
2
8
Arc 8
0
3
4
9
Arc 9
0
4
6
10
Arc 10
0
5
3
11
Arc 11
0
5
7
12
Arc 12
0
5
6
13
Arc 13
2
6
8
14
Arc 14
1
6
9
15
Arc 15
1
7
10
16
Arc 16
0
7
8
17
Arc 17
1
8
5
18
Arc 18
0
8
10
19
Arc 19
0
9
4
20
Arc 20
0
9
10
21
Arc 21
0
0
1

Cost
40
8
10
-10
6
2
4
12
1
2
4
2
4
3
1
20
0
20
6
20
0

Node Data and Balance Cons


Red. Co Num. Name Fixed
28
1
Node 1
9
0
2
Node 2
-1
0
3
Node 3
-1
0
4
Node 4
-1
4
5
Node 5
-1
0
6
Node 6
-1
0
7
Node 7
-1
10
8
Node 8
-1
1
9
Node 9
-1
8
10 Node 10
-1
16
6
0
0
0
8
0
31
9
30
0

en Network

Ph. 1 Iter.
12
Total Iter.
14
Comp. Time 00:01
Status Optimal

Dual Va Basis
and Balance Cons
0
21
Balance
12
7
0
8
2
0
10
3
0
14
17
0
10
6
0
2
4
0
14
13
0
13
14
0
3
15
0
0

Algorithmic Details for problem SPT2.


Jensen Network Solution Algorithm
Start Solution
Add Artificial Arcs
Artifical Arc: -26 added to basis tree. Arc goes from 13 to 1.
Artifical Arc: 27 added to basis tree. Arc goes from 13 to 2.
Artifical Arc: 28 added to basis tree. Arc goes from 13 to 3.
Artifical Arc: 29 added to basis tree. Arc goes from 13 to 4.
Artifical Arc: 30 added to basis tree. Arc goes from 13 to 5.
Artifical Arc: 31 added to basis tree. Arc goes from 13 to 6.
Artifical Arc: 32 added to basis tree. Arc goes from 13 to 7.
Artifical Arc: 33 added to basis tree. Arc goes from 13 to 8.
Artifical Arc: 34 added to basis tree. Arc goes from 13 to 9.
Artifical Arc: 35 added to basis tree. Arc goes from 13 to 10.
Artifical Arc: 36 added to basis tree. Arc goes from 13 to 11.
Artifical Arc: 37 added to basis tree. Arc goes from 13 to 12.
Start PHASE_1
Iterations Iter.
Enters
Leaves
Red. Cost Flow Chg
1
1
27
-2
1
2
2
28
-2
1
3
3
29
-2
1
4
4
32
-2
1
5
5
30
-2
1
6
6
31
-2
1
7
13
33
-2
1
8
14
34
-2
1
9
15
-26
-2
1
10
22
36
-1
0
11
25
37
-1
0
12
21
35
-1
0
Start PHASE_2
Iterations Iter.
Enters
Leaves
Red. Cost Flow Chg
13
7
1
-28
4
14
17
5
-4
1
Finish
Optimal: z = 86

Select
First
First
First
First
First
First
First
First
First
First
First
First
Select
First
First

Network Model
1
0
1
1
0
100
100
0
60
1
1
1

Change

Name:MaxFlow
Type: Net
Goal: Min
Objective:
-15

Solver:
Type:
Sens.:
Side:

Jensen Network
Linear
No
No

Solve
Vary
Vary
Arc Data and Flows
Num. Name Flow Origin Term. Upper
1
Arc 1
5
1
2
5
2
Arc 2
10
1
3
15
3
Arc 3
5
2
4
5
4
Arc 4
0
2
5
5
5
Arc 5
5
3
4
5
6
Arc 6
5
3
5
5
7
Arc 7
10
4
6
15
8
Arc 8
5
5
6
5
9
Arc 9
15
0
1 ###
10
Arc 10
15
6
0 ###

Cost
0
0
0
0
0
0
0
0
0
-1

Node Data and Balance Con


Red. Co Num. Name
-1
1
A
0
2
B
0
3
C
0
4
D
-1
5
E
-1
6
F
0
0
0
0

en Network

Ph. 1 Iter.
8
Total Iter.
13
Comp. Time 00:01
Status Optimal

Dual
de Data and Balance Cons
Fixed Balance
0
0
0
0
0
0
0
0
0
0
0
0

Val Basis
0
9
1
-4
0
2
1
-7
1
-8
1
-10

Algorithmic Details for problem MaxFlow.


Jensen Network Solution Algorithm
Start Solution
Add Artificial Arcs
Artifical Arc: 15 added to basis tree.
Artifical Arc: 16 added to basis tree.
Artifical Arc: 17 added to basis tree.
Artifical Arc: 18 added to basis tree.
Artifical Arc: 19 added to basis tree.
Artifical Arc: 20 added to basis tree.
Artifical Arc: 21 added to basis tree.
Artifical Arc: 22 added to basis tree.
Start PHASE_1
Iterations Iter.
Enters
Leaves
1
11
21
2
14
22
3
9
15
4
1
16
5
2
17
6
3
18
7
4
19
8
7
20
Start PHASE_2
Iterations Iter.
Enters
Leaves
9
10
14
10
13
3
11
5
5
12
8
1
13
6
6
Finish
Optimal: z = -15

Arc
Arc
Arc
Arc
Arc
Arc
Arc
Arc

goes
goes
goes
goes
goes
goes
goes
goes

from
from
from
from
from
from
from
from

9
9
9
9
9
9
9
9

to
to
to
to
to
to
to
to

1.
2.
3.
4.
5.
6.
7.
8.

Red. Cost Flow Chg


Select
-1
0 First
-1
0 First
-1
0 First
-1
0 First
-1
0 First
-1
0 First
-1
0 First
-1
0 First
Red. Cost Flow Chg
Select
-1
0 First
-1
5 First
-1
5 First
-1
0 First
-1
5 First

Teach Network Simplex

Name: PureNet
Objective: Min
Press the button to restart the
Type:TeachNet
Value: 144
Select the Relink Buttons comm
Arcs: 12
Nodes:
5
Phase:
2
Iter.:
1
Gains: Pure
Status: Not Optimum
tificals:
4
Option: Demo
Delay:
1
Arc Information
Optimality Information
Num. Name Flow Origin Term. Upper Cost Cost 1 Red. CostStatusNB Flows
1
Arc 1
0
1
2
5
11
0
12
L
0
B
2
Arc 2
3
1
3
4
16
0
0
0
3
Arc 3
0
2
3
3
12
0
-5
L
0
B
4
Arc 4
2
2
4
4
18
0
0
0
U
5
Arc 5
3
3
4
3
13
0
12
3
6
Arc 6
0
3
5
5
-25
0
2
L
0
B
7
Arc 7
1
5
2
3
10
0
0
0
B
8
Arc 8
1
5
1
5
11
0
0
0
9
Art 1
0
1
5
0 9999
1
10010
L
0
10
Art 2
0
2
5
0 9999
1
10009
L
0
11
Art 3
0
5
3
0 9999
1
9972
L
0
12
Art 4
0
5
4
0 9999
1
9971
L
0

button to restart the Simplex process.


Relink Buttons command from the OR_MM menu before clicking a button.
Enter: 12 Leave: 12
Name Art 4 Name Art 4

formation
NB Flows

Node Information
Basis Information
Num. Name Fixed BalanceAdj. Ext.
Basis Origin Term. Lower Upper
1
Node 1
2
0
2
8
5
1
0
5
2
Node 2
1
0
1
7
5
2
0
3
3
Node 3
0
0
-3
2
1
3
0
4
4
Node 4
-5
0
-2
4
2
4
0
4
5
Slack
2
0
2
0
0
0
0 9999

Cost
11
10
16
18
0

Enter Arc
Origin
Terminal
Ratio
Gain

Dual
11
10
27
28
0

3
2
3
3
1

Flow Delta Ratio


1
-1
1
1
1
2
3
-1
3
2
0 9999
0
0 9999

Teach Network Simplex

Name:PureNet1
Objective: Min
Press the button to restart the
Type:TeachNet
Value: 122
Select the Relink Buttons comm
Arcs: 12
Nodes:
5
Phase:
2
Iter.:
8
Gains: Pure
Status: Optimal Solution
tificals:
4
Option: Demo
Delay:
1
Arc Information
Optimality Information
Num. Name Flow Origin Term. Upper Cost Cost 1 Red. CostStatusNB Flows
1
Arc 1
0
1
2
5
11
0
7
L
0
B
2
Arc 2
2
1
3
4
16
0
0
0
B
3
Arc 3
0
2
3
3
12
0
0
0
U
4
Arc 4
4
2
4
4
18
0
-7
4
B
5
Arc 5
1
3
4
3
13
0
0
0
B
6
Arc 6
1
3
5
5
-25
0
0
0
U
7
Arc 7
3
5
2
3
10
0
-3
3
8
Arc 8
0
5
1
5
11
0
2
L
0
9
Art 1
0
1
5
0 9999
1
10008
L
0
10
Art 2
0
2
5
0 9999
1
10012
L
0
11
Art 3
0
5
3
0 9999
1
9974
L
0
12
Art 4
0
5
4
0 9999
1
9961
L
0

button to restart the Simplex process.


Relink Buttons command from the OR_MM menu before clicking a button.
Enter:
3
Leave:
7
Name Arc 3 Name Arc 7

formation
NB Flows

Node Information
Basis Information
Num. Name Fixed BalanceAdj. Ext.
Basis Origin Term. Lower Upper
1
Node 1
2
0
2
-2
3
1
-4
0
2
Node 2
1
0
0
-3
3
2
-3
0
3
Node 3
0
0
0
-6
5
3
-5
0
4
Node 4
-5
0
-1
5
3
4
0
3
5
Slack
2
0
-1
0
0
0
0 9999

Cost
-16
-12
25
13
0

Enter Arc
Origin
Terminal
Ratio
Gain

Dual
9
13
25
38
0

3
2
3
3
1

Flow Delta Ratio


-2
0 9999
0
1
0
-1
0 9999
1
0 9999
0
0 9999

Teach Network

Name:PureNet2
Objective: Min
Press the button to restart the Simplex process.
Type:TeachNet
Value: 122
Select the Relink Buttons command from the OR_MM menu before clicking
Arcs: 12
Nodes:
5
Phase:
2
Iter.:
8
Gains: Pure
Status: Optimal Solution
tificals:
4
Option: Demo
Delay:
1
Arc Information
Optimality Information
Node Information
Basis Inform
Num. Name Flow Origin Term. Upper Cost Cost 1 Red. CostStatusNB Flows
Num. Name Fixed BalanceAdj. Ext.
1
Arc 1
0
1
2
5
11
0
7
L
0
1
Node 1
2
0
2
B
2
Arc 2
2
1
3
4
16
0
0
0
2
Node 2
1
0
0
B
3
Arc 3
0
2
3
3
12
0
0
0
3
Node 3
0
0
0
U
4
Arc 4
4
2
4
4
18
0
-7
4
4
Node 4
-5
0
-1
B
5
Arc 5
1
3
4
3
13
0
0
0
5
Slack
2
0
-1
B
6
Arc 6
1
3
5
5
-25
0
0
0
U
7
Arc 7
3
5
2
3
10
0
-3
3
8
Arc 8
0
5
1
5
11
0
2
L
0
9
Art 1
0
1
5
0 9999
1
10008
L
0
10
Art 2
0
2
5
0 9999
1
10012
L
0
11
Art 3
0
5
3
0 9999
1
9974
L
0
12
Art 4
0
5
4
0 9999
1
9961
L
0

Enter Arc
Origin
Terminal
Ratio
Gain

menu before clicking a button.


Enter:
3
Leave:
7
Name Arc 3 Name Arc 7

3
2
3
3
1

Basis Information
Basis Origin Term. Lower Upper
-2
3
1
-4
0
-3
3
2
-3
0
-6
5
3
-5
0
5
3
4
0
3
0
0
0
0 9999

Cost
-16
-12
25
13
0

Dual
9
13
25
38
0

Flow Delta Ratio


-2
0 9999
0
1
0
-1
0 9999
1
0 9999
0
0 9999

Starting Solution - Iteration 1


Basis Origin Term. Lower Upper
-9
5
1 -9999
0
-10
5
2 -9999
0
11
5
3
0 9999
12
5
4
0 9999
0
0
0
0 9999

Cost
-1
-1
1
1
0

Dual
-1
-1
1
1
0

Flow Delta Ratio


-2
0 9999
-1
1
1
0
-1
0
5
0 9999
0
0 9999

Iteration 2
Basis Origin Term. Lower Upper
-9
5
1 -9999
0
-10
5
2 -9999
0
2
1
3
0
4
12
5
4
0 9999
0
0
0
0 9999

Cost
-1
-1
0
1
0

Dual
-1
-1
-1
1
0

Flow Delta Ratio


-2
0 9999
-1
0 9999
0
-1
0
5
0 9999
0
0 9999

Iteration 3
Basis Origin Term. Lower Upper
-9
5
1 -9999
0
-4
4
2
-4
0
2
1
3
0
4
12
5
4
0 9999
0
0
0
0 9999

Cost
-1
0
0
1
0

Dual
-1
1
-1
1
0

Flow Delta Ratio


-2
0 9999
-1
1
1
0
0 9999
4
0 9999
0
0 9999

Iteration 4
Basis Origin Term. Lower Upper
-1
2
1
-5
0
-4
4
2
-4
0
2
1
3
0
4
12
5
4
0 9999
0
0
0
0 9999

Cost
0
0
0
1
0

Dual
1
1
1
1
0

Flow Delta Ratio


-2
1
2
-3
0 9999
0
0 9999
2
0 9999
0
0 9999

Iteration 5
Basis Origin Term. Lower Upper
-1
2
1
-5
0
7
5
2
0
3
2
1
3
0
4
12
5
4
0 9999
0
0
0
0 9999

Cost
0
0
0
1
0

Dual
0
0
0
1
0

Flow Delta Ratio


-2
0 9999
1
-1
1
0
0 9999
1
0 9999
0
0 9999

Iteration 6
Basis Origin Term. Lower Upper

Cost

Dual

Flow

Delta

Ratio

-1
7
2
5
0

2
5
1
3
0

1
2
3
4
0

-5
0
0
0
0

0
3
4
3
9999

-11
10
16
13
0

-1
10
15
28
0

-1
2
1
1
0

0
0
0
-1
0

9999
9999
9999
1
9999

Iteration 7
Basis Origin Term. Lower Upper
-2
3
1
-4
0
7
5
2
0
3
-6
5
3
-5
0
5
3
4
0
3
0
0
0
0 9999

Cost
-16
10
25
13
0

Dual
9
10
25
38
0

Flow Delta Ratio


-2
0 9999
3
0 9999
-1
1
1
1
0 9999
0
0 9999

Iteration 8 - Optimal
Basis Origin Term. Lower Upper
-2
3
1
-4
0
-3
3
2
-3
0
-6
5
3
-5
0
5
3
4
0
3
0
0
0
0 9999

Cost
-16
-12
25
13
0

Dual
9
13
25
38
0

Flow Delta Ratio


-2
0 9999
0
1
0
-1
0 9999
1
0 9999
0
0 9999

Teach Transportation
Name:TeachTrans
Enter transportation data and press the button.
Type: TeachTrans
Select the Relink Buttons command from the OR_MM menu before
Supplies:
5
No_Sup:
6
Option:
Run
Trans. Cost
1
2
3
4
5
Delay:
1
Name D 1
D2
D3
D4
D5
DD Supply
1
S1
15
8
10
17
13
0
14
2
S2
11
9
8
7
4
0
22
3
S3
14
15
8
5
6
0
22
4
S4
5
17
9
8
11
0
22
5
S5
12
10
10
16
15
0
26
Demand 19
21
20
15
17
14

Iter:
11
Cost:
593
Status: Optimum
Enter:
Leave:

Press the button to restart the Simplex process.

1
2

Suppliers
3
Key
Cost
Flow

Red. Cost
N/B

4
5

Demand
Dual(v)

1
15
0
11
0
14
0
5
19
12
0
19

Demanders
2
11
8
B
N
14
7
9
N
0
N
10
15
N
0
N
0
17
B
0
N
6
10
B
N
7
21
-4

0
1
7
8
0

3
10
0
8
5
8
7
9
3
10
5
20

2
N
0
B

0
B

0
B

0
B

4
17
0
7
0
5
15
8
0
16
0
15

12
N
2
N
0
B

2
N
9
N
-3

5
13
0
4
17
6
0
11
0
15
0
17

9
N
0
B

2
N
6
N
9
N
-4

he OR_MM menu before clicking a button.

6
0
0
0
0
0
0
0
0
0
14
14

2
N
2
N
2
N
1
N
0
B

-10

Suppl Dual(
8
14
8
22
8
22
9
22
10
26

sup.
4
3
2
5
2
3
4
5
1
1

dem.
1
4
5
6
3
3
3
2
2
3

type
D
D
D
D
S
S
S
S
D
D

Seq
1
2
3
4
5
6
7
8
9
10

Delta Flow
0
19
0
15
0
17
0
14
0
5
0
7
0
3
-1
12
1
9
-1
5

Potrebbero piacerti anche