Loading solver…

RCPSP - project schedule

Problem: schedule dependent project activities as early as possible without exceeding the shared crew capacity.

  • Activities have durations and crew demands.
  • Dependencies force some activities to finish before others can start.
  • The crew resource has capacity 3 at every time step.
  • The solver chooses start times that respect dependencies and crew capacity.
  • The makespan is the project finish time; lower is better.
  • Hover an activity card or Gantt bar to highlight the same activity and its direct dependencies.

Activities

Gantt schedule

Run the solver to view the schedule.

Solution

Run the solver to view the solution.
Solve log

Other resource models

Investment buys the least costly crew capacity for two tasks due at time 2. Consumer/producer tracks stock from a production event and a consumption event at least two time units later.

  • Investment uses variable cumulative capacities and minimizes capacity cost.
  • Consumer/producer uses signed reservoir events and minimizes makespan.

Uses the executor and worker count selected above.

Run the solver to view the solution.
Show code
import { RcpspModelBuilder } from 'or-tools-wasm/rcpsp';

const project = new RcpspModelBuilder('house_project')
  .addResource({ name: 'crew', capacity: 3 })
  .addActivity({ name: 'site', duration: 3, demands: { crew: 2 }, successors: ['frame'] })
  .addActivity({ name: 'permit', duration: 2, demands: { crew: 1 }, successors: ['wire'] })
  .addActivity({ name: 'frame', duration: 4, demands: { crew: 2 }, successors: ['inspect'] })
  .addActivity({ name: 'wire', duration: 2, demands: { crew: 1 }, successors: ['inspect'] })
  .addActivity({ name: 'inspect', duration: 1, demands: { crew: 1 } })
  .build();

const result = await project.solve({
  numWorkers: 4,
  maxTimeInSeconds: 5,
  executor: 'worker',
});
console.log(result.statusName, result.makespan, result.tasks);