public int removeEdge(Integer source, Integer target) {
    	if (!directed) {
    		for (Iterator<AdjacencyListElement> iter = lists[source].iterator(); iter.hasNext();) {
        		AdjacencyListElement e = iter.next();
                if (e.target.equals(target)) {
                    iter.remove();
                }
            }
    		for (Iterator<AdjacencyListElement> iter = lists[target].iterator(); iter.hasNext();) {
        		AdjacencyListElement e = iter.next();
                if (e.target.equals(source)) {
                    iter.remove();
                    return e.weight;
                }
            }
    	} else {
        	for (Iterator<AdjacencyListElement> iter = lists[source].iterator(); iter.hasNext();) {
        		AdjacencyListElement e = iter.next();
                if (e.target.equals(target)) {
                    iter.remove();
                    return e.weight;
                }
            }
        }
        return Integer.MAX_VALUE;
    }