private static int[] matchNodes(SquareMatrix S) {
		// Number of rows <= Number of columns
		int numRows = S.getNumberOfRows();
		int numCols = S.getNumberOfColumns();

		int[] matches = new int[numRows];
		ArrayList<Integer> tabuRows = new ArrayList<Integer>();
		ArrayList<Integer> tabuCols = new ArrayList<Integer>();

		for (int n = 0; n < matches.length; n++) {
			int bestRow = 0;
			int bestCol = 0;
			int bestScore = -2000;
			int nextScore;
			for (int i = 0; i < numRows; i++) {
				if (tabuRows.contains(i)) {
					continue;
				}
				for (int j = 0; j < numCols; j++) {
					if (tabuCols.contains(j)) {
						continue;
					}
					nextScore = S.getElement(i, j);
					if (nextScore > bestScore) {
						bestRow = i;
						bestCol = j;
						bestScore = nextScore;
					}
				}
			}
			matches[bestRow] = bestCol;
			tabuRows.add(bestRow);
			tabuCols.add(bestCol);
		}

		return matches;
	}