using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace VRPProblemAnalyzer { public static class Utils { public static List MatrixToPointList(double[,] vertices) { var points = new List(); for (int i = 0; i < vertices.GetLength(0); i++) { points.Add(new PointD(vertices[i, 0], vertices[i, 1])); } return points; } public static double GetDistance(double[,] vertices, int source, int target) { return Math.Sqrt( Math.Pow((vertices[source, 0] - vertices[target, 0]), 2) + Math.Pow((vertices[source, 1] - vertices[target, 1]), 2)); } } }