summaryrefslogtreecommitdiffstats
path: root/src/CS340.TSP/Road.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/CS340.TSP/Road.cs')
-rw-r--r--src/CS340.TSP/Road.cs26
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}";
+ }
+}