public int getMaxMinDistance(int[] edgeLengthList, boolean max) 
	{
		int k = 0;
		if (max == true) {
			int mxm = edgeLengthList[0];
			for (int i = 0; i < edgeLengthList.length; i++) {
				int v = edgeLengthList[i];
				if (v > mxm) {

					mxm = v;

				}

			}
			k = mxm;
		}

		if (max == false) {
			int min = edgeLengthList[0];
			for (int i = 0; i < edgeLengthList.length; i++) {
				int v = edgeLengthList[i];
				if (v < min) {

					min = v;

				}

			}
			k = min;

		}
		return k;
	}