import java.util.*; public class bellmanFord{ static class Edge{ int src, dest, weigh; Edge(int s, int d, int w){ src = s; dest = d; weigh = w; } } static void printPath(int vertex, int[] parent){ if(vertex==-1) return; printPath(parent[vertex], parent); System.out.print(vertex+" "); } public static void main(String[] args){ Scanner sc = new Scanner(System.in); System.out.print("Enter no. of vertices and edges: "); int n = sc.nextInt(); int e = sc.nextInt(); int[] parent = new int[n]; Edge[] edges = new Edge[e]; int[] dist = new int[n]; System.out.print("Enter the edges(src dest weight): "); for(int i=0;i