/// <summary> /// Create edges between all points. /// NOTE: For every two points there is two edges between them in case of asymetric problem (1 -> 2, 2 -> 1). /// </summary> private void CreateEdges() { for (int i = 0; i < Points.Count; i++) { for (int j = 0; j < Points.Count; j++) { if (i != j) { Edge edge = new Edge(Points[i], Points[j]); Edges.Add(Helper.HashFunction(Points[i].Id, Points[j].Id), edge); } } } }
/// <summary> /// Create edges between all points. /// NOTE: For every two points there is two edges between them in case of asymetric problem (1 -> 2, 2 -> 1). /// </summary> private void CreateEdges(int[][] distanceMatrix) { for (int i = 0; i < Points.Count; i++) { for (int j = 0; j < Points.Count; j++) { if (i != j) { // Override this edge creation with matrix distance Edge edge = new Edge(Points[i], Points[j]); edge.Length = distanceMatrix[i][j]; Edges.Add(Helper.HashFunction(Points[i].Id, Points[j].Id), edge); } } } }
/// <summary> /// Return edge beetwen two points (their ID's) from Dictionary /// </summary> public Edge GetEdge(int firstPointId, int secondPointId) { // TODO @thangle override this return(Edges[Helper.HashFunction(firstPointId, secondPointId)]); }
/// <summary> /// Return edge beetwen two points (their ID's) from Dictionary /// </summary> public Edge GetEdge(int firstPointId, int secondPointId) { return(Edges[Helper.HashFunction(firstPointId, secondPointId)]); }