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