Untitled

Anonymous
java
04/27/2023 2:53 AM
456 B
16
Indexable
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;
    }
}
Editor is loading...