#include #include using namespace std; //Wrapper class for storing a graph class Graph{ public: int vertexNum; int** edges; //Constructs a graph with V vertices and E edges Graph(int V){ this->vertexNum = V; this->edges =(int**) malloc(V * sizeof(int*)); for(int i=0; iedges[i] = (int*) calloc(V, sizeof(int)); } //Adds the given edge to the graph void addEdge(int src, int dst, int weight){ this->edges[src][dst] = weight; } }; //Utility function to find minimum distance vertex in mdist int minDistance(int mdist[], bool vset[], int V){ int minVal = INT_MAX, minInd; for(int i=0; i>V; cout<<"Enter number of edges: "; cin>>E; Graph G(V); for(int i=0; i>src; cout<<"Enter destination: "; cin>>dst; cout<<"Enter weight: "; cin>>weight; G.addEdge(src, dst, weight); } cout<<"\nEnter source:"; cin>>gsrc; Dijkstra(G,gsrc); return 0; }