Operations research - Lecture 11
Operations research - Lecture 11
◉ The edges may have direction (in a directed graph): an edge e between u and v may go
from u to v, we write e = (u, v)
Weighted graph: A weighted graph is a graph in which a number (the weight) is assigned to
each edge. Such weights might represent for example costs, lengths or capacities, depending on
the problem at hand.
Shortest path problem
◉ Here, we assume that each arc in the network has a length associated with it. Suppose we
start at a particular node (say, node 1). The problem of finding the shortest path (path of
minimum length) from node 1 to any other node in the network is called a shortest-path
problem.
◉ Dijkstra's algorithm guarantees finding the shortest path from the source to any other node
in the graph with non-negative edge weights.
Dijkstra's Algorithm
i. Start with the source node (s) and mark its distance as 0 and other nodes as infinity.
ii. Find the unvisited node with the smallest distance from the source.
iii. Mark this node as visited and update the distances of its unvisited neighbors using the distance of
the current node and the weight of the connecting edge.
iv. Repeat steps 2 and 3 until all nodes are visited.
Dijkstra's Algorithm
Example 7.1 You are planning a road trip and want to find the shortest route from your
starting city (City A) to your destination (City F) while visiting two other 4 cities along the
way. The following graph gives information about the distances and travel times between
cities:
Obtain the shortest bath from the city A to the other cities.
95
B D
1
1
40 40
65
A
1 35 70 F
1
100 E 40
C 1
1 20
Dijkstra's Algorithm
Dijkstra's Algorithm
Dijkstra's Algorithm
Obtain the shortest bath from the city A to the other cities.
Projects Network: CPM and PERT
◉ A project involves a large number of interrelated activities (or tasks) that must be
completed on or before a specified time limit, in a specified sequence (or order) with
specified quality and minimum cost of using resources.
◉ A network is a graphical presentation of arrows and nodes for showing the logical
sequence of various activities to be performed to achieve project objectives. In this
chapter, we shall discuss two of these well-known techniques – PERT and CPM.
Projects Network: CPM and PERT
◉ CPM (Critical Path Method)
◉ Activity: Represent a project operation (or task) to be conducted. As such each activity except
dummy activity requires resources and takes a certain amount of time for completion. An arrow is
commonly used to represent an activity with its head indicating the direction of progress in the
project.
CPM/PERT network component
◉ Activity-on-Arrow (AOA) network: In this type of network at each end of the activity arrow
is a node (or circle). These nodes represent points in time or instants, when an activity is
starting or ending. The arrow itself represents the passage of time required for that
activity to be performed.
◉ Following are some of the rules that have to be followed while constructing an AOA
network:
Rules of AOA Network
Dummy activities
◉ Dummy activities: An activity which does not consume either any resource and/or time is
known as dummy activity.
Example
◉ Example 7.3 Construct a network diagram for the following project.
Example
◉ Example 7.3
4
There are two such pathes
(i) 1→2→3→4→6 A (2) B( 3 )
1 2 3
(ii) 1 → 2 → 3 → 5 → 6
Because the second path is the longest path, it is called the critical path for completing the
project and the activities on it are called critical activities.
Example
◉ Example 7.4. Construct a network diagram for the following project.
Example
◉ Example 7.4.
4
C(8)
A(2) B(6)
3 (0)
1 2
D(2)
4’ E(3) 5
Example
Activity Predecessor
◉ Example Construct a network diagram. activity
A --
B --
C A
D A
E B
F B
G D,F
H E
I C,G
J D,F
K H
Important Definitions
◉ tij = Duration of an activity (i, j).
◉ Ei = Earliest occurrence time of an event, i. This is the earliest time for an event to occur
when all the preceding activities have been completed, without delaying the entire
project.
◉ Li = Latest allowable time of an event, i. This is the latest time at which an event can
occur without causing a delay in project’s completion time.
Important Definitions
◉ ESij = Early starting time of an activity (i, j). This is the earliest time an activity should
start without affecting the project completion.
◉ LSij = Late starting time of an activity (i, j). This is the latest time an activity should
start without delaying the project completion.
◉ EFij = Early finishing time of an activity (i, j). This is the earliest time an activity should
finish without affecting the project completion.
◉ LFij = Late finishing time of an activity (i, j). This is the latest time an activity should
finish without delaying the project completion.
Important Definitions
For calculating the earliest occurrence and latest allowable times for events, following two
methods: Forward Pass method and Backward Pass method
Forward Pass Method (For Earliest Event Time Ej )