# Solve Request

> Optimise, Evaluate, ReOptimise and ExperimentalOptimise.

Page: https://docs.icepack.ai/nvd/solve-request/

## Overview

Different actions can be performed against a [model](/nvd/model/) and the solve request object provides a mechanism to communicate the action to the solver. The NVD solve request supports an additional `ExperimentalOptimise` type beyond the standard `Optimise`, `Evaluate`, and `ReOptimise` options.

### Applicable models

* NVD `nvd-hap0j2y4zlm1`

### Endpoint

* POST: **https://api.icepack.ai/vehicle-router/solve/**

<hr>

## Solve Request

The solve request indicates what type of solve should be performed against a specified [model](/nvd/model/)

### Schema definition

```protobuf
message SolveRequest {
  optional Model model = 1;
  optional string modelID = 2;
  repeated VisitSequence routes = 3;
  optional SolveType solveType = 4 [default = Optimise];
}
```



### Fields

model
: The target [model](/nvd/model/) which should be solved (commonly specified). If not specified, the `modelID` field should be provided with a valid reference to an existing model.

modelID
: A GUID which refers to a valid model which has been uploaded via the [ivr-data](/ivr/ivrdata/) end point. If a `modelID` references a model which no longer exists on the server, an error is returned indicating that the target model could not be found.

routes
: An optional list of routes which specify the [visit sequence](/nvd/visit-sequence/), typically used in conjunction with the `modelID` and the solve types `Evaluate` and `ReOptimise`. The [visit sequence](/nvd/visit-sequence/) is also available as a field within the [model](/nvd/model/) definition where the [visit sequence](/nvd/visit-sequence/) specified in the `SolveRequest` will override any [visit sequence](/nvd/visit-sequence/) specified in the encapsulating model. This allows one to run multiple evaluate requests without having to redefine a `model` for each evaluate request. This is a desirable design pattern when implementing user interfaces (UIs) where a drag-and-drop functionality is desired or selecting solutions from a Pareto frontier. The `model` can be solved, Pareto frontier results returned (with no schedule-detail) and a solution can be evaluated (returning the detail for an instance from the frontier) by using the `modelID`.

solveType
: The [solve type](/nvd/solve-request/#solve-request-solve-type) which defines the target solver behaviour required for the specified model.


### Notes

* An NVD model does not return a single solution in the [solution response](/nvd/solution-response/). Instead, all solutions on the non-dominated Pareto frontier are returned. This is because the NVD model inherently supports competing objectives (Balance vs Cost) and a user's preference is often a function of the returned frontier. Once a tradeoff point has been selected from the Pareto frontier, the complete solution detail can then be obtained for that particular schedule instance.

<hr>

## Solve Request Solve Type


### Schema definition

```protobuf
enum SolveType {
  Optimise = 0;
  Evaluate = 1;
  ReOptimise = 2;
  ExperimentalOptimise = 3;
}
```



### Fields

Optimise
: Issues an `Optimise` request which aims to find a feasible solution to the provided [model](/nvd/model/) (either a provided model or reference to an existing model).

Evaluate
: Issues an `Evaluate` request which is used in conjunction with a defined set of routes. The feasibility status of the prescribed routes is returned in the [solution response](/nvd/solution-response/). The `Evaluate` enum is also used to retrieve solution instances on the Pareto frontier.

ReOptimise
: Issues a `ReOptimise` request which is used in conjunction with a defined set of routes. If the routes provided are feasible with respect to the model referenced, this is used as a candidate starting solution in the search algorithm. If the solution is feasible, the solution [returned](/nvd/solution-response/) by the engine is guaranteed to be better than or equal in cost to the provided [visit sequence](/nvd/visit-sequence/). There are several use cases for type of solve request. Small modifications may be made to a model which perhaps change the context of a given solution slightly. By providing a high quality starting solution to the solver, the solve time may be reduced somewhat. Another use case is that on much larger models, a heuristic design is employed by the solver. By providing a starting solution, additional search time may be given to the solve around the neighbourhood specified.

ExperimentalOptimise
: Uses an experimental decomposition code-path. This may provide improved performance on certain problem structures but behaviour may change between API versions.

