# Center(s) of Gravity¶

Access the *Center(s) of Gravity* page via the menu bar: *Analytics > Center(s) of Gravity*. On this page you can run center of gravity calculations and specify constraints.

There are two scenarios, detailed below:

For large datasets these calculations can take some time (varying from about half a minute up to several minutes or even hours). For the drive time scenario you can influence this time by changing (some of) the Settings.

When you are finished calculating CsoG on this page, use the buttons at the bottom to go to other pages:

Go toSolution Details to see details about individual CsoG in the solution.Go toCosts to see an overview of costs based on these calculations.Go toFix Locations to set DCs as fixed locations.

## Demand/Supply Distribution Map¶

The map shows your demand/supply locations as specified on the *Demand and Supply Distribution* page. When one or more centers of gravity are calculated by solving one of the scenarios, the map also displays the center(s) of gravity. In the action menu for the map, you can find the following options:

- Reset Map Area - Reset the visible area of the map so that all locations are visible.
- Show All Resources - Toggles between showing existing resources on the map and hiding them. Fixed resource locations are always displayed. If your dataset does not contain any resources, the Show All Resources option is inactive.

**Show in Map**- Use the switch in this widget to show or hide arcs indicating which DC (CoG) is serving which supplier/customer. If you have a big dataset you might want to switch off the display of these arcs.

## Output¶

After calculation is done, output is detailed on the *Center(s) of Gravity* page in various widgets:

**Output Drive Time**- The resulting average and maximum drive times are displayed in the
*Output Drive Time*widget. These drive times are in hours, based on the drive times of all locations that are taken into account. **Drive Time Distribution**The

*Drive Time Distribution*bar chart shows you the distribution of drive times from location to DC. Each bar represents the number of locations with a drive time within a certain time interval.**Output Service**- In the
*Output Service*widget you can see the total number of locations serviced by the center(s) of gravity. You can also see the total volume (load) that is serviced.

## Multiple DCs Scenario¶

The *Multiple DCs Scenario* calculates one or more centers of gravity for you. These center(s) of gravity are possible locations for your DCs. They are calculated such that the total travel distance to all specified demand/supply locations is minimal.

The algorithm which is used to calculate these centers of gravity is explained below.

### Algorithm¶

Imagine that each of your demand/supply locations has a certain force proportional to its load. They each pull on the location of a single center of gravity (CoG). When each location uses its force to pull in its own direction, the CoG ends up in the center of those forces. At that moment, the algorithm has found the location that minimizes the total load travel distance.

To find multiple (N) centers of gravity (CsoG), the algorithm starts with N locations being the CsoG. The app assigns the closest CoG as the serving DC for each demand/supply location. For each DC (=CoG), the algorithm locates the optimal location for each CoG based on the loads of the locations that it serves.

This process is reiterated. The demand/supply locations are reassigned to the closest CoG location, based on new locations calculated for CsoG. Then, according to the loads of new supply/demand assignments, the CsoG are relocated. The process is reiterated until a final balance is found with N centers of gravity and each supply/demand location is served by the closest center of gravity, resulting in a minimal total load travel distance.

### Number of Centers of Gravity¶

In the *Number of Centers of Gravity* widget, enter the number of DCs (= Centers of Gravity) as an integer between 1 and the total number of locations that you take into account. After specifying this number, click *Solve Multiple DCs Scenario* to solve again.

## Drive Time Scenario¶

In this scenario, **Center of Gravity** generates a grid of cities on top of the data area and selects the minimum number of cities that can serve as DC such that all customer locations can be reached within the specified maximum drive time. This means that for each demand/supply location, the drive time to its serving DC (center of gravity) will be at most the maximum drive time you specify.

**Maximum Drive Time**- In the
*Maximum Drive Time*widget, you can specify the maximum number of hours (!) that demand/supply is allowed to travel from DC to demand location/supply location. After entering this number, click the*Solve Drive Time Scenario*button.

## Settings¶

There are two widgets that contain settings for running the center of gravity calculations. Note that when adjusting the settings and solving the model, the results are not saved unless you store them in a case by using the data manager.

**General Settings**

In the General Settings widget you can change settings that are used in both the Multiple DCs Scenario and the Drive Time Scenario.

- Transportation Speed - You can change this parameter to represent your average transportation speed. When you hover over the value field, you can see the unit of this parameter (distance-unit/hour).
- Primary Distribution Cost - You can change this parameter to represent your primary distribution cost. When you hover over the value field, you can see the unit of this parameter (cost-unit/THU/distance-unit).
- Secondary Distribution Cost - You can change this parameter to represent your secondary distribution cost. When you hover over the value field, you can see the unit of this parameter (cost-unit/THU/distance-unit).

**Settings - Drive Time Scenario**

For the Drive Time Scenario there are some specific settings. The default values for these settings are set up to give a quick, rough solution to start from. Adjusting the settings can give you a more precise solution, but may take considerably longer to solve.

Grid refers to the generated locations used to solve the model. Time limit controls to how long the computation will go on before giving the best answer found yet. Optimality Gap settings control how close the given answer must be to the true best answer.

- Grid Distance - The distance between two locations in the grid. A smaller grid distance gives a better solution, but increases the solving time.
- Time Limit - After this time, solving the model is interrupted, even if the desired MIP Gap is not reached yet. The default value is 0.08 hour (~5 minutes).
- Optimality Gap [Input] - Indicates how fine the solution should be. A lower Optimality Gap gives a better solution, but increases the solving time. E.g. if the Optimality Gap is 5% and the optimal solution is 20 CsoG. The solve will finish when a solution is within 5% of 20 (so 20 + 1).
- Optimality Gap [Output] - After solving, this parameter indicates the Optimality Gap of the given solution. This can be greater than the input gap when the time limit stopped the solve before the best solution was found. The output gap is less than or equal to the input gap when an allowed solution was found within the time limit.
- Show Grid Cities - When switched on, the map shows the grid cities used to solve the drive time scenario. Grid cities are generated based on the Grid Distance setting and the Maximum Drive Time. The cities close to a real grid are selected and cities that cannot be part of the solution are excluded (e.g. when there is no customer location within maximum drive time distance).
- Extend Search Area - By default this setting is off. Turn it on to extend the search area to a margin equal to the drive time distance. This can give a better solution in rare cases, but increases the execution time. This setting can be of interest when e.g. you have a subset of locations near the border of the ‘rectangle’ around your data, but no cities close to that subset, while there are cities outside the area (and close to the subset).
- Data Passes Date Limit - When your locations are close to the International Date Line (longitude ~ +/- 180 degrees) and they are on both sides of the date line, turn this switch on. Distance calculations will be allowed to cross the date line.