private HashMap<String, ArrayList<String>> getNeighborhoodGraph(Set<String> dict) {
        
        if (dict == null)
            return null;
            
        ArrayList<String> dictList = new ArrayList<String>();
        dictList.addAll(dict);
        
        HashMap<String, ArrayList<String>> neighborhoodGraph = new HashMap<String, ArrayList<String>>();
        for (String string : dictList)
        	neighborhoodGraph.put(string, new ArrayList<String>());
        
        for (int i = 0; i < dictList.size() - 1; i ++) {
    		String s1 = dictList.get(i);
    		String s2;

        	for (int j = i + 1; j < dictList.size(); j ++) {
        		s2 = dictList.get(j);
        		
        		if (compareStrings(s1, s2) == 1) {
        			neighborhoodGraph.get(s1).add(s2);
        			neighborhoodGraph.get(s2).add(s1);
        		}
        	}
        }
        
        return neighborhoodGraph;
    }