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 :)

Recommended Answers

All 6 Replies

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

What is an algorithm?

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..

example..
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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.