Graph k median facility location calculator from weighted distances

Your numbers

Zero-based labels 0 through n−1; all declared vertices remain included.
One row: u v positive-weight.
Exactly k distinct facilities, between 1 and min(5,n).
One nonnegative weight for each vertex, in label order.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

QuickCalculators · Full calculator and methodology ↗