double getDistance0(Vector<Integer> cluster1, Vector<Integer> cluster2) {
		double fBestDist = Double.MAX_VALUE;
		switch (m_nLinkType) {
		case SINGLE:
		case NEIGHBOR_JOINING:
		case CENTROID:
		case COMPLETE:
		case ADJCOMLPETE:
		case AVERAGE:
		case MEAN:
			// set up two instances for distance function
			Instance instance1 = (Instance) m_instances.instance(cluster1.elementAt(0)).copy();
			Instance instance2 = (Instance) m_instances.instance(cluster2.elementAt(0)).copy();
			fBestDist = m_DistanceFunction.distance(instance1, instance2);
			break;
		case WARD:
			{
				// finds the distance of the change in caused by merging the cluster.
				// The information of a cluster is calculated as the error sum of squares of the
				// centroids of the cluster and its members.
				double ESS1 = calcESS(cluster1);
				double ESS2 = calcESS(cluster2);
				Vector<Integer> merged = new Vector<Integer>();
				merged.addAll(cluster1);
				merged.addAll(cluster2);
				double ESS = calcESS(merged);
				fBestDist = ESS * merged.size() - ESS1 * cluster1.size() - ESS2 * cluster2.size();
			}
			break;
		}
		return fBestDist;
	} // getDistance0