0% found this document useful (0 votes)
61 views

Introduction and The Shortest Path Problem

This document introduces the shortest path problem and provides examples of how to formulate various decision making problems as shortest path problems on a graph. The document defines graphs and digraphs, discusses paths and their lengths, formally defines the shortest path problem, and provides examples of formulating problems from transportation, scheduling, production planning, and real estate rental as shortest path problems. It also discusses issues that can arise with negative edge lengths like the presence of negative cycles.

Uploaded by

moinur1214842
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

Introduction and The Shortest Path Problem

This document introduces the shortest path problem and provides examples of how to formulate various decision making problems as shortest path problems on a graph. The document defines graphs and digraphs, discusses paths and their lengths, formally defines the shortest path problem, and provides examples of formulating problems from transportation, scheduling, production planning, and real estate rental as shortest path problems. It also discusses issues that can arise with negative edge lengths like the presence of negative cycles.

Uploaded by

moinur1214842
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

SA367 Mathematical Models for Decision Making Spring 2018 Uhan

Lesson 1. Introduction and the Shortest Path Problem

1 Goals for this course


● A course in operations research: the discipline of applying advanced mathematical methods to help make better
decisions

● Formulate mathematical models for real-world decision-making problems:

○ The shortest path problem


○ Dynamic programming – deterministic and stochastic

● Use computational tools to solve these models with medium-to-large scale data

○ Python and its many data science packages (e.g. pandas, networkx)
○ Focus on
◇ setting up models with the help of design patterns
◇ analyzing and interpreting solutions

● Analyze and interpret solutions to these models

Problem statement and data

What is the shortest Solution


way to get to Fox’s
Den from Gate 1?
Interpreting

Solving
Modeling directed graph (N , E),
source s ∈ N, target t ∈ N,
edge lengths c i j for (i, j) ∈ E

Mathematical model

● Detailed topic list and schedule on the syllabus

2 This lesson...
● What is the shortest way to get from Point A to Point B?

1
3 Graphs and networks
● Graphs model how various entities are connected
● A directed graph (also known as a digraph) (N , E) consists of
○ set of nodes N (also known as vertices)
○ set of edges E (also known as arcs)
◇ edges are directed from one node to another
◇ edge from node i to node j is denoted by (i, j)

Example 1.

1 4

4 Graphs are everywhere


● Physical networks – e.g. road networks
● Abstract networks – e.g. organizational charts
● Others?

5 Paths
● A path is a sequence of edges connecting two specified nodes in a graph:
○ Each edge must have exactly one node in common with its predecessor in the sequence
○ Edges must be passed in the forward direction
○ No node may be visited more than once

Example 2. Give some examples of paths from node 1 to node 4 in the network in Example 1.

2
6 The shortest path problem
The shortest path problem
● Data:

○ Digraph (N , E)
○ Source node s ∈ N and sink node t ∈ N (s ≠ t)
○ Each edge (i, j) in E has a length c i j

● The length of a path is the sum of the lengths of the edges in the path

● Problem: What is the shortest path from s to t?

Example 3. Consider the digraph below. The labels next to each edge represent that edge’s length. What is the
shortest path from node 1 to node 6?

4
2 4
2 1
3

1 6
3
1

3 2
1
3 5

● Natural applications of the shortest path problem:

○ Transportation (road networks, air networks)


○ Telecommunications (computer networks)

● Our focus: not-so-obvious applications of the shortest path problem

● In order to formulate a problem as a shortest path problem, we must specify:


(i) a digraph (nodes and edges)
(ii) a source and target node
(iii) the length of each edge
(iv) how any path from the source to the target translates into a solution to the problem

3
Example 4. You have just purchased a new car for $22,000. The cost of maintaining a car during a year depends on its
age at the beginning of the year:

Age of car (years) 0 1 2 3 4


Annual maintenance cost ($) 2,000 3,000 4,000 8,000 12,000

To avoid the high maintenance costs associated with an older car, you may trade in your car and purchase a new car.
The price you receive on a trade-in depends on the age of the car at the time of the trade-in:

Age of car (years) 1 2 3 4 5


Trade-in price ($) 15,000 12,000 9,000 5,000 2,000

For now, assume that at any time, it costs $22,000 to purchase a new car. Your goal is to minimize the net cost
(purchasing costs + maintenance costs − money received in trade-ins) incurred over the next five years. Formulate
your problem as a shortest path problem.

4
Example 5. The Simplexville College campus shuttle bus begins running at 7:00pm and continues until 2:00am. Several
drivers will be used, but only one should be on duty at any time. If a shift starts at or before 9:00pm, a regular driver can
be obtained for a 4-hour shift at a cost of $50. Otherwise, part-time drivers need to be used. Several part-time drivers
can work 3-hours shifts at $40, and the rest are limited to 2-hour shifts at $30. The college’s goal is to schedule drivers
in a way that minimizes the total cost of staffing the shuttle bus. Formulate this problem as a shortest path problem.

5
Example 6. The Dijkstra Brewing Company is planning production of its new limited run beer, Primal Pilsner. The
company must supply 30 batches in the next quarter, then 25, 10, and 35 in successive quarters. Each quarter in which
the company produces the beer requires a factory setup cost of $100,000. Each batch of beer costs $3,000 to produce.
Batches can be held in inventory, but due to refrigeration requirements, the cost is a high $5,000 per batch per quarter.
The company wants to find a production plan that minimizes its total cost. Formuate this problem as a shortest path
problem.

6
Example 7. Beverly owns a vacation home in Cape Fulkerson that she wishes to rent for the summer season (May 1 to
September 1). She has solicited bids from eight potential renters:

Renter Rental start date Rental end date Amount of bid ($)
1 May 1 June 1 1800
2 May 1 July 1 3400
3 June 1 July 1 2000
4 June 1 August 1 4000
5 June 1 September 1 4800
6 July 1 August 1 1600
7 July 1 September 1 3200
8 August 1 September 1 1400

A rental starts at 15:00 on the start date, and ends at 12:00 on the end date. As a result, one rental can end and another
rental can start on the same day. However, only one renter can occupy the vacation home at any time.
Beverly wants to identify a selection of bids that would maximize her total revenue. Formulate Beverly’s problem as a
shortest path problem.

7
7 Longest paths and negative cycles
● We saw in the previous example that formulating a shortest path problem with negative edge lengths often makes
sense, especially when a problem is naturally formulated as a longest path problem

● This can sometimes be problematic!

Example 8. Find the shortest path from node 1 to node 4 in the following digraph:

2
1 2

3
−10
10

4
3 4

● Remember that a path can visit each node at most once

● A cycle in a digraph is a path from a source node s to a target node t plus an arc (t, s)

● A negative cycle has negative total length

○ For example: (2, 3), (3, 4), (4, 2) in the digraph above

● Negative cycles make things complicated: if we traverse a negative cycle, we can reduce the cost of getting point
A to point B infinitely

● Shortest path problems with negative cycles harder to solve

○ Standard shortest path algorithms fail when the digraph has a negative cycle

● Having a negative cycle in your shortest path problem might indicate (i) your problem will be hard to solve, or
(ii) there is a mistake in your formulation!

You might also like