/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package graphalgorithms;

/**
 *
 * @author piyush
 */
import java.util.ArrayList;
import java.util.List;
        
public class Graph {
    private List<Vertex> vertices= new ArrayList<>();
    private List<Edge> edges= new ArrayList<>();
    
    Graph(ArrayList <Vertex> vertices, ArrayList <Edge> edges){
        this.vertices=vertices;
        this.edges=edges;
    }
    
}

@@ -254,40 +254,9 @@
 til.
-ArrayList;%0Aimport java.util.List
+*
 ;%0A  
@@ -382,24 +382,111 @@
 ayList%3C%3E();%0A
+    private Map adjMat= new HashMap();%0A    private boolean madeAdjacencyMatrix= false;%0A
     %0A    Gra
@@ -570,24 +570,24 @@
 s=vertices;%0A
-
         this
@@ -611,10 +611,505 @@
  %7D%0A    %0A
+    public void addVertex(Vertex vertex)%7B%0A        this.vertices.add(vertex);%0A    %7D%0A    %0A    public void addEdge(Edge edge)%7B%0A        this.edges.add(edge);%0A        if (this.madeAdjacencyMatrix)%0A    %7D%0A    %0A    public void makeAdjacencyMatrix()%7B%0A        this.madeAdjacencyMatrix=true;%0A        %0A    %0A    %7D%0A    %0A    public Map getAdjacencyMatrix()%7B%0A        if (madeAdjacencyMatrix==False)%7B%0A            this.makeAdjacencyMatrix();%0A            %0A        %7D%0A        %0A        return this.adjMat;%0A    %7D%0A    %0A
 %7D%0A

Update Graph.java