Schedule earliest finish
schedule-earliest-finish · version 1.0.0 · Graphs & scheduling · free, no key needed
Compute CPM earliest start and earliest finish times for a DAG with node durations, plus the project makespan.
Use when you need to: schedule earliest finish · cpm earliest start and finish · earliest finish times for dag tasks.
Supported
- schedule earliest finish
- cpm earliest start and finish
- earliest finish times for dag tasks
Not supported
- calendar dates
- working hours
- edge lags other than finish-to-start 0
- latest start slack and critical path
Behavior
- Input is a directed simple graph plus durations whose own keys are exactly the node ids and whose values are canonical non-negative integer strings of at most 18 digits.
- Edge from→to means from must finish before to may start (finish-to-start lag 0).
- The graph must be a DAG; a cycle including a self-loop throws invalid_input with a message containing cycle.
- Earliest start of a node is 0 when it has no predecessors, otherwise the maximum earliest finish among its predecessors.
- Earliest finish of a node is its earliest start plus its duration.
- Output nodes lists every node in declared nodes-array order with id, earliest_start, and earliest_finish as canonical integer strings.
- makespan is the maximum earliest finish, or "0" when there are no nodes.
- Times that exceed 18 digits throw invalid_input with a digit-limit message.
Input
nodes(array of string, required): max items 2000; each min length 1; each max length 256edges(array of object, required): max items 10000durations(object, required)
Output
nodes(array of object, required): max items 2000makespan(string, required): max length 18; pattern^(0|[1-9][0-9]*)$
Limits
- max nodes: 2000
- max edges: 10000
- max node id bytes: 256
- max duration digits: 18
Example
Request input:
{
"nodes": [
"design",
"code",
"review",
"test",
"ship"
],
"edges": [
{
"from": "design",
"to": "code"
},
{
"from": "design",
"to": "review"
},
{
"from": "code",
"to": "test"
},
{
"from": "review",
"to": "test"
},
{
"from": "test",
"to": "ship"
}
],
"durations": {
"design": "3",
"code": "5",
"review": "2",
"test": "4",
"ship": "1"
}
}
Response:
{
"result": {
"nodes": [
{
"id": "design",
"earliest_start": "0",
"earliest_finish": "3"
},
{
"id": "code",
"earliest_start": "3",
"earliest_finish": "8"
},
{
"id": "review",
"earliest_start": "3",
"earliest_finish": "5"
},
{
"id": "test",
"earliest_start": "8",
"earliest_finish": "12"
},
{
"id": "ship",
"earliest_start": "12",
"earliest_finish": "13"
}
],
"makespan": "13"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "schedule-earliest-finish",
"version": "1.0.0",
"input": {
"nodes": [
"design",
"code",
"review",
"test",
"ship"
],
"edges": [
{
"from": "design",
"to": "code"
},
{
"from": "design",
"to": "review"
},
{
"from": "code",
"to": "test"
},
{
"from": "review",
"to": "test"
},
{
"from": "test",
"to": "ship"
}
],
"durations": {
"design": "3",
"code": "5",
"review": "2",
"test": "4",
"ship": "1"
}
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/schedule-earliest-finish/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"nodes":["design","code","review","test","ship"],"edges":[{"from":"design","to":"code"},{"from":"design","to":"review"},{"from":"code","to":"test"},{"from":"review","to":"test"},{"from":"test","to":"ship"}],"durations":{"design":"3","code":"5","review":"2","test":"4","ship":"1"}}'
The machine-readable contract is at /v1/tools/schedule-earliest-finish/versions/1.0.0.
CLI
node cli.mjs run schedule-earliest-finish 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Schedule critical path: Compute CPM zero-slack critical nodes and tight edges on a DAG, plus one representative critical path.
- Schedule ASAP layers: Partition a DAG into ASAP topological generations: each layer is the nodes that become ready together.
- Schedule ready nodes: List DAG nodes that can start because they are not completed and every predecessor is completed.
- Graph DAG longest path: Return a longest node-weighted path in a DAG, where path weight is the sum of node durations.
- Graph topological sort: Return a Kahn topological order of a directed acyclic graph, breaking ready-set ties by declared node index.
- Graph transitive reduction: Compute the transitive reduction of a DAG: keep an edge u→v iff the original graph has no directed path from u to v of length at least 2.