diff options
author | Toby Vincent <tobyv13@gmail.com> | 2021-04-22 01:08:33 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2021-04-22 01:08:33 -0500 |
commit | 292555a07b72ae1470c49ee2cee82db16d1c9cbd (patch) | |
tree | 21418f63624c37befaa34f57886d47b4a9824a8c /src/CS340.TSP/Road.cs | |
parent | d2dea1b16ff29f6e45fca971290f94d4e0ed2467 (diff) |
added more generics
Diffstat (limited to 'src/CS340.TSP/Road.cs')
-rw-r--r-- | src/CS340.TSP/Road.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/CS340.TSP/Road.cs b/src/CS340.TSP/Road.cs new file mode 100644 index 0000000..9711c3c --- /dev/null +++ b/src/CS340.TSP/Road.cs @@ -0,0 +1,26 @@ +using System; +using Interfaces; + +namespace TSP +{ + public class Road : IEdge<double> + { + public int U { get; set; } + public int V { get; set; } + public double Weight { get; set; } + + public Road() { } + + public Road(int u, int v, double weight) + { + U = u; + V = v; + Weight = weight; + } + + public int CompareTo(IEdge<double> edge) => + Weight.CompareTo(edge.Weight); + + public override string ToString() => $"{U} {V} {Weight}"; + } +} |