Tools › Operations Research › Networks and Routing › Facility Location


Facility Location

Paste demand points (name, x, y, weight) and get the center of gravity, the point of least weighted distance by Weiszfeld's iteration, and the layout of one to five facilities with a map drawn to scale and the cost against the number of facilities. Candidate sites can be listed to choose among, and existing facilities can stay. Coordinates are plain x and y or latitude and longitude. The built-in data are illustrative. Straight-line distances; not a site recommendation.

  • The center of gravity and the point of least weighted distance, with the difference between them in cost

  • One to five facilities by location-allocation, or the least-cost choice among listed candidate sites, with fixed costs

  • A map to scale: demand points sized by weight and colored by the facility that serves them

  • Weighted distance against the number of facilities, each facility's load and distances, and the iteration shown step by step

Facility Location

/

What to Paste

Five demand points of different weight pull on one location. The center of gravity is the weighted average of the coordinates; the point of least weighted distance is a different point, nearer the heavy demand point Sample rows with the columns named. Demand points: name, x, y, weight and an optional rate. Candidate sites: name, x, y and an optional fixed cost. Existing facilities: name, x, y

Demand Points






Candidate Sites and Existing Facilities



Distance and Cost







Results for the default inputs above. Change any value and press Submit to run your own case.

Facility Location Check


December 4, 2026 / 12:09 am

Weighted distance
49,851
tons × mi; 1 new facility
Center of gravity costs
+9.23 %
more than the least-distance point
The two points are apart
18.6 mi
center of gravity to least-distance point
Mean distance
22.9 mi
weighted by tons; longest 62.3

The point of least weighted distance is on Ridgeport Mill (14.00, 46.00): 49,851 tons × mi. The center of gravity, 18.6 mi away at (31.69, 40.26), costs 9.23 % more (54,451).

Straight-line distances; not a site recommendation. These are the page's built-in rows: illustrative data with invented places and figures.

Figure 1: The layout drawn to scale. Each demand point is joined to the facility nearest to it. The hollow mark is the center of gravity; the diamond is the point of least weighted distance.
Figure 1: The layout drawn to scale. Each demand point is joined to the facility nearest to it. The hollow mark is the center of gravity; the diamond is the point of least weighted distance.

One Facility: Center of Gravity and Least-Distance Point

Center of gravity = the average of the coordinates, weighted by weight: x = Σ(weight × x) ÷ Σ(weight) = 69,080 ÷ 2,180 = 31.69; y = 87,770 ÷ 2,180 = 40.26. It is the point of least weighted squared distance. Its weighted distance is 54,451 tons × mi.

Least-distance point (the Weber point): no formula gives it. Weiszfeld's iteration starts at the center of gravity and repeats: new point = Σ(weight × coordinate ÷ distance) ÷ Σ(weight ÷ distance), with the distances measured from the current point. Each step lowers the weighted distance.

Table 1: Weiszfeld's iteration from the center of gravity
stepxyweighted distance
tons × mi
031.6940.2654,451center of gravity
127.7641.2552,935
224.9142.1552,022
314.0046.0049,851demand point passes the test: optimum

The optimum is a demand point, Ridgeport Mill. Test of a demand point: add up the pulls of all the other points on it, each a vector of length equal to its weight pointing at that point. If the length of the sum is not larger than the point's own weight, no move away from it lowers the weighted distance. Here the sum of the other pulls is 895.8 and the point's own weight is 1,000: 895.8 ≤ 1,000, so the search stops on it. The page tests the demand point nearest to each iterate, which is also how an iterate that lands exactly on a demand point is handled: it stays if the test passes and is stepped off along the combined pull if not.

Table 2: The first step in full, from the center of gravity
demand pointweightdistance from the startweight ÷ distance× x× y
mi
Ridgeport Mill1,00018.59653.7760752.8642,473.695
Alder Bay12038.1913.142118.85237.705
Birch Point9023.8003.781683.195234.457
Cobalt Springs18030.5465.8928324.102353.566
Dunmore16041.2403.8798271.58396.994
Eagle Pass14036.1513.8727185.88830.981
Fairhaven15016.3499.1750275.249220.199
Granite Falls13030.6804.2373262.711190.678
Harlow1108.61412.7698510.792485.252
Iron Gate10045.8402.1815165.793113.437
Sum102.70832,851.0274,236.964

New x = 2,851.027 ÷ 102.7083 = 27.76; new y = 4,236.964 ÷ 102.7083 = 41.25: step 1 of the table above.

Least-distance point: (14.00, 46.00), weighted distance 49,851 tons × mi. Center of gravity: (31.69, 40.26), 54,451 tons × mi, which is 9.23 % more. The two are 18.60 mi apart. The center of gravity follows far and heavy points more than the least-distance point does, because it squares the distances.

Cost Against the Number of Facilities

Each number of facilities is a separate search: assign every demand point to its nearest facility, move every facility to the least-distance point of its demand points, and repeat until nothing changes. The result depends on where the facilities start, so the page runs 30 seeded starts (and one from the layout with one facility fewer), keeps the lowest, and then tries moving one facility at a time onto a costly demand point, keeping a move that lowers the cost. This is a heuristic: a lower layout may exist. The last column counts the starts that ended within 0.01 % of the kept layout, and says when the relocation step lowered it further.

Figure 2: Weighted distance against the number of new facilities; the amber bar is the mapped layout
Table 3: Weighted distance by number of new facilities (bold: the mapped layout)
new facilitiesweighted distancechange from one fewerbelow one facilitystarts that reached it
tons × mitons × mi%
149,8510.0one start
225,951−23,90047.931 of 31
318,085−7,86563.717 of 31
414,305−3,78071.313 of 31
510,933−3,37278.14 of 31

The largest single drop is at facility number 2: 23,900 tons × mi. Every added facility lowers the weighted distance; what a facility costs to run is not in this figure unless candidate sites with fixed costs are entered.

Facilities

Table 4: Location, load and distances of each facility
no.facilityxydemand pointsloadshare of demandmean distancelongest distanceweighted distancewithin 20within 40within 60
tons%mimitons × mi% of load% of load% of load
1Facility 1 (on Ridgeport Mill)14.0046.00102,180100.022.8762.2949,85150.067.495.4
All102,180100.022.8762.2949,85150.067.495.4

Mean distance is weighted by tons. The last columns give the share of each facility's load that lies within 20, 40, 60 mi of it (round distances chosen from the layout). A new facility sits at the least-distance point of the demand points assigned to it; such a point can be in a lake or a field, and the nearest usable site is a separate question.

Assignment

Table 5: Each demand point, the facility nearest to it, and its weighted distance
demand pointweightfacilitydistanceweighted distanceshare of the total
tonsmitons × mi%
Ridgeport Mill1,000Facility 10.0000.0
Alder Bay120Facility 134.934,1918.4
Birch Point90Facility 117.891,6103.2
Cobalt Springs180Facility 143.327,79815.6
Dunmore160Facility 159.819,56919.2
Eagle Pass140Facility 150.997,13914.3
Fairhaven150Facility 127.204,0808.2
Granite Falls130Facility 148.016,24112.5
Harlow110Facility 127.202,9926.0
Iron Gate100Facility 162.296,22912.5
All2,18049,851100.0

Weighted distance of a demand point = weight × distance to its facility. For Dunmore, the largest: 160 × 59.81 = 9,569 tons × mi. The printed distance is rounded; the page computes with the full value.

Notes

Distances are straight lines between the pasted coordinates, not road distances or travel times. Each demand point stands for everything shipped to its place. The weighted distance is the only thing minimized: land, labor, taxes, capacity, service times and what a facility costs to run are outside it.

The results describe the entered points under these distances. They are not a site recommendation.


References

Weber, A. (1909). Über den Standort der Industrien, Erster Teil: Reine Theorie des Standorts. J. C. B. Mohr, Tübingen.

Weiszfeld, E. (1937). "Sur le point pour lequel la somme des distances de n points donnés est minimum." Tôhoku Mathematical Journal, Vol. 43, pp. 355–386.

Beck, A., and Sabach, S. (2015). "Weiszfeld's Method: Old and New Results." Journal of Optimization Theory and Applications, Vol. 164, No. 1, pp. 1–40.

Kuhn, H. W. (1973). "A Note on Fermat's Problem." Mathematical Programming, Vol. 4, pp. 98–107.

Vardi, Y., and Zhang, C.-H. (2001). "A Modified Weiszfeld Algorithm for the Fermat-Weber Location Problem." Mathematical Programming, Vol. 90, pp. 559–566.

Cooper, L. (1963). "Location-Allocation Problems." Operations Research, Vol. 11, pp. 331–343.

Hakimi, S. L. (1964). "Optimum Locations of Switching Centers and the Absolute Centers and Medians of a Graph." Operations Research, Vol. 12, pp. 450–459.

Teitz, M. B., and Bart, P. (1968). "Heuristic Methods for Estimating the Generalized Vertex Median of a Weighted Graph." Operations Research, Vol. 16, pp. 955–961.


DISCLAIMER: The methods and calculation on aNOWysis.com are provided as means to educate the reader. There is no warranty, expessed or implied, as to the relevance or accuracy of the methods or calculations. All calculations should be checked by a qualified analyst for appropriateness and accuracy. We will not be held liable for any damages, injuries or deaths caused by using methods or calculations from this site.