Question: In this part, you will implement the data model to represent a graph as well as edges in the graph. Implement the following two classes


In this part, you will implement the data model to represent a graph as well as edges in the graph. Implement the following two classes Graph.java: This class uses an adjacency matrix as instance variable that can represent any weighted directed graph. It must have a default constructor and a constructor that expects an adjacency matrix as parameter. By default, the adjacency matrix represents the following weight undirected graph 2 4 The Graph class must have all methods in the following class diagram. A description for each method is given below Edge.java: This class represents a single edge in the graph consisting of the starting node, end node, and weight of the edge. The Edge must have all methods in the following class diagram. ava lang. Comparable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
