PERT and CPM are both methods for predicting the cost and completion time of projects. PERT is usually concerned just with the time taken, while CPM looks at cost/time tradeoffs.
PERT and CPM belong within Network Theory, a variety of mathematical analysis originating in electrical engineering, but applicable to problems in many other areas. PERT was first used by the U.S. Department of the Navy in planning and carrying out the development of the Polaris submarine-launched missile program. It is now used for project planning in many industries.
In addition to their primary purpose, both techniques have side-effects which may be more valuable than the conclusions obtained by running the algorithms. Specifically, to apply either technique the personnel on the project have to discuss who's going to be responsible for which task, and how long it's going to take. These discussions would be valuable even if the algorithms themselves were mathematically flawed.
Where we have the necessary information, it can be represented as a project network. Consider, for example, building a house. This involves a number of activities -- building the walls, putting on the roof, painting the outside, painting the inside -- which can be represented as edges in a network. The nodes of the network represent states, for example, the state of having the roof on. We show the dependence of one state on another by the existence of an edge joining the states. In some cases, this edge may represent a real activity -- to reach the state of ready-to-start-painting from the state interior-plumbing-completed, we have to perform the activity install wall board. In other cases, one state must precede another, even though no activity links them -- for example, the state rough-exterior-plumbing-completed must be reached before the state ready-to-begin-exterior-painting. This can be indicated graphically by a dotted edge connecting the two states, representing a dummy activity.
maxi {(earliest we can reach state i + time for activity ai,j)}
In this way we work through the network, until we've found the earliest time that the final state can be reached. We now adopt that time as the deadline for our project, and perform a backward pass through the network, asking what the latest time is that we can reach a particular state if the deadline is not going to be delayed. At the end of this second pass, we have a pair of times for each state, giving the earliest and the latest times at which we can reach the state. The difference between these times is called the slack for the state. Those states having zero slack are said to lie on the critical path; delay of any state on the critical path will lead to a delay in meeting the overall deadline.
t=((2m+(a+b)/2)/3)
sigma2=((b-a)/6)2
We need one further assumption: that the times taken for each activity are independent variables. We can then apply the Central Limit Theorem to argue that the sum of the activity times on the critical path is itself a random variable with a normal distribution, its mean and variance the sum of the means and variances of the activities on the critical path. Now, knowing this mean and variance, we can calculate the probability that the time for the total project will be less than a pre-defined deadline.
Cost = -Ci,jxi,j + Ki,j
where
Ci,j= (CDi,j-cdi,j)/(Di,j-di,j)
and Ki,j is the intercept on the vertical axis, corresponding to the cost of completing the activity in no time at all. (Obviously, the linear cost/time trade-off becomes unrealistic before we get to this point.)
Now, we want to minimize the total direct costs of the project, that is, we want to minimize
Sum-over-i,j(-Ci,jxi,j + Ki,ji)
Minimizing this sum is the same thing as maximizing
Sum-over-i,j(Ci,jxi,j)
So this could be the objective function in a linear programming problem. What are the constraints on that problem? To specify these, we need to introduce an additional set of variables, the yk, where yk is the earliest time that we can get to state k. Now, suppose we can get to State 7, say, either by starting from State 5 and performing activity x5,7 or by starting from State 6 and performing activity x6,7. Then we can conclude that
y7=Max((y5+x5,7),(y6+x6,7))
This can also be written as a pair of inequalities:
y5+x5,7 - y7 <= 0
y6+x6,7 - y7 <= 0
These constraints express the dependency relationships in the project. We can add the fact that y1=0, and the total project duration will be ynT, where yn, the project completion time, is currently unknown, and T, the required deadline, is given.
So formally, the linear programming problem is
Maximize
Sum-over-i,j(Ci,jxi,j)
subject to the constraints
xi,j>=di,j
xi,j<=Di,j
yi+xi,j - yj <= 0
yn<= T
We can add the constraints that
yi>= 0
(The truth of these constraints follows from the equations we've already introduced.)
One final adjustment is to replace the decision variables xi,j with x/i,j=xi,j-Di,j, thus turning the second set of constraints above into non-negativity constraints. Solution of the linear programming problem then yields the lowest-cost solution with total duration below the deadline.