public int[][] buildTestMat(String filename) throws IOException {
		Scanner fScanner = null;
		try {
			fScanner = new Scanner(new File(filename));
		} catch (FileNotFoundException e) {
			System.err.println(filename + " not found.");
			System.exit(1);
		}
		String type = fScanner.nextLine();
		if (!type.equals("Weighted AdjMat"))
			throw new IOException("expecting Weighted AdjMat");
		int size = fScanner.nextInt();
		int[][] adjMat = new int[size][size];
		fScanner.nextLine();
		for (int i = 0; i < size; i++) {
			String[] neighborStr = fScanner.nextLine().split(" ");
			for (int j = 0; j < size; j++) {
				adjMat[i][j] = Integer.parseInt(neighborStr[j]);
				if (adjMat[i][j] == -1)
					adjMat[i][j] = Integer.MAX_VALUE / 2;
			}
		}
		return adjMat;
	}