protected double getEdgeDistanceFromEdge(int i)
	{
		double energy = 0.0;
		// This function is only performed during fine tuning for performance
		if (isOptimizeEdgeDistance && isFineTuning)
		{
			for (int j = 0; j < v.length; j++)
			{
				// Don't calculate for connected nodes
				if (e[i].source != j && e[i].target != j)
				{
					double distSquare = Line2D.ptSegDistSq(v[e[i].source].x,
							v[e[i].source].y, v[e[i].target].x,
							v[e[i].target].y, v[j].x, v[j].y);

					distSquare -= v[j].radiusSquared;

					// prevents from dividing with Zero. No Math.abs() call
					// for performance
					if (distSquare < minDistanceLimitSquared)
						distSquare = minDistanceLimitSquared;

					// Only bother with the divide if the node and edge are
					// fairly close together
					if (distSquare < maxDistanceLimitSquared)
					{
						energy += edgeDistanceCostFactor / distSquare;
					}
				}
			}
		}
		return energy;
	}