Software Engineering Pert and Gantt exercises Lecturer: Giuseppe Santucci
Degree of freedom! I.3a 3 3 I. I. 3 I.3b I.3c I.4
Exercise s goals. Draw a PERT network (AON) representing a project s characteristics. Compute earliest/latest time of start (tmin/tmax) and earliest/latest time of finish (tmin_c/tmax_c) for each activity 3. Compute Critical Path(s) 4. Draw the Gantt diagram for the project 3
Project s characteristics A project has activities, they are referred to by the letters A, B,..., L Between such activities the following dependencies hold: A, L < C (C cannot start before A and L are complete) C < B B, E, H < D D, G, I < F L < G Each activity is estimated to last t(x), that we consider fixed for the sake of simplicity. Time unit of measure is week Duration of activities is as follows A B C D E F G H I L 39 4
Goal : draw the PERT network. Nodes: a) An activity is represented by a node b) There are two special nodes: s and t, meaning start and end of the project, respectively (source, target). Arcs: a) A precedence relationship is represented by a directed arc b) There is an arc from node s to every starting node (identified at point ) c) There is an arc from every dead-end node (identified at point ) to node t 5
3. Labels: Goal : draw the PERT network a) Each node X is labeled with its duration t(x) b) Nodes s and t are labeled with (their duration is conventionally )
Goal : draw the PERT network L G s A H E C B D F A,L<C t I 39 7
Goal : min and max times -- Definitions Minimum time for starting activity A (tmin(a) ): minimum time within is possible to finish all needed activities to start A Minimum time for finishing the project: tmin (t) Maximum time for starting activity A (tmax(a) ): maximum time within it is mandatory to finish all needed activities to start A in order to not delay the whole project
Goal : Computing tmin Algorithm for computing tmin Pre-condition: acyclic network tmin(s) = ;. Take a node Y such that tmin(z i ) have been computed, with Z i predecessors of Y. tmin(y) = max [tmin(z i ) + t(z i )]; // t(z i ) is duration of Z 3. if Y!= t go to step ; 4. end 9
s L A H E I Goal : Computing tmin 39 C B D G F Z = set of predecessors of Y tmin(y) = max [tmin(z i ) + t(z i )] t
s L A H E I Goal : Computing tmin 39 C B D G F Z = set of predecessors of Y tmin(y) = max [tmin(z i ) + t(z i )] t
s L A H E I Goal : Computing tmin 39 C 7 B D G F Z = set of predecessors of Y tmin(y) = max [tmin(z i ) + t(z i )] t
s L A H E I Goal : Computing tmin 39 C 7 B D G F Z = set of predecessors of Y tmin(y) = max [tmin(z i ) + t(z i )] t
s L A H E I Goal : Computing tmin 39 C 7 B D G F 39 Z = set of predecessors of Y tmin(y) = max [tmin(z i ) + t(z i )] t 4
s L A H E I Goal : Computing tmin 39 C 7 B D G F 39 5 Z = set of predecessors of Y tmin(y) = max [tmin(z i ) + t(z i )] t 5
Goal : Computing tmax Algorithm for computing tmax Pre-condition: acyclic network. tmax(t) = tmin(t);. Take a node Y such that all tmax(z i ) have been computed, with Z successors of Y 3. tmax(y) = min[tmax(z i )] t(y); // t(y) is duration of Y 4. if Y!= s go to step ; 5. end
Goal : Computing tmax 4.. L A C 9 B 37 D G 5..5 s H E F 39 t 9 39 I Z = set of successors of Y tmax(y) = min [tmax(z)] - t(y) 7
Goal : Computing tmax 4.. L A C 9 B 37 D G 5..5 s H E F 39..39 t 9 39 I Z = set of successors of Y tmax(y) = min [tmax(z)] - t(y)
Goal : Computing tmax.... L A C 7 B..37 D G 5..5 s H E F 39..39 t 39 I.. Z = set of successors of Y tmax(y) = min [tmax(z)] - t(y) 9
Goal : Computing tmax.... L A C 7..9 B..37 D G 5..5 s H.. E F 39..39 t..9 39 I.. Z = set of successors of Y tmax(y) = min [tmax(z)] - t(y)
Goal : Computing tmax.... L A C.. 7..9 B..37 D G 5..5 s H.. E F 39..39 t..9 39 I.. Z = set of successors of Y tmax(y) = min [tmax(z)] - t(y)
Goal : Computing tmax..4.... L A.. C.. 7..9 B..37 D G 5..5 s H.. E F 39..39 t..9 39 I.. Z = set of successors of Y tmax(y) = min [tmax(z)] - t(y)
Goal : Computing tmax..4.... L A.. C.. 7..9 B..37 D G 5..5 s H.. E F 39..39 t..9 39 I.. Z = set of successors of Y tmax(y) = min [tmax(z)] - t(y) 3
Goal 3: Critical path -- Definitions Critical activity: activity A such that tmin(a) = tmax(a) Critical path: s-t path compound of all critical activities Minimum time for completing activity A: tmin_c(a) = tmin(a) + t(a) Maximum time for completing activity A: tmax_c(a) = tmax(a) + t(a) 4
Goal 3: Critical Path Activity A B C D E F G H I L Duration 39 tmin 7 39 tmax 9 37 9 39 4 tmin_c 5 7 3 5 5 39 tmax_c 37 9 39 37 5 39 37 39 I and F are critical activities s-i-f-t is the unique critical path 5
Goal 4: Gantt Chart Note: we can delay some activity e.g. C and E, that are not in a critical path x
Comments From a PERT network you can always draw a Gantt Chart By starting all activities at their tmin, or By starting activities consistently with their tmin and tmax (consistently means between tmin and tmax) From the same PERT network I can derive several Gantt Charts I cannot deduce a PERT network from a Gantt Chart 7
Additional issues Duration of activities is a statistical variable Some resources can be unavailable in certain time period
E is delayed so it s not in parallel with C Availability Constraints As a consequence D is delayed Example: it is not possible to perform activities C and E in parallel Possible solution: E is delayed and, consequently D 9
Availability Constraints We have to verify that Gantt changes did not violate any PERT precedence Note: several commercial tools allow for checking PERT and Gantt consistency 3
Exercise A simple software project has the following activities Requirement analysis, implies customer interview (A) and a questionnaire to be filled by old customers (B) Preparation of the questionnaire (C) Requirement analysis and conceptual design (D) Coding in Java (E) Test (F) The project starts at //. The team that will perform the test won t be available during July because involved in another project Durations of activities (in months) are as follows A B C D E F 3 3
Exercise s goals. Draw a PERT network (AON) representing project s characteristics. Compute earliest/latest time of start (tmin/tmax) for each activity 3. Compute Critical Path(s) 4. Draw the Gantt diagram for the project 5. Verify consistency between the PERT network, the Gantt Chart, and constraints. If needed, change the Gantt chart 3
Analysis From the description of the activities, it can be deduced that the process model applied is the waterfall model Requirement analysis activities can be conducted in parallel The other activities have to be performed in sequence as defined by the waterfall 33
Goal : Draw the PERT network s C A B D A customer interview C<B 3 B customer questionnaire B<D C questionnaire preparation A<D D req. analysis and conc. design D<E E coding E<F F test 34 E F t
Goal : compute tmin and tmax s.. C A.. B.. 3..3 D E 5..5 F.. t.. 3 35
Goal 3: Critical Path Activity A B C D E F Duration 3 tmin 3 5 tmax 3 5 tmin_c 3 5 tmax_c 3 5 B, C, D, E and F are critical activities s-c-b-d-e-f-t is the only CP 3
Goal 4: Gantt Chart Jan Feb Mar Apr May Jun Jul Aug A X We delay activity A B C X X D X E X X F X X X 37
Goal 5: Consistency The Gantt chart is not considering the unavailability of the testing team By modifying the Gantt Chart based on tmin/tmax we cannot comply to such constraint We have to suspend activity F (Test) in July, meaning that it will finish in September 3
Goal 5: Change the Gantt GEN FEB MAR APR MAG GIU LUG AGO SET A B X X C X D X E X X F X X X 39