Edge constructor

Edge(
  1. Node a,
  2. Node b
)

Implementation

Edge(this.a, this.b) {
  if (a == b) {
    throw Exception("Cannot create edge between the same node");
  }
}