public class Edge { private Node target; private Integer weight; public Edge(Node target, Integer weight) { this.target = target; this.weight = weight; } // Restituisce il nodo puntato dall'arco public Node getTarget() { return target; } // Restituisce il peso dell'arco public Integer getWeight() { return weight; } public String toString() { return target.toString() + "[peso=" + weight + "]"; } }