public void reduce(Text key, Iterable<Text> values, Context context)
				throws IOException, InterruptedException {
			ArrayList<String> airports = new ArrayList<String>();
			airports.add(key.toString());
			for (Text a : values)
				airports.add(a.toString());

			double minCost = Double.MAX_VALUE;
			int minIndex = -1;
			for (int i = 0; i < airports.size(); i++) {
				double cost = 0;
				for (int j = 0; j < airports.size(); j++) {
					if (i == j)
						continue;
					String matrixKey = airports.get(i).compareTo(
							airports.get(j)) < 0 ? airports.get(i) + ","
							+ airports.get(j) : airports.get(j) + ","
							+ airports.get(i);
					double dis = matrix.containsKey(matrixKey) ? matrix
							.get(matrixKey) : 0;
					cost += dis;
				}
				if (cost <= minCost) {
					minCost = cost;
					minIndex = i;
				}
			}
			if (minIndex != 0) {
				context.getCounter(GLOBAL_COUNTER.center_changed).increment(1);
			}

			context.write(new Text(airports.get(minIndex)), NullWritable.get());
		}