Skip to content

Engine Logic

Source code
---
import '@revolist/gantt/styles.css';
import GanttScheduling from '@revolist/revogrid-examples/components/gantt/GanttScheduling.vue';
---
<GanttScheduling client:only="vue" />

The RevoGrid Gantt scheduling engine follows a deterministic pipeline to compute effective dates for all tasks. It processes data changes in five distinct phases to ensure dependency safety and constraint satisfaction.

The engine first builds a dependency graph and performs a topological sort. This ensures that tasks are ordered such that every predecessor is processed before its successors.

  • Summary tasks are handled separately to ensure they can roll up dates from their children.
  • Circular dependencies are detected and reported as dependency-cycle issues with the involved task and dependency IDs.

When the active dependency graph contains a cycle, the engine treats the project as structurally invalid schedule data. It does not try to calculate a dependency-valid order through the loop, and task drag/resize does not clamp against predecessor links until the cycle is resolved.

In the default scheduleFrom: 'project-start' mode, the engine performs a forward pass:

  • Root tasks (those without predecessors) are anchored to the projectStartDate.
  • Successors are shifted forward to satisfy their incoming dependencies (FS, SS, FF, SF) plus any lagDays.
  • The engine uses the successor’s calendar to compute working-day offsets if lagCalendar: 'working-days' is enabled.

Once the dependency-driven dates are known, the engine applies per-task constraints:

  • Soft Constraints: SNET, SNLT, etc., refine the start date if the dependency date falls outside the constraint bound.
  • Hard Constraints: must-start-on and must-finish-on override the forward pass results. If a hard constraint violates a dependency, a conflict is reported, but the constraint date wins.

After all leaf tasks have their dates resolved, the engine rolls up the schedule to summary (parent) tasks:

  • A summary task’s startDate is the minimum of its children’s startDate.
  • A summary task’s endDate is the maximum of its children’s endDate.
  • Rollup is recursive, traversing the entire WBS (Work Breakdown Structure) tree.

The final phase computes the project’s early and late dates using a backward pass from the project finish date:

  • Total Slack: The number of days a task can be delayed without delaying the project finish.
  • Critical Path: Tasks with zero total slack are marked as isCritical.
  • This analysis helps planners identify the “chain” of tasks that determines the total project duration.

The engine prioritizes user intent and data integrity when scheduling rules collide:

PriorityRuleOutcome
HighActualsactualStartDate and actualFinishDate pin the task; the engine won't move them.
HighHard ConstraintsMSO / MFO dates win over dependencies; conflict reported.
MediumDependenciesAuto-tasks are clamped to satisfy predecessors.
MediumSoft ConstraintsDates are adjusted to bounds where possible; conflict reported if windows are disjoint.
LowAuthored DatesUsed as the starting point for root tasks or manual tasks.