Solve Territories (Territory Design)

Available with Business Analyst license.

Summary

Solves the territory solution based on specified criteria such as attribute constraints or distance constraints.

Usage

  • The Classic option in the Algorithm parameter is the original method to solve territories and is suitable for most use cases.

    The Genetic option is a newer method based on a genetic growth algorithm and is suitable for more complex solutions such as solutions with distance and capacity constraints. This option creates a large number of random possible solutions and produces a better solution but will take longer to process.

  • When using the User Defined option in the Number of Territories Method parameter, the number of territories must be specified using the Number of Territories parameter.

  • Attribute or distance constraints are required for the Number of Territories Method parameter's Optimal option.

Parameters

LabelExplanationData Type
Input Territory Solution

The territory solution that will be used to solve territories.

Group Layer; Feature Dataset; String
Level

The level that will be used to solve territories.

String
Number of Territories Method

Specifies the method that will be used when calculating the number of territories.

  • User DefinedThe number of territories will be provided by the user. This is the default.
  • OptimalThe number of territories will be calculated automatically.
String
Number of Territories
(Optional)

The number of territories to be specified.

Long
Quality (%)
(Optional)

An integer between 1 and 200 that determines the performance of a solve operation. A lower value will provide better performance but quality may be affected. The default value is 100.

Long
Iterations Limit
(Optional)

The number of times the territory search process will be repeated. For larger datasets, increasing the number is recommended to find an optimal solution. The default value is 50.

Long
Algorithm

Specifies the algorithm that will be used to solve the territory solution.

  • Classic The original algorithm will be used to solve the territory solution. This is the default.
  • Genetic A newer and more modern algorithm based on genetic algorithm will be used to solve the territory solution.
String
Number of Candidate Solutions
(Optional)

The number of possible solutions. For larger datasets, increasing this number will increase the search space and the probability of finding a better solution. The default is 10 and must be greater than 1. This parameter is only used when the Genetic algorithm is specified.

Long

Derived Output

LabelExplanationData Type
Updated Territory Solution

The updated territory solution.

Group Layer

arcpy.td.SolveTerritories(in_territory_solution, level, method, {number_territories}, {quality}, {iterations_limit}, algorithm, {candidate_solutions})
NameExplanationData Type
in_territory_solution

The territory solution that will be used to solve territories.

Group Layer; Feature Dataset; String
level

The level that will be used to solve territories.

String
method

Specifies the method that will be used when calculating the number of territories.

  • USER_DEFINEDThe number of territories will be provided by the user. This is the default.
  • OPTIMALThe number of territories will be calculated automatically.
String
number_territories
(Optional)

The number of territories to be specified.

Long
quality
(Optional)

An integer between 1 and 200 that determines the performance of a solve operation. A lower value will provide better performance but quality may be affected. The default value is 100.

Long
iterations_limit
(Optional)

The number of times the territory search process will be repeated. For larger datasets, increasing the number is recommended to find an optimal solution. The default value is 50.

Long
algorithm

Specifies the algorithm that will be used to solve the territory solution.

  • CLASSIC The original algorithm will be used to solve the territory solution. This is the default.
  • GENETIC A newer and more modern algorithm based on genetic algorithm will be used to solve the territory solution.
String
candidate_solutions
(Optional)

The number of possible solutions. For larger datasets, increasing this number will increase the search space and the probability of finding a better solution. The default is 10 and must be greater than 1. This parameter is only used when the Genetic algorithm is specified.

Long

Derived Output

NameExplanationData Type
out_territory_solution

The updated territory solution.

Group Layer

Code sample

SolveTerritories example (Python window)

The following Python window script demonstrates how to use the SolveTerritories function.

import arcpy
arcpy.td.SolveTerritories("MyProject.gdb\Solution", "Territories[1]", "USER_DEFINED", 7, 100, 50, "CLASSIC", None)

Environments

Licensing information

  • Basic: Requires Business Analyst
  • Standard: Requires Business Analyst
  • Advanced: Requires Business Analyst

Related topics