# Territory Planning

{% hint style="success" %}
For these templates you will need to install the [**Territory Planning**](https://docs.carto.com/carto-user-manual/workflows/components/territory-planning) extension package.
{% endhint %}

## Territory Balancing

| BigQuery             | CARTO Data Warehouse |
| -------------------- | -------------------- |
| :white\_check\_mark: | :white\_check\_mark: |

In this template, we’ll explore how to optimize work distribution across teams by analyzing sales territory data to identify imbalances and redesign territories.

Focusing on a beverage brand in Milan, we’ll evenly assign Point of Sale (POS) locations to sales representatives by dividing a market (a geographic area) into a set of continuous territories. This ensures fair workloads, improves customer coverage, and boosts operational efficiency by aligning territories with demand.

[**Download example**](https://storage.googleapis.com/carto-workflows-examples/files/territory_balancing.sql)

<figure><img src="/files/25AoS8LviJY7Kwqfy3sQ" alt=""><figcaption></figcaption></figure>

### Location Allocation - Maximize Coverage

| BigQuery             | CARTO Data Warehouse |
| -------------------- | -------------------- |
| :white\_check\_mark: | :white\_check\_mark: |

Managing a modern telecom network requires balancing cost, coverage, and operational efficiency. Every network node—a set of cell towers—represents demand that must be effectively served by strategically placed facilities.

In this tutorial, we’ll explore how network planners can determine the optimal locations for Rapid Response Hubs, ensuring that each area of the network is monitored and maintained efficiently through Location Allocation. More specifically, we aim to maximize network coverage so that whenever an emergency occurs (i.e. outages, equipment failures, or natural disaster impacts), the nearest facility can quickly respond and restore service.

[**Download example**](https://storage.googleapis.com/carto-workflows-examples/files/loc_alloc_maximize_coverage.sql)

<figure><img src="/files/xyvelxlWy96yrD85ugzB" alt=""><figcaption></figcaption></figure>

### Location Allocation - Minimize Total Cost

| BigQuery             | CARTO Data Warehouse |
| -------------------- | -------------------- |
| :white\_check\_mark: | :white\_check\_mark: |

Managing a modern telecom network requires balancing cost, coverage, and operational efficiency. Every network node—a set of cell towers—represents demand that must be effectively served by strategically placed facilities.

In this example, we’ll explore how network planners can determine the optimal locations for Maintenance Hubs, ensuring that each area of the network is monitored and maintained efficiently through Location Allocation. More specifically, we aim to minimize total operational costs for ongoing inspections and servicing, respecting resource capacities, and ensuring that routine maintenance is delivered cost-effectively. Our goal will be to expand our existing facilities by adding one selected site per county in Connecticut to serve rising network demand.

[**Download example**](https://storage.googleapis.com/carto-workflows-examples/files/loc_alloc_minimize_total_cost.sql)

<figure><img src="/files/9sFOEtO6nz2vmAydzJwM" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://academy.carto.com/creating-workflows/workflow-templates/territory-planning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
