How to determine demand Centers-of-Gravity in order to minimize transport costs when designing a supply chain network: visual explanation, algorithms, and free online tool
Tool can be found at http://www.stellingconsulting.nl/SC_centersofgravity.html
Filing Your Delaware Franchise Tax A Detailed Guide
How to determine demand Centers-of-Gravity
1. How to determine demand Centers-of-Gravity
in order to minimize transport costs when designing a supply chain network
Visual explanation, algorithms, and free online tool
2. Where to locate warehouses in order to minimize transport costs, given the geographical customer
locations and their demand quantities?
Here? Or there?
Answer: locate them in demand Centers-of-Gravity.
• Demand Centers-of-Gravity (CoG) are those locations that minimize the sum of weighted
distances, used as transport costs indicator. Assumption is that transport costs relate to distance.*
• Weighted distance is the distance from CoG to customer multiplied by demand. E.g. if customer A
has a demand of 10 and is located 25 km from its warehouse his weighted distance is 250 km.
Summing over all customers gives the sum of weighted distances.
• This indicator is not to be used as an absolute figure. It just helps to determine warehouse
positions that make sense from a transport costs perspective. But it can be used to calculate
relative transport-cost-scores of different warehouse locations.
* May not be true, e.g. in case of parcel deliveries
Transport costs & demand Centers-of-Gravity
3. Key points
1. Though the goal value is sum of weighted distances, distances are irrelevant when figuring out in
what direction to move the CoG. The overall demand force is leading. In the example it has a
length of 9 and points towards customer A.
2. The overall demand force points the right direction, but does not tell how far to move the CoG.
* Strictly speaking, a CoG can not move, as it is this specific location that comes with a minimal goal value.
Introduction to the single CoG algorithm
A BCOG?
A BCoG!
A BCOG?
Customer A has a demand of 10 and customer
B a demand of 1, where is the CoG?
Somewhere on line A-B, closer to A?
Well, customer A pulls 10 times harder than
customer B.
If moved towards A over a distance d the
sum of weighted distances goal value lowers
(10 x d) – (1 x d).
So, the CoG is right on top of customer A!*
+ = =
This far?
Or this far?
4. The single CoG algorithm visualized
How about multiple customers? How does that work? This will be shown by a graphical simulation.
Before running it, let’s explain what you will see.
• Customers: colored circles with a size
that reflects the demand quantity.
• Current CoG: small red circle.
• Demand forces: arrows towards
customers. Each customer ‘pulls’. The
higher the demand, the longer the
arrow.
• Next CoG to be tested: red circle at
the end of the black arrow.
• Demand forces linked as a ‘path’ starting from the CoG.
• This gives the overall demand force: it starts at the CoG and
finishes at the end of the ‘path’. It is shown as a red arrow.
• Moving the CoG in the direction of the red arrow lowers the goal
value. But the distance to move is unclear. Taking tiny steps would
take long. So start with a big step. If the CoG would step too far –
i.e. goal value would increase – do not move, cut the step size in
half, test again, until the step size is OK, then move the CoG.
• Step size is shown as a grey circle, final move as a black arrow. The
next CoG to be tested is at the end of this arrow.
• If the CoG moves, directions of demand forces change. So the
above procedure is run iteratively.
19. The single Center-of-Gravity algorithm on a flat plane
Goal value = ∑i Di.Qi
where
Qi is the demand of customer i
Di is the distance between customer i and the warehouse this customer is assigned to.
The CoG is initially positioned at:
X_cog = ∑i Xi .Qi / ∑i Qi
Y_cog = ∑i Yi .Qi / ∑i Qi
where
Xi = x-coordinate of customer i
Yi = y-coordinate of customer i
Qi = Demand quantity of customer i
This inital CoG is often presented as optimal, but this is not true!
Imagine there are only two customers, customer A with demand 10 at position (0 , 0) and customer B with demand
1 at position (100 , 0). The initial CoG is at (9.09 , 0) with a goal value of (9.09x10+90.91x1) =181.81. The optimal
CoG is on top of customer A, with a goal value of 0x10+100x1=100. In the simulation with multiple customers the
optimal position scored 7.85% better (another simulation run will give other outcomes).
Though the goal function contains distances, these are irrelevant when determining the optimal CoG.
To optimize 'demand forces' pulling the CoG need to be calculated:
• Force in x-direction = ∑i (Qi.(X_cog − Xi)/Di) or ∑i (Qi.cosinus(anglei)).
• Force in y-direction = ∑i (Qi.(Y_cog − Yi)/Di) or ∑i (Qi.sinus(anglei)).
20. The single Center-of-Gravity algorithm on Earth
The 'geographical translation' of the previous slide:
• Xi = longitude, Yi = latitude (both expressed in radians when used in formula)
• Di = as-the-crow-flies-distance, i.e. shortest distance over the earth's surface.
Calculated using the Haversine formula:
• a = sinus2((latitudei - latitude_cog) /2) + cos(latitude_cog).cos(latitudei).sinus2( (longitudei -
longitude_cog) /2)
• c = 2.atan2(√a, √(1-a))
• Di = 6371.c (6,371 km is Earth's mean radius)
• anglei = spherical angle, called bearing, calculated as
• Bearingi = atan2( sinus(longitudei - longitude_cog).cosinus(latitudei) ,
cosinus(latitude_cog).sinus(latitudei) - sinus(latitude_cog).cosinus(latitudei).cosinus(lontitudei -
longitude_cog)
• Because bearing compares to an angle between a line and the Y-axis, instead of X-axis:
• Force in longitude-direction = Flon = ∑i (Qi.sinus(bearingi))
• Force in latitude-direction = Flat = ∑i (Qi.cosinus(bearingi))
• Normalize by dividing by the length of this F-vector, then multiply with step size.
Algorithm
Step 1: Locate CoG at its initial position (apply the formula), and initialize step_distance at 100km
Repeat
Step 2: Update latitudecog to latitudecog + Flat / √(Flat.Flat +Flon.Flon) .step_distance
Update longitudecog to longitudecog + Flon / √(Flat.Flat +Flon.Flon) .step_distance
Step 3: Calculate the goal value. If it increased (would increase), then step_distance becomes
step_distance/2, and move back to the previous position.
until step_distance is smaller than 1 meter.
21. The multiple Centers-of-Gravity algorithm
Apply
single-CoG
algorithm
Step 1. Locate warehouses at a randomly selected customer location
Repeat
Step 2. (Re)assign customers to the closest warehouse
Step 3. Locate each warehouse in the CoG given its customers
until the goal value did not improve
(this happens as soon as no customer shifted to another warehouse in step 2)
Note: steps 2 and 3 can never result in an increased goal value.
23. Final remarks
Enjoy our free tool at www.stellingconsulting.nl
• If - for example - you know beforehand you will operate a warehouse in the UK, then split data into
'UK data set' and 'mainland Europe data set' and run the model for both sets separately.
• Outcomes may vary, due to initial random locations. Run several times to check if a solution
reappears and/or to see alternatives. (By the way, CoG may end up in the middle of the sea.)
• In supply chain network design, the optimal number of warehouses and locations is driven by
many quantitative and qualitative factors, like transport costs, buildings costs, labour costs,
inventories, tax, demand growth, supply chain risk, lead time requirements, and law (e.g. medical
industry: in some countries law forbids to serve customers from a warehouse outside the country).
• In supply chain network design, total costs is key, not transportation costs only (though they may
be the major part). Network design software minimizes total costs (or optimizes profit) respecting
all constraints with mathematical precision. But most likely you will feed it with all sorts of
assumptions about demand growth, tariffs for future transport lanes, warehouse costs for
locations somewhere else, etc.
• Nevertheless, a CoG-analysis is commonly done in supply chain network design studies, as CoG
give a first indication what warehouse locations to consider. The demand map itself is used to
validate shipment or sales data anyway. Having the data already, it is easy to run the CoG-tool.