[Canonical page](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/solve-options/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# SolveOptions

Options for [`Project.Solve`](<https://docs.dhtmlx.com/planning-engine/net/api/project-solve.md>) and [`Engine.Schedule`](<https://docs.dhtmlx.com/planning-engine/net/api/engine-schedule.md>). They set which part of the project is scheduled and which extra data the [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>) carries. `new SolveOptions()` schedules the whole project and returns only the changed tasks.

## Declaration

```csharp
public sealed class SolveOptions : IDeepCloneable<SolveOptions>, IEquatable<SolveOptions>
{
    public Subtree? Subtree { get; set; }
    public AnalyticsOptions Analytics { get; set; } = new();
    public bool Reasons { get; set; }
    public bool IncludeUnchanged { get; set; }

    public SolveOptions DeepClone();
    public bool Equals(SolveOptions? other);
}
```

Set the properties you need with an object initializer: `new SolveOptions { Reasons = true }`. Two instances are equal when all four properties are equal, compared by value. For how `Project.Solve` uses that equality to return its cached result, see [`Project.Solve`](<https://docs.dhtmlx.com/planning-engine/net/api/project-solve.md>).

## Properties

| Property | Type | Default | Description |
|---|---|---|---|
| `Subtree` | [`Subtree`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/subtree.md>)`?` | `null` | Schedules only one task's subtree and the tasks that depend on it. `null` schedules the whole project. |
| `Analytics` | [`AnalyticsOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/analytics-options.md>) | `new()` (no analytics) | Requests critical path and slack. Fills [`ScheduleResult.Analytics`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>). |
| `Reasons` | `bool` | `false` | Fills [`Mutation.Reason`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/mutation.md>) on each update with the [`Reason`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/reason.md>) the task moved. |
| `IncludeUnchanged` | `bool` | `false` | Also reports unchanged tasks in [`ScheduleResult.Updates`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md#updates>), so the result holds the full date list. |

### Subtree

```csharp
public Subtree? Subtree { get; set; }
```

Limits scheduling to the scope the [`Subtree`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/subtree.md>) value describes. Build the value with `new Subtree(id)`.

### Analytics

```csharp
public AnalyticsOptions Analytics { get; set; } = new();
```

Turns on [`AnalyticsOptions.Slack`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/analytics-options.md>) and [`AnalyticsOptions.CriticalPath`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/analytics-options.md>). With both flags `false` (the default), `ScheduleResult.Analytics` is `null`. With either flag set, it holds an [`Analytics`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/analytics.md>) value; check its `Status` before reading the data.

### Reasons

```csharp
public bool Reasons { get; set; }
```

When `true`, each [`Mutation`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/mutation.md>) in `Updates` carries a [`Reason`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/reason.md>) in its `Reason` property. When `false`, `Reason` is always `null`.

[`Mutation.Reason`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/mutation.md>) lists when it stays `null`.

### IncludeUnchanged

```csharp
public bool IncludeUnchanged { get; set; }
```

When `false`, `Updates` holds only the tasks the solve changed or that edits touched. When `true`, `Updates` also holds every scheduled task that didn't change, each with `StartDate`, `EndDate` and `Duration` set. This gives the full normalized date list on initial load.

- Every scheduled task is reported: leaves, summaries and milestones. Unscheduled tasks are never reported.
- With `Subtree`, every task in the subtree is reported, ancestors of subtree tasks included, plus the usual changed or touched updates outside the subtree.
- On a project with cycles, every scheduled task is reported in model order (`Subtree` is ignored), with its stored dates and durations.
- `LevelingDelay` and `Pauses` are never set in these entries.

The extra entries don't affect [`ScheduleResult.BaselineId`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md#baselineid>), which follows real date changes only. Every other result property matches what the same solve returns with `IncludeUnchanged = false`.

## Methods

### DeepClone

```csharp
public SolveOptions DeepClone()
```

Returns a copy that shares no nested object (`Subtree`, `Analytics`) with this one.

## Example

```csharp
using Plen;

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

var data = new ProjectData
{
    Tasks =
    [
        new TaskData("design") { StartDate = monday, Duration = 2.0 },
        new TaskData("build") { StartDate = monday, Duration = 3.0 },
    ],
    Links = [new LinkData { Id = "l1", Source = "design", Target = "build" }],
};

var options = new SolveOptions
{
    Analytics = new AnalyticsOptions { CriticalPath = true },
    Reasons = true,
    IncludeUnchanged = true,
};

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

// Every scheduled task, changed or not.
foreach (var update in result.Updates)
    Console.WriteLine($"{update.Id}: {update.StartDate} - {update.EndDate} ({update.Reason})");
```

## Related

- [`Project.Solve`](<https://docs.dhtmlx.com/planning-engine/net/api/project-solve.md>) - the call these options configure, and how equal options return the cached result
- [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>) - the returned result
- [Scheduling a project](<https://docs.dhtmlx.com/planning-engine/net/scheduling/scheduling-a-project.md#solve-options>) - what each solve option changes
- [Load all task dates](<https://docs.dhtmlx.com/planning-engine/net/how-to/load-all-task-dates.md>) - the full date list with `IncludeUnchanged`
- [Reschedule a branch](<https://docs.dhtmlx.com/planning-engine/net/how-to/reschedule-a-branch.md>) - scoped runs with `Subtree`
