Untitled

mail@pastecode.io avatar
unknown
java
a year ago
340 B
1
Indexable
Never
package LAB9;

public class GraphEdge
{
    GraphNode fromNode;
    GraphNode toNode;
    int weight; // Add a weight field

    // Update the constructor to include the weight
    public GraphEdge(GraphNode from, GraphNode to, int weight)
    {
        this.fromNode = from;
        this.toNode = to;
        this.weight = weight;
    }
}