The center of gravity method is used to determine the location of a single distribution center that will minimize distribution costs. It treats distribution cost as a linear function of the distance and the quantity shipped, which is assumed to be fixed, although an acceptable variation is that quantities are allowed to change as long as their relative amounts remain the same.
It is helpful in a limited number of situations – primarily service entities – where geography and transportation costs are important; as opposed to the critical factor method, which is more qualitative and general.
The method includes the use of a map that shows the locations of destinations. The map must be accurate and drawn to scale. A coordinate system is then overlaid on the map to determine relative locations. Once done, coordinates for each destination can then be placed.
If the quantities to be shipped to every location are equal, the solution is straightforward, as you can simply average the x and y coordinates. When they are not (as is usually the case), a weighted average must be applied, with the weights being the quantities to be shipped. The center of mass of a system of particles is defined as the average of their positions weighted by their masses:
As an example, consider six locations that require a central warehouse; each are plotted on a map with the following x and y values, followed by their importance (weights):
3, 4, 8
5, 6, 2
6, 9, 2
9, 1, 10
11, 4, 3
11, 4, 13
6, 9, 2
Using the matplotlib/pylab extension for Python, this would be the result:

[...] such as the cost-profit-volume (CVP) or locational break even analysis, factor rating, center of gravity, single-facility rectilinear distance location, minimax, and the transportation model, each of [...]