# `ExVrp.IteratedLocalSearch.Result`
[🔗](https://github.com/sephianl/ex_vrp/blob/v0.8.0/lib/ex_vrp/iterated_local_search.ex#L79)

Result of running ILS.

This matches PyVRP's Result class interface:
- `cost/1` - Returns the cost of the best solution (infinity if infeasible)
- `feasible?/1` - Returns whether the best solution is feasible
- `best` - The best Solution found
- `stats` - Statistics from the search
- `num_iterations` - Total iterations performed
- `runtime` - Runtime in milliseconds

# `t`

```elixir
@type t() :: %ExVrp.IteratedLocalSearch.Result{
  best: ExVrp.Solution.t(),
  num_iterations: non_neg_integer(),
  runtime: non_neg_integer(),
  stats: map()
}
```

# `cost`

```elixir
@spec cost(t()) :: non_neg_integer() | :infinity
```

Returns the cost of the best solution.

This is the objective the search minimises: `unit_distance_cost` times
distance, plus `unit_duration_cost` times duration, plus the fixed cost of
every vehicle used, plus the prizes of any clients left unvisited.

Returning `best.distance` instead makes callers rank solutions on one term
of that sum, so a caller comparing independent starts picks on a metric no
start optimised. That matters most when starts settle on different vehicle
counts, or when the distance matrix carries penalties rather than metres.

Returns `:infinity` if the solution is infeasible, matching PyVRP's behavior.

# `feasible?`

```elixir
@spec feasible?(t()) :: boolean()
```

Returns whether the best solution is feasible.

# `summary`

```elixir
@spec summary(t()) :: String.t()
```

Returns a summary string of the result.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
