Assignment-2024
Assignment-2024
CAE 597
SYSTEMS ANALYSIS IN CIVIL ENGINEERING
Network Models
Mohammad Miralinaghi
Illinois Institute of Technology
1
11/7/2024
(25,$8)
2 4 15 veh/hr
20 veh/hr 1 (15,$3)
(20,$2) (15,$4)
3 5 5 veh/hr
(10,$2)
Righthand
𝑥 𝑥 𝑥 𝑥 𝑥 𝑥 𝑥
side
Node 1 1 1 0 0 0 0 0 20
Node 2
-1 0 1 1 1 0 0 0
Node 3
0 -1 -1 0 0 1 0 0
Node 4
0 0 0 -1 0 0 -1 -5
Node 5
0 0 0 0 -1 -1 1 -15
Capacities
20 15 20 25 15 10 15
Objective 5 6 2 8 3 2 4
2
11/7/2024
Network problem:
𝑚𝑖𝑛 𝑧 = 𝑐 𝑥
𝑥 − 𝑥 =𝑏
𝑙 ≤𝑥 ≤𝑢
𝑥 = 𝑓𝑙𝑜𝑤 𝑜𝑓 𝑙𝑖𝑛𝑘 𝑖, 𝑗
𝑙 = 𝐿𝑜𝑤𝑒𝑟 𝑏𝑜𝑢𝑛𝑑 𝑜𝑓 𝑓𝑙𝑜𝑤 𝑜𝑓 𝑙𝑖𝑛𝑘 (𝑖, 𝑗)
𝑢 = 𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦 𝑜𝑓 𝑙𝑖𝑛𝑘 (𝑖, 𝑗)
Special Cases
3
11/7/2024
Transportation Problem
What is the difference?
Transportation Problem
𝑚𝑖𝑛 𝑧 = 𝑐 𝑥
𝑥 =𝑎
𝑥 =𝑏
𝑙 ≤𝑥 ≤𝑢
𝑥 = 𝑓𝑙𝑜𝑤 𝑜𝑓 𝑙𝑖𝑛𝑘 𝑖, 𝑗
𝑙 = 𝐿𝑜𝑤𝑒𝑟 𝑏𝑜𝑢𝑛𝑑 𝑜𝑓 𝑓𝑙𝑜𝑤 𝑜𝑓 𝑙𝑖𝑛𝑘 (𝑖, 𝑗)
𝑢 = 𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦 𝑜𝑓 𝑙𝑖𝑛𝑘 (𝑖, 𝑗)
4
11/7/2024
Example:
Cleveland 7 7 12 10 40
Chicago 8 10 15 8 50
Boston 15 10 14 7 45
Requirements 45 20 40 30
10
5
11/7/2024
Righthand
𝑥 𝑥 𝑥 𝑥 𝑥 𝑥 𝑥 𝑥 𝑥 𝑥 𝑥 𝑥
side
Origin 1
1 1 1 1 0 0 0 0 0 0 0 0 40
(Cleveland)
Origin 2
(Chicago) 0 0 0 0 1 1 1 1 0 0 0 0 50
Origin 3
(Boston) 0 0 0 0 0 0 0 0 1 1 1 1 45
Destination 1
(Dallas) -1 0 0 0 -1 0 0 0 -1 0 0 0 -45
Destination 2
(Atlanta) 0 0 0 0 0 0 0 0 0 0 0 0 -20
Destination 3
(San 0 0 0 0 0 0 0 0 0 0 0 0 -40
Francisco)
Destination 4
(Philadelphia) 0 0 0 0 0 0 0 0 0 0 0 0 -30
Objective 7 7 12 10 8 10 15 8 15 10 14 7
11
Assignment Problem
Suppose n people are allocated to m jobs and 𝑐 shows the
performance of person i in job j.
What is the difference?
Benefits are shown on each link:
1 (5) 1
(8)
2 (2) 4
(2)
(4)
3 (3) 5
12
6
11/7/2024
Assignment Problem
What is the difference?
Benefits are shown on each link:
1 1
(8)
2 4
3 (3) 5
13
Assignment Problem
𝑚𝑎𝑥 𝑧 = 𝑐 𝑥
𝑥 =1
𝑥 =1
𝑥 = 0,1
14
7
11/7/2024
15
The numbers next to the arcs indicate the maximum flow capacity (in 100,000
gallons/day) in that section of the pipeline
(8)
2 4 (15)
𝝂 1 6 𝝂
(3) (4)
3 5 (20)
(10)
16
8
11/7/2024
Network problem:
max 𝑧 = 𝑥 =𝜈
𝑥 − 𝑥 = 𝜈 𝑖𝑓 𝑖 = 𝑜𝑟𝑖𝑔𝑖𝑛
𝑥 − 𝑥 = 0 𝑖𝑓 𝑖 = 𝐼𝑛𝑡𝑒𝑟𝑚𝑒𝑑𝑖𝑎𝑡𝑒
𝑥 − 𝑥 = −𝜈 𝑖𝑓 𝑖 = 𝐷𝑒𝑠𝑡𝑖𝑛𝑎𝑡𝑖𝑜𝑛
0≤𝑥 ≤𝑢
𝑥 = 𝑓𝑙𝑜𝑤 𝑜𝑓 𝑙𝑖𝑛𝑘 𝑖, 𝑗
𝑢 = 𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦 𝑜𝑓 𝑙𝑖𝑛𝑘 (𝑖, 𝑗)
17
𝑥 =𝜈
(8)
2 4 (15)
1 6
(3) (4)
3 5 (20)
(10)
18
9
11/7/2024
Shortest-Path Problem
The goal is to find the path with minimum cost between origin and
destination. Links do not have capacity but have cost. What is the
maximum flow 𝜈 that can be sent from origin to destination
The numbers next to the links indicate the travel time (in minutes) for each link.
(8)
2 4 (15)
𝟏 1 6 𝟏
(3) (4)
3 5 (20)
(10)
19
Shortest-path problem
𝑚𝑖𝑛 𝑧 = 𝑐 𝑥
𝑥 − 𝑥 = 1 𝑖𝑓 𝑖 = 𝑜𝑟𝑖𝑔𝑖𝑛
𝑥 − 𝑥 = 0 𝑖𝑓 𝑖 = 𝐼𝑛𝑡𝑒𝑟𝑚𝑒𝑑𝑖𝑎𝑡𝑒
𝑥 − 𝑥 = −1 𝑖𝑓 𝑖 = 𝐷𝑒𝑠𝑡𝑖𝑛𝑎𝑡𝑖𝑜𝑛
𝑥 ≥0
𝑥 = 𝑓𝑙𝑜𝑤 𝑜𝑓 𝑙𝑖𝑛𝑘 𝑖, 𝑗
20
10
11/7/2024
Assignment Problem
Suppose n people are allocated to n jobs and 𝑐 shows the
performance of person i in job j.
What is the difference?
Benefits are shown on each link:
1 (5) 1
(8)
2 (2) 4
(2)
(4)
3 (3) 5
21
Assignment Problem
What is the difference?
Benefits are shown on each link:
1 1
(8)
2 4
3 (3) 5
22
11
11/7/2024
Assignment Problem
𝑚𝑎𝑥 𝑧 = 𝑐 𝑥
𝑥 =1
𝑥 =1
𝑥 = 0,1
23
EXAMPLE
Four workers are to be assigned to four jobs. The times taken by each
worker on each job are given in the time matrix. Find an assignment
which would minimize the sum of the times taken. Assume that all the
workers are paid at the same rate
A B C D
a 15 18 21 24
b 19 23 22 18
c 26 17 16 19
d 19 21 23 17
24
12
11/7/2024
Hungarian Method
Step 1: Deduct the Smallest Non-zero Time in Each Column From All
Entries in That Column, Obtaining At Least One Zero in Each Column
A B C D
a 15 18 21 24
b 19 23 22 18
c 26 17 16 19
d 19 21 23 17
25
Hungarian Method
Step 2: In Each Row of Positive Entries (No Zero Entries), Deduct the
Smallest Time From All Entries in That Row
A B C D
a 0 1 5 7
b 4 6 6 1
c 11 0 0 2
d 4 4 7 0
26
13
11/7/2024
Hungarian Method
Step 2: In Each Row of Positive Entries (No Zero Entries), Deduct the
Smallest Time From All Entries in That Row
A B C D
a 0 1 5 7
b 3 5 5 0
c 11 0 0 2
d 4 4 7 0
27
Hungarian Method
Step 3: Draw the minimum number of lines that will cover all the zeros. if
there are as many lines as there are rows or columns, an optimal
assignment is possible. if not, the matrix must be changed.
A B C D
a 0 1 5 7
b 3 5 5 0
c 11 0 0 2
d 4 4 7 0
28
14
11/7/2024
Hungarian Method
Step 4: In the last matrix, subtract the smallest uncovered entry (3 in this
example) from all uncovered entries. enter the results.
Then, add the same number to the elements at which lines cross
[(a,d) and (c,d) in this example]. Enter these results and complete
the matrix by entering the other covered elements unchanged
A B C D
a 0 1 5 7
b 3 5 5 0
c 11 0 0 2
d 4 4 7 0
29
Hungarian Method
Step 4: In the last matrix, subtract the smallest uncovered entry (3 in this
example) from all uncovered entries. enter the results.
Then, add the same number to the elements at which lines cross
[(a,d) and (c,d) in this example]. Enter these results and complete
the matrix by entering the other covered elements unchanged
A B C D
a 0 1 5 10
b 0 2 2 0
c 11 0 0 5
d 1 1 4 0
30
15
11/7/2024
Hungarian Method
step 4: Repeat step (3) by drawing the minimum number of lines to
cover all the zeros and step (4) if necessary
A B C D
a 0 1 5 10
b 0 2 2 0
c 11 0 0 5
d 1 1 4 0
31
Hungarian Method
step 4: Repeat step (3) by drawing the minimum number of lines to
cover all the zeros and step (4) if necessary
A B C D
a 0 0 4 10
b 0 1 1 0
c 12 0 0 6
d 1 0 3 0
32
16
11/7/2024
Hungarian Method
The optimal solution has been reached since the number of lines
equals the number of rows (or columns).
A B C D
a 0 0 4 10
b 0 1 1 0
c 12 0 0 6
d 1 0 3 0
33
Hungarian Method
The optimal solution has been reached since the number of lines
equals the number of rows (or columns).
Make the actual assignments, starting with the zero cell which is
unique in its row or column. if no such cell exists, start with any
zero cell. there may be more than one optimal assignment.
First assignment:
cc, aa, bd, db;
time = 16 + 15 + 18 + 21 = 70
Second assignment:
cc, ab, ba, dd;
time = 16 + 18 + 19 + 17 = 70
34
17
11/7/2024
EXAMPLE
Five workers are to be assigned to five jobs. The times taken by each
worker on each job are given in the time matrix. Find an assignment
which would minimize the sum of the times taken. Assume that all the
workers are paid at the same rate
A B C D E
a 23 16 20 15 30
b 22 29 15 27 30
c 16 17 22 15 35
d 29 42 37 41 35
e 17 30 17 30 25
35
Questions?
36
18