public void huffman(){
		
		TreeSet<Federation> fedTree = new TreeSet<Federation>( new Comparator<Federation>(){

			@Override
			public int compare(Federation arg0, Federation arg1) {
				// TODO Auto-generated method stub
				if(arg0.getNum_nodes() < arg1.getNum_nodes())
					return -1;
				else if(arg0.getNum_nodes() > arg1.getNum_nodes())
					return 1;
				if(arg0.getId() < arg1.getId())
					return -1;
				else
					return 1;
			}	
		});
		
		while(!isHuffBalance()){		
			fedTree.clear();
			for (Federation federation : fedList) {
				fedTree.add(federation);
			}
			Federation a = fedTree.pollFirst();
			Federation b = fedTree.pollFirst();
			fedTree.add(combineFeder(a, b));	
			fedList = new ArrayList<Federation>(fedTree);
		}	
	}