public static void bellmanFord(int s) {
		dist[s] = 0;

		for (int k = 0; k < V - 1; k++)
			for (int i = 0; i < V; i++)
				for (int j = 0; j < adj[i].size(); j++) {
					Edge neigh = adj[i].get(j);
					int v = neigh.v, p = neigh.p;
					if (dist[i] != INF && dist[i] + p < dist[v])
						dist[v] = dist[i] + p;
				}
		for (int u = 0; u < V; u++)
			for (int j = 0; j < adj[u].size(); j++) {
				Edge neigh = adj[u].get(j);
				int v = neigh.v, p = neigh.p;
				if (dist[u] != INF && dist[u] + p < dist[v]) {
					dist[v] = dist[u] + p;
					cycle[v] = true;
				}
			}
	}