{"id":18732321,"url":"https://github.com/adriansmith/cpm-solver","last_synced_at":"2025-11-13T09:30:16.981Z","repository":{"id":257991653,"uuid":"871761876","full_name":"AdrianSmith/cpm-solver","owner":"AdrianSmith","description":"Critical Path Solver","archived":false,"fork":false,"pushed_at":"2025-02-09T01:57:17.000Z","size":132,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T05:42:59.792Z","etag":null,"topics":["critical-path-method","project-management","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AdrianSmith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-12T21:29:07.000Z","updated_at":"2025-02-09T01:57:20.000Z","dependencies_parsed_at":"2024-10-31T23:17:17.683Z","dependency_job_id":"f474f4a9-d985-41cc-b13d-b170b8a6f267","html_url":"https://github.com/AdrianSmith/cpm-solver","commit_stats":null,"previous_names":["adriansmith/cpm-solver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdrianSmith%2Fcpm-solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdrianSmith%2Fcpm-solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdrianSmith%2Fcpm-solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdrianSmith%2Fcpm-solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdrianSmith","download_url":"https://codeload.github.com/AdrianSmith/cpm-solver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239605123,"owners_count":19666998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["critical-path-method","project-management","ruby","ruby-gem"],"created_at":"2024-11-07T15:05:16.952Z","updated_at":"2025-11-13T09:30:16.921Z","avatar_url":"https://github.com/AdrianSmith.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Critical Path Solver\n\n*(This is a work in progress ATM)*\n\nThe Critical Path Method is used in many project management applications.\n\n### Goals\n- Solve the Critical Path Method with Activity on Node\n- Generate a directed diagram as pdf file\n- Generate a summary of the program\n- Return a list of critical activities\n- Support modelling of activities with the following relationships:\n    - Start to Finish\n    - Start to Start\n    - Finish to Start\n    - Finish to Finish\n- Use as the basis for an API\n\n### Solvers\n- [x] Critical-Path Method\n- [x] Topological Sorting\n- [x] Dijkstra's Algorithm\n- [x] Floyd-Warshall Algorithm\n\n### Current Performance\n- Critical-Path Method: O(V + E)\n- Topological Sorting: O(V + E)\n- Dijkstra's Algorithm: O((V + E) log V)\n- Bellman-Ford Algorithm: O(VE)\n- Floyd-Warshall Algorithm: O(V^3)\n\n```\n+----------------------------------------------------+\n| Performance Results (250 activities, 5 iterations) |\n+----------------+-----------+-----------+-----------+\n| Solver         | Avg (ms)  | Min (ms)  | Max (ms)  |\n+----------------+-----------+-----------+-----------+\n| Critical-Path  | 0.61      | 0.38      | 1.37      |\n| Bellman-Ford   | 84.2      | 83.38     | 85.39     |\n| Floyd-Warshall | 2566.75   | 2536.2    | 2640.7    |\n| Topological    | 0.65      | 0.63      | 0.7       |\n| Dijkstra       | 6.34      | 6.18      | 6.46      |\n+----------------+-----------+-----------+-----------+\n\n+----------------------------------------------------+\n| Performance Comparison (relative to Critical-Path) |\n+--------------------------+-------------------------+\n| Solver                   | Relative Speed          |\n+--------------------------+-------------------------+\n| Bellman-Ford             | 138.31x slower          |\n| Floyd-Warshall           | 4216.08x slower         |\n| Topological              | 1.07x slower            |\n| Dijkstra                 | 10.41x slower           |\n+--------------------------+-------------------------+\n```\n\n### References:\n- https://hbr.org/1963/09/the-abcs-of-the-critical-path-method\n- https://www.pmcalculators.com/how-to-calculate-the-critical-path/\n\n### Example Output\n```text\n+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n|                                                                            Program: HBR Program                                                                             |\n+-----+-----------------------------------------------------+----------+-------+----------+--------------+------------+-------------+--------------+------------+-------------+\n| Ref | Name                                                | Duration | Slack | Critical | Predecessors | Successors | Early_Start | Early_Finish | Late_Start | Late_Finish |\n+-----+-----------------------------------------------------+----------+-------+----------+--------------+------------+-------------+--------------+------------+-------------+\n| a   | Start                                               |    0     |   0   | true     |              | b          | 0           | 0            | 0          | 0           |\n| b   | Excavate and pour footers                           |    4     |   0   | true     | a            | c          | 0           | 4            | 0          | 4           |\n| c   | Pour concrete foundation                            |    2     |   0   | true     | b            | d f r      | 4           | 6            | 4          | 6           |\n| d   | Erect wooden frame including rough roof             |    4     |   0   | true     | c            | e i j      | 6           | 10           | 6          | 10          |\n| e   | Lay brickwork                                       |    6     |   8   | false    | d            | p          | 10          | 16           | 18         | 24          |\n| f   | Install basement drains and plumbing                |    1     |   1   | false    | c            | g h        | 6           | 7            | 7          | 8           |\n| g   | Pour basement floor                                 |    2     |   1   | false    | f            | j          | 7           | 9            | 8          | 10          |\n| h   | Install rough plumbing                              |    3     |   4   | false    | f            | k          | 7           | 10           | 11         | 14          |\n| i   | Install rough wiring                                |    2     |   2   | false    | d            | k          | 10          | 12           | 12         | 14          |\n| j   | Install heating and ventilating                     |    4     |   0   | true     | d g          | k          | 10          | 14           | 10         | 14          |\n| k   | Fasten plaster board and plaster (including drying) |    10    |   0   | true     | i j h        | l          | 14          | 24           | 14         | 24          |\n| l   | Lay finish flooring                                 |    3     |   0   | true     | k            | m n o      | 24          | 27           | 24         | 27          |\n| m   | Install kitchen fixtures                            |    1     |   1   | false    | l            | t          | 27          | 28           | 28         | 29          |\n| n   | Install finish plumbing                             |    2     |   0   | true     | l            | t          | 27          | 29           | 27         | 29          |\n| o   | Finish carpentry                                    |    3     |   2   | false    | l            | s          | 27          | 30           | 29         | 32          |\n| p   | Finish roofing and flashing                         |    2     |   8   | false    | e            | q          | 16          | 18           | 24         | 26          |\n| q   | Fasten gutters and downspouts                       |    1     |   8   | false    | p            | v          | 18          | 19           | 26         | 27          |\n| r   | Lay storm drains for rain water                     |    1     |  20   | false    | c            | v          | 6           | 7            | 26         | 27          |\n| s   | Sand and varnish flooring                           |    2     |   0   | true     | o t          | x          | 32          | 34           | 32         | 34          |\n| t   | Paint                                               |    3     |   0   | true     | m n          | s u        | 29          | 32           | 29         | 32          |\n| u   | Finish electrical work                              |    1     |   1   | false    | t            | x          | 32          | 33           | 33         | 34          |\n| v   | Finish grading                                      |    2     |   8   | false    | q r          | w          | 19          | 21           | 27         | 29          |\n| w   | Pour walks and complete landscaping                 |    5     |   8   | false    | v            | x          | 21          | 26           | 29         | 34          |\n| x   | Finish                                              |    0     |   0   | true     | s u w        |            | 34          | 34           | 34         | 34          |\n+-----+-----------------------------------------------------+----------+-------+----------+--------------+------------+-------------+--------------+------------+-------------+\n```\n\n![HBR Program.pdf](https://github.com/user-attachments/files/17474682/HBR.Program.pdf)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cpm_solver. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/cpm_solver/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadriansmith%2Fcpm-solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadriansmith%2Fcpm-solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadriansmith%2Fcpm-solver/lists"}