This page describes the core algorithms of Centers-of-Gravity Calculator

It is standard practice to do a Centers-of-Gravity analysis when designing a supply chain network. It will give you a first good view on what warehouse locations to consider. Centers-of-Gravity are those locations that minimize the sum of weighted distances. Weighted distance is the distance from warehouse to customer multiplied by demand. If customer A has a demand of 10 and is located 25 kilometers (km) from its warehouse, then the weighted distance is 250 km. The sum of weighted distances over all customers acts as an indicator for transport costs.

Underlying assumption: transport cost = rate/km × distance. This assumption is only partly valid. Parcel rates are often distance independent within a smaller country or region, FTL pallet rate/km is lower than LTL pallet rate/km, macro-economic imbalances cause direction-dependent rates, et cetera. Also, as-the-crow-flies distances are often used, instead of road distances. Nevertheless, a Centers-of-Gravity analysis provides a good starting point for a supply chain network design.

Customer A has a demand of 10 and customer B a demand of 1.

Where is the Center-of-Gravity (CoG)? Somewhere on line A-B, closer to A?

Well, customer A pulls 10 times harder than customer B.

If the CoG moves a distance d towards A the

So, the CoG is right on top of customer A,

Though the goal value is the

The overall demand force is leading. In the example it has a length of 9 and points towards customer A.

The overall demand force points the right direction, but does not tell how far to move the CoG.

This far?

Or this far?

Each single run of this algorithm does the following:

- Step 1: locate warehouses at a random location (optional: then assign customers, calculate weighted X,Y of assigned customers, and use this X,Y as initial position).
- Step 2: (re)assign each customer to the closest warehouse.
- Step 3: move each warehouse to the Center-of-Gravity of its customers = apply Single-Center-of-Gravity algorithm (described below).
- Repeat steps 2 and 3 until the goal value (sum of weighted distances) does not decrease anymore.

Multiple runs are done, each run starting with different random locations. The best solution out of those runs is presented as final outcome. The higher the number of runs, the more likely the optimum solution will be found.

→

→

On a side note, the problem and algorithm are comparable to

(step 3 of the Multiple-Centers-of-Gravity algorithm)

All forces pulling the Center-of-Gravity need to be summed up to get the overall pull force, which is a vector with a size (irrelevant) and a direction.

- Step 1: locate Center-of-Gravity at an initial position (same as step 1 of the Multiple-Centers-of-Gravity algorithm), and initiate 'move distance' at a large value, for example 100 kilometers.
- Step 2: calculate the overall pull force and move the Center-of-Gravity in that direction, at move distance.
- Step 3: calculate the sum of weighted distances. If it has increased, then move back to the previous position, and divide move distance by two.
- Repeat steps 2 and 3 until the move distance has become sufficiently small.

This algorithm resembles the gradient descent method with force replacing the gradient.