xMatix
Sign in Request demo
xMatix
PRODUCTS
SalesField SalesCRMRewardsClaimsInventoryProcurementWarehouse ManagementField ServiceServiceSupportTelephony & MessagingFinance & AccountingPayrollExpense ManagementCommercePortalsAnalytics & ReportingData StudioMobile AppSee all products →
PLATFORM
Platform overviewApp BuilderAutomationIntegrationsSecurity & GovernanceChange ManagementDevelopers
SENSE AI
Sense AI overviewSense AssistSense ControlSense VisionAI StudioTrust & governanceIn Claude & ChatGPTUse cases
SOLUTIONS
FMCG & DistributionManufacturing & Dealer NetworksAutomotive & DealershipsPharma & HealthcareConsumer DurablesAgri-InputsBuilding MaterialsService NetworksWarehousing & 3PLFinancial AccountingERP SoftwareIndia GST ComplianceUAE VAT & e-InvoicingSaudi ZATCA & VATAll solutions →
RESOURCES
Knowledge CenterDeveloper & CLIBlogGuidesWhat is xMatix?Company facts
COMPANY
AboutCareersPartnersEventsContactAuthorsLegal
Sign in Request demo
BLOG · FIELD OPERATIONS

Splitting a territory with a solver

Dividing outlets between field staff looks like drawing lines on a map. It is a capacitated vehicle-routing problem, and treating it as one changes what you can promise a sales team.

· Platform & Domain Architecture · · 8 min read

Territories are usually drawn once, by someone with local knowledge, along boundaries that already exist — districts, pin codes, whatever the previous system used. Then they are inherited for years.

The result is quietly expensive. One person physically cannot cover their patch while another has spare capacity, and both are measured against the same target as though the difference were effort rather than arithmetic.

Underneath, this is a well-studied optimisation problem, and naming it correctly is most of the battle.

It is not a clustering problem

The instinct is to cluster outlets by proximity and hand each cluster to someone. That produces compact territories and ignores the constraint that matters: a territory has to be coverable within a working week, at the visit frequency each outlet is promised.

Compactness and balance pull against each other wherever demand is unevenly distributed, which is everywhere. A dense urban district may hold more outlets in ten square kilometres than a rural region holds in a thousand. Optimise for compactness and you get wildly unequal workloads; optimise for equal counts and you get territories that sprawl.

The honest formulation is a capacitated vehicle-routing problem: assign stops to vehicles — here, people — subject to capacity, while minimising travel, where the cost of adding a stop depends on the route it joins. Assignment and sequencing are not separable.

What the solver is actually given

A solver is only as good as the constraints it is told about, and these are the ones that decide whether the output is usable:

  • Service minutes per stop — how long a visit takes. Without it, the model assumes visits are free and produces a plan that fits only if nobody talks to anyone.
  • Shift start and end — the working window the plan must fit inside.
  • Capacity — how much work a person can carry, and whether it is enforced or advisory.
  • Balance tolerance — how much imbalance between people is acceptable before the plan is rejected. This is a business decision expressed as a number, and it is the single most useful dial.
  • Demand look-back — the window used to weight accounts by what they actually buy, rather than treating every outlet as equal.
  • Travel mode and a time limit — road-network distances, and how long the solver is allowed to think.

All of these are tenant settings in xMatix rather than hard-coded assumptions, which matters because they are exactly the things that differ between a metro and a rural operation.

Why road distances, and why they cost something

Straight-line distance is free and immediately wrong in any real city, where rivers, one-way systems and motorways decide the true cost of a pair of stops. Road-network distances are accurate and come from a routing service — so each optimization run has a real cost.

That constraint shapes the design. Territory planning is an action someone triggers when the territory has genuinely changed, not a background job that re-plans nightly for benefit that is usually zero. The same reasoning applies to route sequencing, where a free nearest-neighbour option exists for cases that do not justify the call.

A solver proposes; a planner disposes

This is the part that decides whether the feature is adopted or resented, and it is not a technical point.

Territory changes have human consequences no objective function prices. Reassigning an account breaks a relationship the customer values and the rep built. Moving a strong account mid-incentive-period is read — correctly — as taking money off someone. An optimiser given distance and balance will do all of that cheerfully, because nobody told it not to.

So the output is a proposal a planner reviews and accepts, and it lands as visit routes and stops in the same structures that drive journey plans and daily execution — meaning an accepted re-plan flows straight into generated visit plans, and individual stops can still be transferred between routes afterwards as reality asserts itself.

What "better" looks like in practice

Take four reps covering 480 outlets, inherited split 150 / 130 / 110 / 90 along administrative boundaries. Re-planned with a 10% balance tolerance, the split becomes roughly even, and because the new patches are more compact, total travel falls as well.

The most valuable outcome is not the travel saving. It is that the rep carrying 150 outlets stops being 30% short on coverage every cycle — a gap that had been read as a performance problem for two years, and was arithmetic all along.

What we would tell another team

Name the problem correctly before choosing a technique. "Split these accounts fairly" sounds like clustering and is not; the moment visit frequency and working hours enter, it is a routing problem with capacity, and the tools for that are mature and well understood.

Then expose the trade-offs as settings rather than burying them. Balance tolerance, service minutes and shift windows are the difference between a plan a sales director will sign and a plan that is technically optimal and politically dead.

Related: What is territory planning? · Planned, optimized, actually followed · Route optimization

← All posts
See it on your business.
Request a demo