private void AddEdge(EuclideanGraphNode <T> node1, EuclideanGraphNode <T> node2) { if (!ContainsEdge(node1, node2)) { EuclideanGraphEdge <T> newEdge = new EuclideanGraphEdge <T>(node1, node2); Edges.Add(newEdge); node1.Edges.Add(newEdge); node2.Edges.Add(newEdge); } }
public static int Compare(EuclideanGraphEdge <T> edge1, EuclideanGraphEdge <T> edge2) { float comparison = edge1.GetLength() - edge2.GetLength(); if (comparison < 0) { return(-1); } else if (comparison == 0) { return(0); } else { return(1); } }