#include #include #include #include //Structure for storing a graph struct Graph{ int vertexNum; int** edges; }; //Constructs a graph with V vertices and E edges void createGraph(struct Graph* G,int V){ G->vertexNum = V; G->edges =(int**) malloc(V * sizeof(int*)); for(int i=0; iedges[i] = (int*) malloc(V * sizeof(int)); for(int j=0; jedges[i][j] = INT_MAX; G->edges[i][i] = 0; } } //Adds the given edge to the graph void addEdge(struct Graph* G, int src, int dst, int weight){ G->edges[src][dst] = weight; } //Utility function to print distances void print(int dist[], int V){ printf("\nThe Distance matrix for Floyd - Warshall\n"); for(int i = 0; i < V; i++){ for(int j=0; jvertexNum; int dist[V][V]; //Initialise distance array for(int i=0; iedges[i][j]; //Calculate distances for(int k=0; k