public void addElements(ArrayList<Node>nodes,ArrayList<ArrayList<Edge>>edges){
    	 this.graph = new UndirectedSparseGraph<Integer,Edge>(); //Create a new undirected graph to save elements
    	 
    	//Add all the nodes
    	for (int i=0;i<nodes.size();i++){
    		this.graph.addVertex(nodes.get(i).id);
    	}
    	
    	//Add all the edges
    	int edgeNum = 0;
    	ArrayList<Edge> allEdges = new ArrayList<Edge>();
    	Edge currentEdge;
    	for (int i=0;i<edges.size();i++){
    		for (int j=0;j<edges.get(i).size();j++){
    			currentEdge = edges.get(i).get(j);
    			if (!findEdge(allEdges,currentEdge)){
    				this.graph.addEdge(edgeNum,currentEdge.node1, currentEdge.node2);
    				allEdges.add(currentEdge);
    				edgeNum++;
    			}    			
    		}
    	}
   	 //Just a test to see if it worked..
     //System.out.println(this.graph.toString());
    }