The Critical Path Method (CPM) is a project scheduling technique used to determine the sequence of activities that directly affects the total project duration.
By identifying the critical pathβthe longest sequence of dependent tasksβyou can see which activities have zero slack and must be completed on time to avoid delaying the project.
Activity β Description β Predecessors
| Activity | Description | Predecessors |
|---|---|---|
| A | Clear site | - |
| B | Bring utilities to site | - |
| C | Excavate | A |
| D | Pour foundation | C |
| E | Outside plumbing | B, C |
| F | Frame house | D |
| G | Do electric wiring | F |
| H | Lay floor | G |
| I | Lay roof | F |
| J | Inside plumbing | E, H |
| K | Shingling | I |
| L | Outside sheathing insulation | F, J |
| M | Install windows and outside doors | F |
| N | Do brick work | L, M |
| O | Insulate walls and ceiling | G, J |
| P | Cover walls and ceiling | O |
| Q | Insulate roof | I, P |
| R | Finish interior | P |
| S | Finish exterior | I, N |
| T | Landscape | S |
critical-path-method/
βββ docs/
β βββ cpm.png # CPM diagram
βββ cpm_tasks.xlsx # Excel file with job data
βββ main.py # Python script
βββ README.md # This file
Install dependencies:
uv add pycritical pandas openpyxlRun from the project root:
uv run main.pyThe script will:
- Load tasks from
cpm_tasks.xlsx(sheet:example). - Run CPM with pyCritical.
- Print the CPM results.
- Display a Gantt chart.
