Index: branches/QAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QAPView.cs
===================================================================
--- branches/QAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QAPView.cs	(revision 5855)
+++ branches/QAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QAPView.cs	(revision 5871)
@@ -216,15 +216,15 @@
         Bitmap newBitmap = new Bitmap(pictureBox.Width, pictureBox.Height);
 
-        for (int i = 0; i < distances.Rows; i++) {
-          for (int j = i + 1; j < distances.Rows; j++)
-            if (distances[i, j] != distances[j, i]) {
-              WriteCenteredTextToBitmap(ref newBitmap, "Distance matrix is not symmetric");
-              return newBitmap;
-            }
-        }
-
-        double stress;
-        DoubleMatrix coordinates = MultidimensionalScaling.MetricByDistance(distances, out stress);
-        stressLabel.Text = stress.ToString("0.00", CultureInfo.CurrentCulture.NumberFormat);
+        DoubleMatrix coordinates;
+        double stress = double.NaN;
+        try {
+          coordinates = MultidimensionalScaling.KruskalShepard(distances);
+          stress = MultidimensionalScaling.CalculateNormalizedStress(distances, coordinates);
+          stressLabel.Text = stress.ToString("0.00", CultureInfo.CurrentCulture.NumberFormat);
+        } catch {
+          WriteCenteredTextToBitmap(ref newBitmap, "Distance matrix is not symmetric");
+          stressLabel.Text = "-";
+          return newBitmap;
+        }
         double xMin = double.MaxValue, yMin = double.MaxValue, xMax = double.MinValue, yMax = double.MinValue;
         double maxDistance = double.MinValue;
@@ -302,9 +302,4 @@
             if (weights[i, j] > maxWeight)
               maxWeight = weights[i, j] + weights[j, i];
-
-            if (weights[i, j] != weights[j, i]) {
-              WriteCenteredTextToBitmap(ref newBitmap, "Weights matrix is not symmetric");
-              return newBitmap;
-            }
           }
 
@@ -315,7 +310,15 @@
           }
 
-        double stress;
-        DoubleMatrix coordinates = MultidimensionalScaling.MetricByDistance(distances, out stress);
-        stressLabel.Text = stress.ToString("0.00", CultureInfo.CurrentCulture.NumberFormat);
+        DoubleMatrix coordinates;
+        double stress = double.NaN;
+        try {
+          coordinates = MultidimensionalScaling.KruskalShepard(distances);
+          stress = MultidimensionalScaling.CalculateNormalizedStress(distances, coordinates);
+          stressLabel.Text = stress.ToString("0.00", CultureInfo.CurrentCulture.NumberFormat);
+        } catch {
+          WriteCenteredTextToBitmap(ref newBitmap, "Weights matrix is not symmetric");
+          stressLabel.Text = "-";
+          return newBitmap;
+        }
         double xMin = double.MaxValue, yMin = double.MaxValue, xMax = double.MinValue, yMax = double.MinValue;
         for (int i = 0; i < coordinates.Rows; i++) {
@@ -382,15 +385,27 @@
             if (distances[i, j] != distances[j, i]) {
               WriteCenteredTextToBitmap(ref newBitmap, "Distance matrix is not symmetric");
+              stressLabel.Text = "-";
               return newBitmap;
             }
             if (weights[i, j] != weights[j, i]) {
               WriteCenteredTextToBitmap(ref newBitmap, "Weights matrix is not symmetric");
+              stressLabel.Text = "-";
+              return newBitmap;
             }
           }
         }
 
-        double stress;
-        DoubleMatrix coordinates = MultidimensionalScaling.MetricByDistance(distances, out stress);
-        stressLabel.Text = stress.ToString("0.00", CultureInfo.CurrentCulture.NumberFormat);
+        DoubleMatrix coordinates = null;
+        double stress = double.NaN;
+        try {
+          coordinates = MultidimensionalScaling.KruskalShepard(distances);
+          stress = MultidimensionalScaling.CalculateNormalizedStress(distances, coordinates);
+          stressLabel.Text = stress.ToString("0.00", CultureInfo.CurrentCulture.NumberFormat);
+        } catch {
+          WriteCenteredTextToBitmap(ref newBitmap, "Unknown error");
+          stressLabel.Text = "-";
+          return newBitmap;
+        }
+
         double xMin = double.MaxValue, yMin = double.MaxValue, xMax = double.MinValue, yMax = double.MinValue;
         double maxWeight = double.MinValue;
