public double findprob(String[] graph, int[] winprob, int[] looseprob, int Start)
	{
		double[] dp = new double[winprob.length];
		dp[Start] = 1;
		double win = 0;
		while (true) {
			double[] newDP = new double[winprob.length];
			double max = 0;
			int maxP = 0;
			for (int j = 0; j < newDP.length; j++) {
				double d = newDP[j];
				if (max < d) {
					max = d;
					maxP = j;
				}
			}
			double plus = dp[maxP] * winprob[maxP];
			win += plus;

			if (plus < 1E-9) {
				return win;
			}
			for (int i = 0; i < dp.length; i++) {
				for (int j = 0; j < dp.length; j++) {
					if (graph[i].charAt(j) == '1') {
						newDP[i] = Math.max(newDP[i],
								dp[j] * (1.0*winprob[i] / (winprob[i] + looseprob[i])));
					}
				}
			}
			dp = newDP;
		}
	}