> ## Documentation Index
> Fetch the complete documentation index at: https://docsv4.mile.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Clustering

> Keep each vehicle in its own area and reduce overlap between routes.

**Clustering** reduces the overlap between the trips of different vehicles. The optimization groups nearby visits into clusters and gives each cluster to one vehicle, so vehicles do not cross into each other's areas. The routes are clearly separated, but usually a little less optimal than without clustering.

* Less overlap between the routes of different vehicles.
* Each vehicle gets its own service area.
* The total distance may be longer than a fully optimized result.
* Useful when clear separation matters more than the shortest distance.

<Note>
  Required permission:

  * View configuration
  * Edit configuration
</Note>

## Turning it on

1. Open **Planning › Routing › Configuration** and go to **Optimization**.
2. Tick **Clustering** (item 6 in the picture).
3. Choose **Minimum overlap** or **No overlap**.

The change is saved as soon as you make it.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/WSCQrzxOhh4WLfZT/images/v4/planning/optimization.png?fit=max&auto=format&n=WSCQrzxOhh4WLfZT&q=85&s=282bb8e7d3cb458aaaabfa49a3ee7976" alt="Optimization options" width="600" data-path="images/v4/planning/optimization.png" />
</div>

## Options

**Minimum overlap**: **Minimize overlap between routes of different vehicles.** Some overlap may remain, but it is kept small.

* Use it when complete separation is not critical, when you want better routes while still reducing overlap, or when the area's geography makes some overlap unavoidable.
* Trade-off: more efficient and flexible, but a vehicle may still cross into a nearby area.

**No overlap**: **Prevent any overlap between routes of different vehicles.** Routes are completely separated.

* Use it when strict areas are required, for example by company policy or regulation.
* Trade-off: the strictest boundaries, but longer total distance and less flexibility.

| | Minimum overlap | No overlap |
| - | - | - |
| Overlap | A little | None |
| Route efficiency | Better | Lower |
| Strictness of areas | Flexible | Strict |
| Total distance | Shorter | Longer |
| Use when | Some crossing is fine | Areas must be fully separate |

## How it works

**Without clustering**, vehicles may visit places anywhere in the service area, and routes may cross, as long as the total is efficient.

**With clustering**:

1. Visits are grouped into clusters by distance.
2. Each cluster is given to one vehicle.
3. Each vehicle works inside its own cluster.
4. Overlap is reduced or prevented, depending on the option.

## Use cases

**Regional sales teams**: each sales rep has a territory. Use **No overlap**: every rep stays in their own territory.

**Delivery fleet that prefers fixed areas**: drivers like familiar areas but may cross when it helps. Use **Minimum overlap**: drivers mostly stay in their area.

**Mixed city and rural areas**: some vehicles serve the city, others the countryside. Use **Minimum overlap**: clusters follow the geography with few crossings.

## When to use it

**Use it when**:

* vehicles need clear boundaries,
* drivers have assigned regions,
* less overlap matters more than the shortest distance,
* overlapping routes would confuse drivers,
* your service areas are geographically distinct.

**Avoid it when**:

* the shortest total distance matters most,
* the area is small and overlap is not a problem,
* visits are packed close together,
* few vehicles serve a large area.

## Clustering and Geotagging

Clustering is often confused with [Geotagging](/pages/planning/routing/configuration/geotagging), because both split work by area. The difference is who draws the areas and what they are for.

**Clustering is automatic.** You draw nothing. The optimization groups nearby visits and gives each group to a vehicle, to reduce overlap. The areas come from where the visits are, so they can change from one run to the next, and the optimization decides which vehicle serves which area.

**Geotagging is manual.** You draw fixed areas on the map. Each area has tags, and only vehicles with those tags may serve its visits. The areas stay the same every run, so you decide exactly where each area is and which vehicles serve it.

| | Clustering | Geotagging |
| - | - | - |
| Who defines the area | The optimization, from the visit locations | You, by drawing areas on the map |
| Purpose | Reduce overlap between routes | Decide which vehicle serves which area |
| Vehicle per area | Chosen by the optimization | Through matching tags |
| Boundaries | Worked out on each run; can change | Fixed; the same every run |
| Setup | Tick **Clustering** and choose an option | Draw areas, then tag the vehicles |
| Best when | You want compact, separate routes without fixed areas | Areas are known and specific vehicles must serve them |

<Note>
  You can use both. Geotagging decides which vehicles may enter an area, and Clustering keeps the resulting routes compact and separate.
</Note>

## Frequently asked questions

**Are routes always longer with clustering?**
Usually, because separation comes before the shortest distance. **No overlap** usually gives longer routes than **Minimum overlap**.

**Does it work with other options?**
Yes: [Auto Split](/pages/planning/routing/configuration/auto-split), [Auto Merge](/pages/planning/routing/configuration/auto-merge), [Multi Trip](/pages/planning/routing/configuration/multi-trip) and capacity constraints.

**Does it respect tags?**
Yes. Visits only go to vehicles with matching tags.

**What if visits are spread unevenly?**
Some vehicles may get small areas with many visits, others large areas with few.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.