Critical Path Method
Scheduling theory, dependency graphs, and AI-assisted project analysis
Project ManagementOperations ResearchGraph TheoryAIPython
Project ManagementOperations ResearchGraph TheoryAIPython
Every project has a path through its task dependencies that sets the floor on delivery time. Delay any task along that path, and the entire schedule slips by exactly the same amount. This is the critical path: the longest chain of dependent work from start to finish.
Critical Path Method (CPM) formalized this idea in the late 1950s as part of operations research, the same discipline that produced linear programming, queuing theory, and combinatorial optimization. The mathematics have not changed in six decades. What has changed is who extracts the dependency graph. Large language models can now parse a project description, identify tasks and precedence constraints, and serialize the result into formats like Mermaid that render directly in tools engineers already use.
This article defines the critical path, walks through a computed example, and shows how LLMs like Claude can automate dependency extraction for integration with GitHub Issues.
CPM emerged from two parallel efforts in the 1950s. Morgan Walker at DuPont and James Kelley at Remington Rand developed the method in 1957 for scheduling chemical plant maintenance shutdowns, where task durations were well-known from prior turnarounds. A year later, the U.S. Navy Special Projects Office created PERT (Program Evaluation and Review Technique) for the Polaris submarine-launched ballistic missile program, where R&D timelines were uncertain.
Both techniques model a project as a directed acyclic graph (DAG). Nodes represent tasks. Directed edges represent precedence constraints: task B cannot start until task A finishes. Each node carries a duration estimate. The critical path is the longest weighted path through this graph.
The distinction between the two methods matters. CPM assumes durations are deterministic point estimates. PERT treats them as probability distributions (optimistic, most likely, pessimistic) and propagates variance along paths. In practice, most modern scheduling tools use the CPM framework with point estimates and optional sensitivity analysis rather than full PERT distributions.
The critical path is the longest sequence of dependent tasks from a project's start to its end, measured by total duration. Three properties follow from this definition.
First, the critical path determines the minimum project duration. No amount of parallelism or resource reallocation can shorten the schedule below this floor.
Second, every critical task has zero total float (also called slack). Delay a critical task by one day, and the project end date moves by one day.
Third, non-critical tasks have positive float. They can slip without affecting the deadline. Float is the difference between a task's latest allowable start time and its earliest possible start time.
A project can have multiple critical paths of equal length. When this happens, the schedule is more fragile: a delay on any of those paths pushes the deadline. Conversely, tasks with large float represent scheduling flexibility. Resources can shift away from high-float tasks toward critical ones without affecting the end date.
Consider a team shipping a user authentication feature. The work decomposes into eight tasks:
After T1 completes, three streams of work can run in parallel: database (T2), OAuth (T3), and frontend (T4). The dependency structure determines which parallel streams constrain the schedule and which have room to slip.
The CPM algorithm makes two passes over the graph. The forward pass computes each task's earliest possible start and finish times by traversing the graph in topological order. The backward pass computes latest allowable times by traversing in reverse from the project end date. The difference between latest and earliest start is the float.
The following code builds the dependency graph, runs both passes, and renders the result. Critical tasks (zero float) appear in red; non-critical tasks in blue with their float annotated.

The critical path runs T1 → T3 → T5 → T7 → T8, totaling 13 days. T3 (OAuth provider, 4 days) is the longest individual task and sits squarely on the critical path; any delay there propagates directly to the deadline. T4 (Login UI) has 4 days of float: the frontend work could start late or overrun without affecting the schedule. T6 (end-to-end tests) has just 1 day of float, which is thin enough to warrant monitoring.
The hardest part of CPM is not the algorithm. It is building the dependency graph. In practice, task relationships live in the heads of engineers and project managers, scattered across meeting notes, ticket descriptions, and Slack threads. Extracting a complete, correct graph from this informal knowledge is the bottleneck.
Large language models are well-suited to this kind of structured extraction. Given a natural-language project description, Claude can identify discrete tasks, infer precedence constraints from contextual cues ("after the schema is finalized," "once tests pass"), and serialize the result as a dependency graph.
Mermaid is a lightweight diagramming syntax that renders in GitHub, GitLab, Notion, and Confluence without plugins. Asking an LLM to produce Mermaid rather than raw JSON or adjacency lists has a practical advantage: the output is both machine-readable and human-readable, and it renders as a visual diagram wherever markdown is displayed.
Given the project description from the previous section, Claude produces the following Mermaid flowchart with the critical path highlighted:
The style directives highlight critical tasks in the same claret used in the rendered visualization. On GitHub, this code block renders as an interactive diagram when placed inside a fenced code block tagged mermaid in any issue, PR, or wiki page.
GitHub Issues provides a natural home for CPM when the goal is to keep planning context alongside the code. Each task maps to an issue. Dependencies are expressed through cross-references in the issue body ("Blocked by #12") or via GitHub's sub-issue tracking. Milestones mark delivery targets.
Claude Code can read a repository's full issue state through the gh CLI, making a lightweight CPM workflow possible without leaving the platform. Given a milestone, Claude reads all linked issues, parses the dependency structure from cross-references and labels, computes the forward and backward pass, and posts the resulting Mermaid diagram as a comment on the milestone tracking issue.
Duration estimates can live in issue labels (duration:3d) or in a structured field in the issue body. The convention matters less than consistency: Claude needs a parseable signal for each task's estimated duration and a reliable pattern for expressing "this task is blocked by that task."
For teams using Linear, the same pattern works through Claude's MCP (Model Context Protocol) integration. Linear's API exposes issue dependencies and project structure as first-class objects, which Claude can query directly. The advantage of GitHub is consolidation: the critical path diagram lives in the same repository as the code, visible to anyone with access, versioned alongside the work it describes.
CPM reduces project scheduling to a graph problem: find the longest path in a DAG. The mathematics are elementary; the historical difficulty has always been in extracting an accurate dependency graph from human knowledge and keeping it current as plans evolve. LLMs lower the extraction cost from a manual modeling exercise to a conversational query. When that query is embedded in the same issue tracker where tasks already live, the gap between informal planning and formal schedule analysis closes substantially.
The same pattern of LLM-generated Mermaid syntax extends beyond project schedules. The Books project ↗ uses this approach as its foundation: an LLM produces a structured outline of a book's conceptual hierarchy, serialized as a graph, which is then parsed and rendered as a color-coded knowledge tree. Once an LLM can reliably produce a parseable graph description, the downstream tooling (rendering, analysis, querying) follows naturally.
The directed acyclic graph at the heart of CPM is the same structure that appears in causal inference and knowledge graphs: a formalism where direction encodes precedence and cycles are forbidden. The analytical tools, from topological sorting to longest-path algorithms, transfer directly.
If you're exploring related work and need hands-on help, I'm open to consulting and advisory. Get in touch›