private Element getBestFitting(Knapsack knapsack) throws Exception {
		HashMap<Integer, Element> notInsertedElements = knapsack.copyNotInsertedElements();
		Element best = null;
		
		// Searches the best fitting
		for (Integer key : notInsertedElements.keySet()) {
			Element element = notInsertedElements.get(key);
			
			// Initialization
			if (best == null) {
				best = element;
			} 
			
			// Comparison
			else if (element.getRatio() > best.getRatio()) {
				if (knapsack.fits(element)) {
					best = element;
				}
			}
		}
		
		// Exception check
		if (best == null) {
			throw new Exception();
		}
		
		return best;
	}