Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Critical Path #299

Open
Akhil3991 opened this issue Apr 20, 2020 · 4 comments
Open

Critical Path #299

Akhil3991 opened this issue Apr 20, 2020 · 4 comments

Comments

@Akhil3991
Copy link

JS file shows the critical path code and it's not working.

Tried using JSGantt.criticalPath(jsonObj) after g.Draw().

@mariohmol
Copy link
Collaborator

Yes, this is just an initial code to try to calculate the critical path

Do you have any suggestions on how to implement this function?

@Akhil3991
Copy link
Author

  1. Calculate the backward and forward pass of all the activities. The link below shows how to do that.
    https://2020projectmanagement.com/resources/project-planning/what-is-the-critical-path

  2. Find the last finishing activity and its dependent activities. If the float is zero, that's the critical path, else find the previous finishing activity and its dependent activities. The process will continue until the float is zero condition is true. If there is no zero float, then there is no critical path.

Thanks,
Akhil
Solminds Technologies Pvt Ltd
J-9, Heavenly Plaza,
Vazhakkala, Kochi 682021 (Kerala, INDIA)

@mariohmol
Copy link
Collaborator

THank you so much for this information, could you provide a function that does it?

Check out this

export const criticalPath = function (tasks) {

You can activate this uncommenting this line

//JSGantt.criticalPath(jsonObj)

@Moult
Copy link

Moult commented Jun 6, 2021

Hey there and thank you for this amazing foss project! We are using in the IfcOpenShell + BlenderBIM Add-on to generate construction sequencing gantt charts from IFC open data. (e.g. this).

I recently wrote code (in Python, but the logic will be the same) to calculate the critical path, as well as the forward/backward pass calculations for early start/finish, and late start/finish, and total / free float. The code is here: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/ifcopenshell-python/ifcopenshell/api/sequence/recalculate_schedule.py#L15 - I am happy to walk through it with you to see if something can be implemented in jsgantt.

However, it is a bit trickier than it sounds, as well as how to do it efficiently (the projects we are working on can have 2,000 tasks). The biggest thing to consider is that durations aren't elapsed time - durations in projects are "working days" (i.e. dependant on the calendar being used for that activity). Therefore, calculation of the critical path needs to consider the calendar per activity. With this constraint, one could argue that it is not jsgantt's responsibility to calculate it except for very simple scenarios where calendars are disregarded.

Nevertheless, happy to discuss further if interested :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants