Graph(String file){
		// Control thread will be represented by index n+1 which will have edges to all other nodes and from all other nodes.
		try {
			Graph.numFinished = 0;
			Scanner s = new Scanner(new File(file));
			n = Integer.parseInt(s.nextLine());
			incQueues = new Link[n][n];
			AdjacencyMatrix = new double[n][n];
			for(int i=0; i<n; i++){
				String line[] = s.nextLine().split("[,\\s]");
				for(int j=0; j<line.length; j++){
					AdjacencyMatrix[i][j] =Double.parseDouble(line[j]);
					if(AdjacencyMatrix[i][j] != 0) {
						incQueues[j][i] = new Link();
					}
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}