From 7db1fdcfadad94aa7aea2acf36ec5fb84b27331f Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Thu, 22 Apr 2021 01:43:55 -0500 Subject: cleaned up weight and key system --- src/CS340.TSP/Road.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/CS340.TSP/Road.cs') diff --git a/src/CS340.TSP/Road.cs b/src/CS340.TSP/Road.cs index 9711c3c..cc939e9 100644 --- a/src/CS340.TSP/Road.cs +++ b/src/CS340.TSP/Road.cs @@ -3,7 +3,8 @@ using Interfaces; namespace TSP { - public class Road : IEdge + using IEdge = IEdge; + public class Road : IEdge, IComparable { public int U { get; set; } public int V { get; set; } @@ -18,7 +19,7 @@ namespace TSP Weight = weight; } - public int CompareTo(IEdge edge) => + public int CompareTo(IEdge edge) => Weight.CompareTo(edge.Weight); public override string ToString() => $"{U} {V} {Weight}"; -- cgit v1.2.3-70-g09d2