/** * Method to add an edge to the graph * * @param a : int - one end of edge * @param b : int - other end of edge * @param weight : int - the weight of the edge */ void addEdge(int a, int b, int weight) { Vertex u = verts.get(a); Vertex v = verts.get(b); Edge e = new Edge(u, v, weight); u.Adj.add(e); v.Adj.add(e); }