OSCM OptDSM M4 Network Optimization
OSCM OptDSM M4 Network Optimization
Seokjun Youn
([email protected])
Today’s Plan
Lecture 4: Network Optimization Models
• Reading: OptDSM_Ch6_Network Optimization_Reading.pdf
1. Minimum-Cost Flow Problems (Sec 6.1)
2. Maximum Flow Problems
BMZ Distribution Network (Sec 6.2)
Expanded BMZ Problem (Sec 6.3)
3.
Next Class
Lecture 4: Network Optimization Models (cont’d)
Why Networks?
Networks are a general language
for describing complex systems
4
Network 5
Behind many systems there is an intricate
wiring diagram, a network, that defines the
interactions between the components
The Network!
6
Learning Objectives
After completing this chapter, you should be able to
1. Formulate various network models.
7
Networks Everywhere
Information networks:
Web & citations Internet Networks of neurons
8
Networks Everywhere BNSF Railway: www.bnsf.com
Netjets: www.netjets.com
10
Networks: Common Language
Movie 1
friend
Actor 1 Actor 2 co-worker
Peter Mary
Movie 3 Actor 4
Movie 2
friend
Tom
brothers
Actor 3 Albert
Protein 1 Protein 2
Protein 5
Protein 9 |N|=4
|E|=4
11
How do you define a network?
How to build a graph:
What are nodes?
What are edges?
12
Directed vs. Undirected Graphs
Our Focus!
Undirected Directed
Links: undirected Links: directed (arcs) • Minimum-Cost Flow
• Maximum Flow
• Shortest Path Problems
(symmetrical, reciprocal)
L B
A D
M C
F
I
D
E
B G
G
A
H F
C
Examples: Examples:
Collaborations Phone calls
Friendship on Facebook Following on Twitter
13
1. Minimum-Cost Flow (MCF) Problem
14
Distribution Unlimited Co. Problem
The Distribution Unlimited Co. has two factories producing a product that
needs to be shipped to two warehouses
• Factory 1 produces 80 units.
• Factory 2 produces 70 units.
• Warehouse 1 needs 60 units.
• Warehouse 2 needs 90 units.
There are rail links directly from Factory 1 to Warehouse 1 and Factory 2 to
Warehouse 2.
Independent truckers are available to ship up to 50 units from each factory
to the distribution center, and then 50 units from the distribution center to
each warehouse.
Question:
How many units (truckloads) should be shipped along each shipping lane?
15
The Distribution Network
16
Data for Distribution Network
17
Min Cost Flow: A Network Model
18
The Optimal Solution
19
Terminology for MCF Problems
1. The model for any minimum-cost flow problem is represented by a network with
flow passing through it.
2. The circles in the network are called nodes.
3. Each node where the net amount of flow generated (outflow minus inflow) is a fixed
positive number is a supply node.
4. Each node where the net amount of flow generated is a fixed negative number is a
demand node.
5. Any node where the net amount of flow generated is fixed at zero is a
transshipment node. Having the amount of flow out of the node equal the amount
of flow into the node is referred to as conservation of flow.
6. The arrows in the network are called arcs.
7. The maximum amount of flow allowed through an arc is referred to as the capacity
of that arc.
20
Assumptions of a MCF Problem
1. At least one of the nodes is a supply node.
2. At least one of the other nodes is a demand node.
3. All the remaining nodes are transshipment nodes.
4. Flow through an arc is only allowed in the direction indicated by the arrowhead,
where the maximum amount of flow is given by the capacity of that arc. (If flow can
occur in both directions, this would be represented by a pair of arcs pointing in
opposite directions.)
5. The network has enough arcs with sufficient capacity to enable all the flow
generated at the supply nodes to reach all the demand nodes.
6. The cost of the flow through each arc is proportional to the amount of that flow,
where the cost per unit flow is known.
7. The objective is to minimize the total cost of sending the available supply through
the network to satisfy the given demand. (An alternative objective is to maximize the
total profit from doing this.)
21
Properties of Minimum-Cost Flow Problems
• The Feasible Solutions Property: Under the previous assumptions, a minimum-
cost flow problem will have feasible solutions if and only if the sum of the
supplies from its supply nodes equals the sum of the demands at its demand
nodes.
• The Integer Solutions Property: As long as all the supplies, demands, and arc
capacities have integer values, any minimum-cost flow problem with feasible
solutions is guaranteed to have an optimal solution with integer values for all
its flow quantities.
22
Min Cost Flow: Algebraic Formulation?
23
SUMIF Function
How t he SUMIF Funct ion W orks :
• The net outflow (flow out – flow in) from node x is then
27
Spreadsheet Model
28
Typical Applications of Minimum-Cost Flow
Problems
Kind of Supply Transshipment Nodes Demand
Application Nodes Nodes
Operation of a Sources of goods Intermediate storage Customers
distribution network facilities
Solid waste Sources of solid waste Processing facilities Landfill locations
management
Operation of a supply Vendors Intermediate Processing facilities
network warehouses
Coordinating product Plants Production of a specific Market for a specific
mixes at plants product product
Cash flow Sources of cash at a Short-term investment Needs for cash at a
management specific time options specific time
29
Agenda
• Announcement
• Homework 2, Due: Feb 15, 11:59 pm
• Quiz 3: Feb 22, Please study:
• Lecture Note 3-2: LP Models – What-if Analysis
• Lecture Note 4: Network Models
• Today’s Plan
• Lecture 4: Network Optimization Models
• Reading: OptDSM_Ch6_Network Optimization_Reading.pdf
1.
2. Maximum Flow Problems (Sec 6.2 & 6.3)
• BMZ Distribution Network (Sec 6.2)
• Expanded BMZ Problem (Sec 6.3)
3. Shortest Path Problems (Sec 6.4)
• General Characteristics
• Littletown Fire Department
• Minimizing Sarah’s Total Cost
• Minimizing Quick’s Total Time
• Next Class
• Lecture 4: Network Optimization Models (cont’d)
Networks Everywhere
Information networks:
Web & citations Internet Networks of neurons
31
Networks Everywhere
I
D
E
B G
G
A
H F
C
Examples: Examples:
Collaborations Phone calls
Friendship on Facebook Following on Twitter
33
Learning Objectives
After completing this chapter, you should be able to
1. Formulate various network models.
34
2. Maximum Flow Problem
Exercise 1: BMZ Distribution Network
35
Max Flow Problem: Illustration?
Objective:
Determine the “maximum amount of flow” flowing per unit of time
from source S to sink D in a given flow network.
36
The BMZ Maximum Flow Problem
• The BMZ Company is a European manufacturer of luxury automobiles. Its exports
to the United States are particularly important.
• BMZ cars are becoming especially popular in California, so it is particularly
important to keep the Los Angeles center well supplied with replacement parts
for repairing these cars.
• BMZ needs to execute a plan quickly for shipping as much as possible from the
main factory in Stuttgart, Germany to the distribution center in Los Angeles over
the next month.
• The limiting factor on how much can be shipped is the limited capacity of the
company’s distribution network.
Question:
How many units should be sent through each shipping lane to maximize the
total units flowing from Stuttgart to Los Angeles?
37
The BMZ Distribution Network
38
Max Flow Problem: A Network Model for BMZ
39
REVIEW: Min Cost Flow: Algebraic Formulation?
𝒙𝒙𝟏𝟏
Let 𝑥𝑥𝑖𝑖 , i = 1, … 6, be the flow amount of edge 𝑖𝑖.
40
Max Flow Problem: Algebraic Formulation?
Max Flow Problem: Algebraic Formulation?
Let 𝑥𝑥𝑖𝑖 , i = 1, … 9, be the flow amount of edge 𝑖𝑖.
𝒙𝒙𝟒𝟒
𝒙𝒙𝟏𝟏 Max 𝑥𝑥1 + 𝑥𝑥2 + 𝑥𝑥3 or Min −𝑥𝑥8 − 𝑥𝑥9
Subject to
𝒙𝒙𝟖𝟖 𝒙𝒙𝟓𝟓 Capacity: 𝑥𝑥𝑖𝑖 ≤ 𝐶𝐶𝑖𝑖 , ∀𝑖𝑖 ∈ [1,9]
𝒙𝒙𝟐𝟐 e.g., 𝑥𝑥1 ≤ 50
Net Flow of Transshipment Nodes:
𝒙𝒙𝟔𝟔 RO: 𝑥𝑥4 − 𝑥𝑥1 =0
𝒙𝒙𝟗𝟗
BO: 𝑥𝑥5 + 𝑥𝑥6 − 𝑥𝑥2 =0
𝒙𝒙𝟑𝟑 LI: 𝑥𝑥7 − 𝑥𝑥3 =0
NY: 𝑥𝑥8 − 𝑥𝑥4 − 𝑥𝑥5 =0
𝒙𝒙𝟕𝟕
NO: 𝑥𝑥9 − 𝑥𝑥6 − 𝑥𝑥7 =0
Non-negativity: 𝑥𝑥1 , … 𝑥𝑥9 ≥ 0
42
Reminder: The SUMIF Function
• The SUMIF formula can be used to simplify the node flow
constraints.
= SUMIF(Range A, x, Range B)
• The net outflow (flow out – flow in) from node x is then
43
Spreadsheet Model for BMZ
44
A Network Model for BMZ
• Flow Amount = Capacity
• Flow Amount < Capacity 50
50
80 30
70
40
70
30
Maximum Flow = 150
30
45
2. Maximum Flow Problem
Exercise 2: Expanded BMZ Problem
46
Assumptions of Maximum Flow Problems
1. All flow through the network originates at one node, called the source, and
terminates at one other node, called the sink.
The source and sink in the BMZ problem are the factory and the distribution center,
respectively.
2. All the remaining nodes are transshipment nodes.
3. Flow through an arc is only allowed in the direction indicated by the arrowhead,
where the maximum amount of flow is given by the capacity of that arc.
At the source, all arcs point away from the node.
At the sink, all arcs point into the node.
4. The objective is to maximize the total amount of flow from the source to the sink.
This amount is measured in either of two equivalent ways, namely, either the amount
leaving the source or the amount entering the sink.
47
BMZ with Multiple Supply and Demand Points
• BMZ has a second, smaller factory in Berlin.
• The distribution center in Seattle has the capability of supplying parts to the
customers of the distribution center in Los Angeles when shortages occur at
the latter center.
Question:
How many units should be sent through each shipping lane to maximize the
total units flowing from Stuttgart and Berlin to Los Angeles and Seattle?
48
Network Model for The Expanded BMZ Problem
49
Spreadsheet Model
50
Network Model for The Expanded BMZ Problem
• Flow Amount = Capacity 60
• Flow Amount < Capacity 30
20
20
40 30 40
60
10 30
80
70
70
40
Maximum Flow = 220
30
30
51
Some Applications of Maximum Flow Problems
1. Maximize the flow through a distribution network, as for BMZ.
2. Maximize the flow through a company’s supply network from its vendors to its
processing facilities.
3. Maximize the flow of oil through a system of pipelines.
4. Maximize the flow of vehicles through a transportation network.
5. Maximize the flow of aircrafts for thousands of routes in airline scheduling.
6. Other numerous non-trivial applications:
Project selection
Image segmentation
Network connectivity
Network reliability
Distributed computing, etc.
52
4. Shortest Path Problems
General Characteristics
53
Assumptions of a Shortest Path Problem
1. You need to choose a path through the network that starts at a certain node,
called the origin, and ends at another certain node, called the destination.
2. The lines connecting certain pairs of nodes commonly are
links (which allow travel in either direction), although
arcs (which only permit travel in one direction) also are allowed.
3. Associated with each link (or arc) is a nonnegative number called its length.
4. The objective is to find the shortest path (the path with the minimum total
length) from the origin to the destination.
54
Applications of Shortest Path Problems
Minimize the total distance traveled.
Minimize the total cost/time of a sequence of activities.
Real-world use cases:
• Digital Mapping Services in Google Maps
• IP routing to find Open shortest Path First: find the best path between the source
and the destination router.
• Social Networking Applications: find the shortest path between users measured
through connections among them (for a small-size graph).
• Designate file server in a LAN(local area network).
• Robotic Path: drones and robots delivering packages in a minimum amount of time.
• Telephone Network: If we imagine a city to be a graph, the vertices represent the
switching stations, and the edges represent the transmission lines and the weight of
the edges represents bandwidth.
55
4. Shortest Path Problems
Exercise 1: Littletown Fire Department
56
Littletown Fire Department
• Littletown is a small town in a rural area.
• Its fire department serves a relatively large geographical area that includes
many farming communities.
• Since there are numerous roads throughout the area, many possible routes
may be available for traveling to any given farming community.
Question:
Which route from the fire station to a certain farming community minimizes
the total number of miles?
57
The Littletown Road System
The road system between the Littletown Fire Station and a certain farming community, where A, B, . . . , H
are junctions and the number next to each road shows its distance in miles.
58
The Network Representation
59
Spreadsheet Model 2
60
The Network Representation
61
Agenda
• Announcement
• Homework 2 Grading posted
• Quiz 3: Feb 22, Please study:
• Lecture Note 3-2: LP Models – What-if Analysis
• Lecture Note 4: Network Models
• Let me know your Term Project teammate by Feb 29.
• Today’s Plan
• Lecture 4: Network Optimization Models
• Reading: OptDSM_Ch6_Network Optimization_Reading.pdf
1.
2.
3. Shortest Path Problems (Sec 6.4)
63
Minimizing Total Cost: Sarah’s Car Fund
• Sarah has just graduated from high school.
• As a graduation present, her parents have given her a car fund of $21,000 to
help purchase and maintain a three-year-old used car for college.
• Since operating and maintenance costs go up rapidly as the car ages, Sarah
may trade in her car on another three-year-old car one or more times during
the next three summers if it will minimize her total net cost.
• (At the end of the four years of college, her parents will trade in the current
used car on a new car for Sarah.)
Question:
When should Sarah trade in her car (if at all) during the next three summers?
64
Sarah’s Cost Data
65
Shortest Path Formulation!
• The node labels measure the number of years from now.
• Each arc represents purchasing a car and then trading it in later.
• Arc length (cost) = Purchase price + Operating and maintenance costs - Trade-in value
• Example: Length of arc from 1 to 3 = 12,000 + 2,000 + 3,000 - 6,500 = 10,500
66
Spreadsheet Model
67
Spreadsheet Model
68
Shortest Path Formulation
69
Let's take a break
• The Science Behind Google Maps | Route Finding Algorithms
• https://www.youtube.com/watch?v=QhcerJZD1Gc&ab_channel=DataScience
Show
• Dijkstra’s Algorithm
• https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
70
Dijkstra’s Algorithm (optional)
• Dijkstra’s Algorithm derived by a Dutch computer scientist Edsgar Wybe
Dijstra in 1956 and published in 1959.
• Shortest path problem: (Google Maps) find shortest path from s to all
other nodes
71
Dijkstra’s Algorithm (optional)
• Dijkstra’s algorithm – is a solution to the single-source shortest path
problem in graph theory.
• Works on both directed and undirected graphs. However, all edges must
have nonnegative weights.
• Dijkstra's always gives shortest path when the edge costs are all positive.
However, it can fail when there are negative edge costs.
• Approach: Greedy
• Input: Weighted graph G={E,V} and source vertex, such that all edge
weights are nonnegative.
73
Dijkstra Animated Example
74
Dijkstra Animated Example
75
Dijkstra Animated Example
76
Dijkstra Animated Example
77
Dijkstra Animated Example
78
Dijkstra Animated Example
79
Dijkstra Animated Example
80
Dijkstra Animated Example
81
Dijkstra Animated Example
82
Dijkstra Applications:
• Traffic Information Systems are most prominent use
• Mapping (Map Quest, Google Maps)
• Routing Systems
83
4. Shortest Path Problems
Exercise 3: Minimizing Quick’s Total Time
84
Minimizing Total Time: Quick Company
• The Quick Company has learned that a competitor is planning to come out with a new
kind of product with great sales potential.
• Quick has been working on a similar product that had been scheduled to come to
market in 20 months.
• Quick’s management wishes to rush the product out to meet the competition.
• Each of four remaining phases can be conducted at a normal pace, at a priority pace,
or at crash level to expedite completion. However, the normal pace has been ruled
out as too slow for the last three phases.
• $30 million is available for all four phases,
• i.e., Remaining Research, Development, Design of Mfg. System, Production and Distribution
Question:
At what pace should each of the four phases be conducted?
85
Time and Cost of the Four Phases
Level Remaining Development Design of Initiate Production
Research Mfg. System and Distribution
Normal 5 months — — —
Priority 4 months 3 months 5 months 2 months
Crash 2 months 2 months 3 months 1 month
86
Shortest Path Formulation
• Except for the dummy destination, the arc labels indicate, first, the number of
phases completed and, second, the amount of money left (in millions of dollars) for
the remaining phases.
• Each arc length gives the time (in months) to perform that phase. 87
Spreadsheet Model 4
88
The Optimal Solution
89
Summary of Network Models
• Minimum-Cost Flow Problem
• The objective is to minimize the total cost of sending the available supply through the
network to satisfy the given demand.
• Shortest-Path Problem
• The objective is to find the shortest path (the path with the minimum total length)
from the origin to the destination.
90
Next Class
• Read the Case Study “Money in Motion” in D2L.
• Fill out the case study template Case_Money-in-Motion_Template.xlsx
91