public void outputGraph(String fileNameLocalIndexes, String fileNameTrueIndexes) throws Exception{
		
		//get nodes with edges
		HashSet<Integer> nodesWithEdges = new HashSet<Integer>();
		for(int i : this.graph.keySet()){
        	for(int j : this.graph.get(i).keySet()){
        		nodesWithEdges.add(i);
        		nodesWithEdges.add(j);
        	}
        }
		
		//map those nodes to a sequence from 1 to totalNodes
		int totalNodes = nodesWithEdges.size();
		HashMap<Integer, Integer> nodeMap = new HashMap<Integer, Integer>(); // <node, index>
		int index = 1;
		for(int node : nodesWithEdges){
			nodeMap.put(node, index);
			index++;
		}
		
		//LOCAL INDEXES
		BufferedWriter bw = new BufferedWriter(new FileWriter(fileNameLocalIndexes));
		
		//output nodes
		for(int i=1; i<= this.graph.keySet().size(); i++){
			bw.append(String.valueOf(i)+"\n");
		}
		
		bw.append("\n");
		
		//output edges
		int i_idx, j_idx;
		for(int i : this.graph.keySet()){
        	for(int j : this.graph.get(i).keySet()){
        		i_idx = nodeMap.get(i);
        		j_idx = nodeMap.get(j);
        		bw.append(String.valueOf(i_idx)+"\t"+String.valueOf(j_idx)+"\n");
        	}
        }
		
		bw.flush();
		bw.close();
		
		//TRUE INDEXES
		bw = new BufferedWriter(new FileWriter(fileNameTrueIndexes));
				
		//output edges
		for(int i : this.graph.keySet()){
        	for(int j : this.graph.get(i).keySet()){
        		bw.append(String.valueOf(i)+"\t"+String.valueOf(j)+"\n");
        	}
        }
		
		bw.flush();
		bw.close();
		
		System.out.println("Graph written to file");
	}