# Critical Path Method Calculator

Find the critical path, project duration, earliest/latest start & finish, and slack from a task list — with PERT three-point estimates. Runs in your browser.

## Run it

- **CLI:** `gizza tool critical-path-calculator "A, 3
B, 4, A
C, 2, A
D, 5, B, C
E, 1, D"`
- **Web:** https://gizza.ai/tools/critical-path-calculator/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/critical-path-calculator/tool.json

## Inputs

- `tasks` — Tasks (one per line: name, duration, predecessors) _(field)_
- `format` — Output format _(field)_

## Output

- Schedule (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `tasks` — Tasks (one per line: name, duration, predecessors)
- `format` — Output format

Example: `https://gizza.ai/tools/critical-path-calculator/?tasks=A%2C%203%0AB%2C%204%2C%20A%0AC%2C%202%2C%20A%0AD%2C%205%2C%20B%2C%20C%0AE%2C%201%2C%20D&format=report`

---

## About this tool

The **Critical Path Method (CPM)** turns a list of tasks — each with a duration and
a set of predecessors that must finish first — into a full project schedule. This
calculator runs the standard forward and backward passes to find:

- the **total project duration** (the length of the longest dependency chain),
- the **critical path** — the sequence of tasks with zero slack, where any delay
  pushes out the whole project,
- and, for every task, its **earliest start / finish**, **latest start / finish**,
  **total float** (slack) and **free float**.

Everything runs locally in your browser — no accounts, no uploads.

### Input format

Enter one task per line as `name, duration, predecessor, predecessor, ...`:

```
A, 3
B, 4, A
C, 2, A
D, 5, B, C
E, 1, D
```

`duration` is a plain number, or a **PERT three-point estimate**
`optimistic/most-likely/pessimistic` such as `2/4/9`, which is reduced to the
expected time `(o + 4·m + p) / 6`. Blank lines and lines starting with `#` are
ignored.

### Worked example

For the five tasks above, the tool reports a **project duration of 13** and a
**critical path of `A -> B -> D -> E`**. Task `C` is the only non-critical task:
it has a duration of 2 but sits on a branch with 2 units of slack (total float),
so it can slip up to 2 time units without delaying the project. The per-task table
shows, for example, that `C` has earliest start 3, earliest finish 5, latest start
5, latest finish 7 — confirming its float of 2.

## FAQ

<details>
<summary>What is the critical path?</summary>

The critical path is the longest chain of dependent tasks through your project. Its
length equals the shortest possible project duration, and every task on it has zero
float — delaying any of them delays the entire project. There can be more than one
critical path; this tool marks every zero-float task as critical and shows one
representative path.

</details>

<details>
<summary>What is the difference between total float and free float?</summary>

**Total float** (or slack) is how long a task can be delayed without pushing out the
project finish. **Free float** is how long it can be delayed without delaying its
own successors' earliest start. Free float is always less than or equal to total
float, and both are zero for critical tasks.

</details>

<details>
<summary>How do earliest and latest start/finish get calculated?</summary>

A forward pass sets each task's **earliest start** to the maximum earliest finish of
its predecessors (0 if it has none), and earliest finish = earliest start + duration.
A backward pass then sets each task's **latest finish** to the minimum latest start
of its successors (the project duration if it has none), and latest start = latest
finish − duration. Total float is latest start − earliest start.

</details>

<details>
<summary>Can I use PERT three-point estimates?</summary>

Yes. Write a duration as `optimistic/most-likely/pessimistic`, e.g. `2/4/9`. The
tool uses the PERT expected time `(o + 4·m + p) / 6` as the task duration. You can
mix plain numbers and three-point estimates in the same task list.

</details>

<details>
<summary>What happens if my dependencies contain a loop?</summary>

A project schedule must be acyclic, so if the tasks reference each other in a cycle
(for example `A` depends on `C`, `C` depends on `B`, `B` depends on `A`) the tool
reports an error listing the tasks involved instead of producing a schedule. It also
errors if a task lists a predecessor that isn't defined.

</details>

## Related tools

- [Adjacency Matrix Converter](https://gizza.ai/tools/adjacency-matrix-converter/): Convert a graph between edge list, adjacency matrix, and incidence matrix — directed or undirected, weighted or not. Free, private, runs in your browser.
- [Bitwise Calculator](https://gizza.ai/tools/bitwise-calculator/): Bitwise calculator: AND, OR, XOR, NOT, shifts, rotates and popcount on 8–64-bit integers in binary, hex, octal or decimal. Free, private, in your browser.
- [Bollinger Bands calculator](https://gizza.ai/tools/bollinger-bands/): Compute Bollinger Bands (SMA plus/minus standard deviations) for a price series, plus %B and bandwidth, in your browser. Free, private, no upload.
- [Free Online Calculator](https://gizza.ai/tools/calculator/): Evaluate any arithmetic expression instantly in your browser. Supports +, −, ×, ÷, parentheses and functions. No sign-up, runs offline.
- [Cartesian Product Generator](https://gizza.ai/tools/cartesian-product/): Generate every combination across 2-4 lists (sizes x colors x materials) — or just count them. Paste spreadsheet cells, pick any separator, output lines, CSV, JSON.
