图的接口定义 Graph public class UnsupportedOperation extends RuntimeException {public UnsupportedOperation(String err) {super(err);} } public interface Graph {public static final int UndirectedGraph = 0;//无向图public static final int DirectedGraph = 1;//有向图…