package datastructures.graph;

public class Edge<T> {
  public int weight = 0;
  public Vertex<T> sourceVertex;
  public Vertex<T> destVertex;

  public Edge() {
    this(null, null);
  }

  public Edge(Vertex<T> sourceVertex, Vertex<T> destVertex) {
    this(sourceVertex, destVertex, 0);
  }

  public Edge(Vertex<T> sourceVertex, Vertex<T> destVertex, int weight) {
    this.sourceVertex = sourceVertex;
    this.destVertex = destVertex;
    this.weight = weight;
  }

  @Override
  public String toString() {
    return "Edge [ sourceVertex=" + sourceVertex + ", destVertex=" + destVertex + ", weight=" + weight + " ]";
  }
}

@@ -72,16 +72,39 @@
 ht = 0;%0A
+  public String label;%0A
   public
@@ -381,24 +381,165 @@
 t weight) %7B%0A
+    this(sourceVertex, destVertex, weight, %22%22);%0A  %7D%0A%0A  public Edge(Vertex%3CT%3E sourceVertex, Vertex%3CT%3E destVertex, int weight, String label) %7B%0A
     this.sou
@@ -624,16 +624,40 @@
 weight;%0A
+    this.label = label;%0A
   %7D%0A%0A  @

Add additional data to be added to the Edge in a Graph