Lab Sheet#04 Critical Path Method

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Lab Sheet#04 Critical Path Method

Dr. Sanjeev Patel


Asst. Professor, CSE, NIT Rourkela
Adapted from: Software Project, Process and Quality
Management By Prof. D P Mohapatra
1/12/2021 Software Engineering Lab#04 1
Introduction to Scheduling
• Scheduling the project tasks is an important project planning
activity.
• The scheduling problem, in essence, consists of deciding
which tasks would be taken up when and by whom.
• Once a schedule has been worked out and the project gets
underway, the project manager monitors the timely
completion of the tasks and
– takes any corrective action that may be necessary whenever there is a
chance of schedule slippage.

1/12/2021 Software Engineering Lab#04 2


Steps for Scheduling
In order to schedule the project activities, a project manager
needs to do the followings:
1. Identify all the major activities that need to be carried out to
complete the project.
2. Break down each activity into tasks.
3. Determine the dependency among different tasks.
4. Establish the estimates for the time durations necessary to
complete the tasks.

1/12/2021 Software Engineering Lab#04 3


Steps for Scheduling

5. Represent the information in the form of an activity


network.
6. Determine task starting and ending dates from the
information represented in the activity network.
7. Determine the critical path. A critical path is a chain of
tasks that determines the duration of the project.
8. Allocate resources to tasks.

1/12/2021 Software Engineering Lab#04 4


Activity Networks

• An activity network shows the different activities making up a


project, their estimated durations, and their
interdependencies.
• Two equivalent representations for activity networks are
possible and are in use:
– Activity on Node (AON)
– Activity on Edge (AOE) or Activity on Arrow (AOA)

1/12/2021 Software Engineering Lab#04 5


Activity Networks
• WBS structure can be refined into an activity network
representation:
– Network of boxes and arrows
– shows different tasks making up a project,
– represents the ordering among the tasks.
• It is important to realize that developing WBS and activity
network
– requires a thorough understanding of the tasks involved.
• Activity networks were originally represented using activity
on edge (AOE) representation.
– However, later activity on node (AON) has become popular since
this representation is easier to understand and revise.
1/12/2021 Software Engineering Lab#04 6
Activity Networks

• Activity on Node (AON)


– Each activity is represented by a rectangular (some use circular)
node and the duration of the activity is shown alongside each task in
the node.
– The inter-task dependencies are shown using directional edges.
• Activity on Edge (AOE)
– Tasks are associated with the edges.
– The edges are also annotated with the task duration.
– The nodes in the graph represent project milestones

1/12/2021 Software Engineering Lab#04 7


Example
• Consider MIS development project.
• Suppose the project manager has determined the durations
and dependencies for each task as given in table.
Task number Task Duration Dependent
on Tasks
T1 Specification 15 -
T2 Design database 45 T1
T3 Design GUI 30 T1
T4 Code database 105 T2
T5 Code GUI part 45 T3
T6 Integrate and test 120 T4 and T5

T7 Write user 60 T1
1/12/2021 manual
Software Engineering Lab#04 8
Activity Network for MIS Example
Design database Code database
45 105

Specification Integrate and Finis


15 test h
120 0

Design GUI Code GUI


30 45

Write user manual


60
1/12/2021 Software Engineering Lab#04 9
Activity Networks
• Managers can estimate the time durations for the different tasks in several
ways.
– One possibility is that they can empirically assign durations to different
tasks.
– This however may not be such a good idea, because software
developers often resent such unilateral decisions.
– However, some managers prefer to estimate the time for various
activities themselves.
• They believe that an aggressive schedule would motivate the developers
to do a better and faster job.
• There are two methods to find the minimum duration of a project
– Critical Path Method (CPM)
– Project Evaluation and Review Technique (PERT)
1/12/2021 Software Engineering Lab#04 10
Critical Path Method
• Critical Path Method (CPM) is a technique for:
– Identifying critical paths
– Managing project.
• The CPM technique is not specific to software engineering
– has a much wider use.
• CPM can assist in answering questions like:
– What are the critical paths in the project?
– What is the shortest time in which the project can be completed?
– What is the earliest (or latest) time a task can be started (or finished)
without delaying the project?

1/12/2021 Software Engineering Lab#04 11


Critical Path Method (CPM)
• A path in the activity network (graph) is any set of consecutive nodes and
edges from the starting node to the last node.
• A critical path consists of a set of dependent tasks that need to be
performed in a sequence and which together take the longest time to
complete.
• A critical task is one with a zero slack time.
• A path from the start node to the finish node containing only critical tasks
is called a critical path.
• A critical path is a:
– path along which every milestone is critical to meeting the project
deadline
– chain of tasks that determine the duration of the project.

1/12/2021 Software Engineering Lab#04 12


Critical Path Method (CPM)
• A critical path is a sequence of tasks such that
– a delay in any of the tasks will cause a delay to the entire project.
• There can be more than one critical path in a project.
• It is important for the project manager to be aware of the critical paths in a
project:
– can ensure that tasks on these paths are completed on time.
• Other tasks may have some room for delay without affecting the entire project.
– If necessary, the manager may switch resources from a noncritical task to a
critical task.
• Several software packages are available for automating the scheduling
process:
– Mac-Project on Apple Macintosh computer
– MS-Project on Microsoft Windows Operating System.
1/12/2021 Software Engineering Lab#04 13
Critical Path Method (CPM)
• CPM is an algorithmic approach to determine the critical paths
and slack times for tasks not in the critical paths.
• It involves calculating the following quantities:
– Minimum time (MT)
– Earliest start time (ES)
– Latest start time (LS)
– Earliest finish time (EF)
– Latest finish time (LF)
– Slack time (ST) (or float time)

1/12/2021 Software Engineering Lab#04 14


Quantities to be calculated in CPM
• Minimum time (MT)
– Minimum time required to complete the project.
– Computed by determining the maximum of all paths from start node to
finish node.
• Earliest start time (ES)
– The time of a task which is the maximum of all paths from the start to this
task.
– The ES for a task is the ES of the previous task plus the duration of the
preceding task.
• Earliest finish time (EF)
– The EF for a task is the sum of the earliest start time of the task and the duration of
the task.

1/12/2021 Software Engineering Lab#04 15


Quantities to be calculated in CPM
• Latest start time (LS)
– The difference between MT and the maximum of all paths from this task to the finish.
– Computed by subtracting the duration of the subsequent task from the LS of the
subsequent task.
• Latest finish time (LF)
– Indicates the latest time by which a task can finish without affecting the final
completion time of the project.
– A task completing beyond its LF would cause project delay.
– Obtained by subtracting maximum of all paths from this task to finish node from MT.
• Slack time (ST) (or float time)
– Total time that a task may be delayed before it will affect the end time of the project.
– Indicates the flexibility in starting and completion of tasks.
– ST for a task is LS-ES and can equivalently be written as LF-EF.

1/12/2021 Software Engineering Lab#04 16


CPM Graph and Slack Time
• To construct a CPM graph,
– A list of tasks and their durations are required.
– Also, for each task a list of tasks upon which it depends is required.
– A task may depend on more than one task.
• The task details can be given in the form of a table.
• Float time (or slack time) is the total time that a task may be
delayed
– before it will affect the end time of the project.
• The float times indicate the "flexibility" in starting and
completion of tasks:
• A critical activity is an activity with zero (0) slack or float time.
1/12/2021 Software Engineering Lab#04 17
How do we work out the various start and
finish times for tasks?
• Minimum time to complete project (MT) = Maximum of all
paths from start to finish
• Earliest start time (ES) of a task = Maximum of all paths from
start to this task
• Earliest finish time (EF) of a task = ES + duration of the task
• Latest start time (LS) of a task = LF - duration of the task
• Latest finish time (LF) of a task= MT - Maximum of all paths
from this task to finish
• Slack time = LS - ES = LF - EF
1/12/2021 Software Engineering Lab#04 18
Example - Activity Network for MIS

Design Code database


database 105
45

Specification Integrate Finis


15 and test h
120 0

Design GUI Code GUI


30 45

Write user manual


60

1/12/2021 Software Engineering Lab#04 19


Example: MIS problem
• Activity on Node Network
– Activities are represented as nodes (boxes)
– The lines between nodes represent dependencies
• Steps for finding the critical path
– Compute ES and EF for each task
• Use the rule: ES is equal to the largest EF of the immediate predecessors
– Compute LS and LF for each task
• Use the rule: LF is equal to the smallest LS of the immediate successors
– Compute ST for each task
• Use the rule: ST=LF-EF
1/12/2021 Software Engineering Lab#04 20
Project parameters (ES & EF) for MIS problem
Task Duration ES EF
Specification 15 0 15

Design data base 45 15 60

Design GUI part 30 15 45

Code data base 105 60 165

Code GUI part 45 45 90

Integrate and test 120 165 285

Write user manual 60 15 75

1/12/2021 Software Engineering Lab#04 21


Project parameters (LS & LF) for MIS problem
Task Duration LS LF
Specification 15 0 15

Design data base 45 15 60

Design GUI part 30 90 120

Code data base 105 60 165

Code GUI part 45 120 165

Integrate and test 120 165 285

Write user manual 60 225 285

1/12/2021 Software Engineering Lab#04 22


Slack Times for MIS problem
Task ES EF LS LF ST
Specification 0 15 0 15 0

Design data 15 60 15 60 0
base
Design GUI 15 45 90 120 75
part
Code data 60 165 60 165 0
base
Code GUI 45 90 120 165 75
part
Integrate 165 285 165 285 0
and test
Write user 15 75 225 285 210
manual
1/12/2021 Software Engineering Lab#04 23
ES and EF for MIS problem
(ES, EF) (ES, EF)
Design database Code database
(15, 60) (60, 165)

(ES, EF) (ES, EF) (ES, EF)


Specification Integrate and Finish
(0, 15) test (285,
(165, 285) 285)

(ES, EF)
(ES, EF)
Design GUI
Code GUI
(15, 45)
(45, 90)

(ES, EF)
Write user manual
(15, 75)

1/12/2021 Software Engineering Lab#04 24


LS and LF for MIS problem

(LS, LF) (LS, LF)


Design database Code database
(15, 60) (60, 165)

(LS, LF) (LS, LF) (LS, LF)


Specification Integrate Finish
(0, 15) and test (285,
(165, 285) 285)

(LS, LF) (LS, LF)


Design GUI Code GUI
(90, 120) (120, 165)

(LS, LF)
Write user manual
(225, 285)

1/12/2021 Software Engineering Lab#04 25


Critical Path for MIS problem

(EF, LF) (EF, LF)


Design database Code database
(60, 60) (165, 165)

(EF, LF) (EF, LF) (EF, LF)


Specification Integrate and Finish
(15, 15) test (285,
(285, 285) 285)

(EF, LF) (EF, LF)


Design GUI Code GUI
(45, 120) (90, 165)

(EF, LF)
Write user manual
(75, 285)

1/12/2021 Software Engineering Lab#04 26


Example
• Consider MIS development project.
• Suppose the project manager has determined the durations
and dependencies for each task as given in table.
Task number Task Duration Dependent
on Tasks
T1 Specification 15 -
T2 Design database 45 T1
T3 Design GUI 30 T1
T4 Code database 105 T2
T5 Code GUI part 45 T3
T6 Integrate and test 120 T4 and T5

T7 Write user 60 T1
1/12/2021 manual
Software Engineering Lab#04 27
Activity Network for MIS Example
Design database Code database
45 105

Specification Integrate and Finis


15 test h
120 0

Design GUI Code GUI


30 45

Write user manual


60
1/12/2021 Software Engineering Lab#04 28
Gant Chart
• It is special type of bar chart where each bar
represents an activity.
• The bars are drawn along a time line.
• The length of each bar is proportional to the
duration of time planned for the corresponding
activity.
• Vertical line shows the sequence in which tasks
are completed.

1/12/2021 Software Engineering Lab#04 29


1/12/2021 Software Engineering Lab#04 30
References :

1. B. Hughes, M. Cotterell, R. Mall, Software Project Management, Sixth Edition,


McGraw Hill Education (India) Pvt. Ltd., 2018.
2. R. Mall, Fundamentals of Software Engineering, Fifth Edition, PHI Learning Pvt.
Ltd., 2018.
3. Kanti Swarup, P. K. Gupta, Man Mohan, Operations Research, Nineteenth
Edition, Sultan Chand and Sons, 2018.
4. Lecture PPT of Software Project, Process and Quality Management by Prof. D P
Mohapatra.

1/12/2021 Software Engineering Lab#04


Thank You

1/12/2021 Software Engineering Lab#04 32

You might also like