# Resource Leveling
URL: https://pro.rv-grid.com/guides/gantt/scheduling/leveling/
Source: src/content/docs/guides/gantt/scheduling/leveling.mdx
Description: Use automatic resource leveling to resolve over-allocations by delaying tasks.
Enable deterministic auto-leveling with:

```typescript
grid.gantt = {
  scheduling: {
    resourceLeveling: 'auto',
    resourceLevelingWithinSlack: false,
  },
};
```

Auto-leveling delays later overlapping automatic tasks until the resource is available, then reports `resource-leveling-adjustment`.

## Leveling Controls

Per-task leveling controls:

```typescript
const task = {
  priority: 900,           // 0-1000; higher priority is protected first
  canLevel: true,          // false keeps the task fixed during auto-leveling
  levelingDelayDays: 2,    // stored calendar-day delay applied by leveling
};
```

**Deterministic auto-leveling order**:
1. Non-levelable tasks first (fixed blockers).
2. Higher `priority` before lower `priority`.
3. Earlier start date, then task id.

## Constraints and Actuals

The leveling implementation avoids moving:
- Manually scheduled tasks.
- Tasks with `actualStartDate` or `actualFinishDate`.
- Summary tasks.
- Inactive tasks.
- Tasks pinned by `must-start-on` or `must-finish-on`.

  Microsoft Project leveling can delay or split tasks. RevoGrid leveling is deterministic and delay-based; it supports priority and slack-limited leveling but does not split tasks automatically.
