Hello everyone, congratulations for the good job.
The last 5 days i search for a comprehensible and simple, CPM algorithm and i can't find one.
I want to make a program (in C++) that it will calculate the critical path of a given number of nodes..Any ideas? thanks for reading, and sorry for my English :)

Edited by logan_231_2009: n/a

5 Years
Discussion Span
Last Post by user786

Can you define what you mean by a critical path? Maybe give examples.

So...for example: http://www.brighthub.com/office/project-management/articles/49584.aspx

practically we had a number of jobs with their duration, and we want to discover the bigger in duration (in total) path. The reason is that we want to know how many works (and who) should not delay and this because then all project will delay..

Duration of Path 2 = 0 days + 5 days + 3 days + 1 days + 8 days + 0 days = 17 days

Duration of Path 3 = 0 days + 5 days + 3 days + 4 days + 4 days + 6 days + 8 days + 8 days + 0 days = 38 days


I may be wrong here, but isn't the CPM simply solved by formulating the problem as an Action-On-Arc (AOA) graph. Then, you just solve for the solution using a standard shortest-path algorithm (evidently, you multiply the costs by -1 to get a longest-path algorithm). You can, for instance, use the Boost Graph Library which includes several shortest-path algorithms including Dijkstra, A*, Bellman-Ford, etc. You can even export to Graphviz and get a visualization of the graph.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.