diff options
author | Toby Vincent <tobyv13@gmail.com> | 2021-04-22 01:43:55 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2021-04-22 01:54:54 -0500 |
commit | 7db1fdcfadad94aa7aea2acf36ec5fb84b27331f (patch) | |
tree | ba1014941f6a33bf96ee36ff19c1c8247ff809a5 /src/CS340.TSP/Road.cs | |
parent | 292555a07b72ae1470c49ee2cee82db16d1c9cbd (diff) |
cleaned up weight and key system
Diffstat (limited to 'src/CS340.TSP/Road.cs')
-rw-r--r-- | src/CS340.TSP/Road.cs | 5 |
1 files changed, 3 insertions, 2 deletions
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<double> + using IEdge = IEdge<double>; + public class Road : IEdge, IComparable<IEdge> { public int U { get; set; } public int V { get; set; } @@ -18,7 +19,7 @@ namespace TSP Weight = weight; } - public int CompareTo(IEdge<double> edge) => + public int CompareTo(IEdge edge) => Weight.CompareTo(edge.Weight); public override string ToString() => $"{U} {V} {Weight}"; |