Untitled

 avatar
unknown
java
2 years ago
340 B
4
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...