private void match(SegmentedImage A, SegmentedImage B){
//		int numNodes = Math.max(A.numCells(), B.numCells()) + 3;
		
		double[][] costs = assignCosts(A, B);
		
		HungarianAlgorithm hungarian = new HungarianAlgorithm(costs);
		
		int[] assigns = hungarian.execute();
		
		for(int i = 0; i < A.numCells(); i++){
			A.setSuccessor(i, (assigns[i] == -1 || assigns[i] >= B.numCells()) ? null : B.getCell(assigns[i]));
		}
		
	}