public static void floyd() {
		for (int i = 0; i < nodes; i++) {
			dis[i][i] = 0;
			for (int j = 0; j < nodes; j++) {
				parent[i][j] = i;
				if (dis[i][j] == INF || i == j) {
					parent[i][j] = -1;
				}
			}
		}
		for (int k = 0; k < nodes; k++)
			for (int i = 0; i < nodes; i++)
				for (int j = 0; j < nodes; j++) 
					if (dis[i][j] > dis[i][k] + dis[k][j]) {
						dis[i][j] = dis[i][k] + dis[k][j];
						parent[i][j] = parent[k][j];
					}
	}