[Canonical page](<https://docs.dhtmlx.com/planning-engine/net/how-to/reschedule-a-branch/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# Reschedule a branch

Reschedule one task and the work that depends on it, and leave the rest of the project where it is.

The scope is the task you name, its summary ancestors and descendants, and its successors through links. With [`Inclusive`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/subtree.md>) on, the default, the scope also follows incoming links, so it takes in the task's predecessors and their branches too. Tasks outside the scope keep their dates.

## Steps

1. Create a [`Subtree`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/subtree.md>) for the task the branch starts from and set it on [`SolveOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/solve-options.md>). `new Subtree(id)` sets `Inclusive = true`, so the scope also takes in the task's predecessors:

   ```csharp
   var options = new SolveOptions { Subtree = new Subtree("design") };
   ```

   To reschedule only the task and the work downstream of it, set `Inclusive = false`. The task itself stays in the scope either way:

   ```csharp
   var subtree = new Subtree("design") { Inclusive = false };
   ```

2. Pass the options to [`Project.Solve`](<https://docs.dhtmlx.com/planning-engine/net/api/project-solve.md>). Pass your [`ProjectData`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/project-data.md>) on the first load, or `null` to reschedule the current state:

   ```csharp
   var result = project.Solve(null, options);
   ```

3. Write the entries of [`result.Updates`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md#updates>) back to your model. Each [`Mutation`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/mutation.md>) is a task in the scope that moved. The scoped dates become the accepted baseline.

The full example below has two independent chains, `backend → api` and `design → ui`. Both successors start too early. The scoped solve fixes only the `design` branch:

```csharp
using Plen;

var jan1 = Moment.FromYmdHm(2026, 1, 1, 0, 0) ?? throw new InvalidOperationException("invalid date");

var data = new ProjectData
{
    Tasks =
    [
        new TaskData("backend") { StartDate = jan1, Duration = 2.0 },
        new TaskData("api") { StartDate = jan1, Duration = 1.0 },
        new TaskData("design") { StartDate = jan1, Duration = 3.0 },
        new TaskData("ui") { StartDate = jan1, Duration = 1.0 },
    ],
    Links =
    [
        new LinkData { Id = "l1", Source = "backend", Target = "api" },
        new LinkData { Id = "l2", Source = "design", Target = "ui" },
    ],
};
// 24/7 time keeps the example dates easy to check.
data.Config.UseCalendars = false;

var options = new SolveOptions { Subtree = new Subtree("design") };

var project = new Project();
var result = project.Solve(data, options);

foreach (var m in result.Updates)
{
    Console.WriteLine($"{m.Id} {m.StartDate}..{m.EndDate}");
}
```

## Preview a branch

To see what rescheduling a branch would do without changing the project, set the same [`Subtree`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/subtree.md>) on [`PreviewOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/preview-options.md>) and call [`Project.Preview`](<https://docs.dhtmlx.com/planning-engine/net/api/project-preview.md>):

```csharp
var preview = project.Preview(
    new SchedulingChanges(),
    new PreviewOptions { Subtree = new Subtree("backend") });
```

The preview scope applies to that call only. It doesn't touch the baseline or the cached solve result. A preview scope can also name a task that the same `changes` add.

## Things to know

- Tasks outside the scope don't move until you solve them. In the example, the next [`project.Solve(null, new SolveOptions())`](<https://docs.dhtmlx.com/planning-engine/net/api/project-solve.md>) moves only `api`, because `ui` is already accepted.
- The result cache uses the whole [`SolveOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/solve-options.md>) as its key, compared by value. A different [`Subtree`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/subtree.md>) replans from the accepted dates. Solving again with the same `Subtree` returns the same cached result object.
- With [`IncludeUnchanged`](<https://docs.dhtmlx.com/planning-engine/net/how-to/load-all-task-dates.md>), a scoped solve reports every task in the scope, plus the out-of-scope tasks a sparse scoped solve would report.
- On a project with a dependency cycle, nothing is scheduled, scoped or not. Check [`result.Cycles`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md#cycles>).
- An unknown or unscheduled task in `Subtree.Task` throws [`InputException`](<https://docs.dhtmlx.com/planning-engine/net/api/core/errors/input-exception.md>) with `Path` `subtree.task` and the message `unknown or unscheduled scope task`. The project keeps its previous state and cached result. See [Error handling](<https://docs.dhtmlx.com/planning-engine/net/error-handling.md>).

## Result

The example prints one line. Only `ui` moves, to start after `design` ends. `api` still overlaps `backend`:

```text
ui 2026-01-04 00:00..2026-01-05 00:00
```

Without [`Subtree`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/subtree.md>), the same solve also moves `api` to `2026-01-03 00:00`.
