@@ -46,15 +46,15 @@ struct Graph
4646 int maxWeight = -1e9 ;
4747
4848 vector<Edge> edges;
49- vector<vector<int >> adj;
50- vector<vector<int >> weight;
49+ vector<vector<int >> adj;
50+ vector<vector<int >> weight;
5151
5252 Graph (int v, int e) : V(v), E(e)
5353 {
5454 vector<vector<bool >> used (V, vector<bool >(V, false ));
5555
56- adj.resize (V);
57- weight.resize (V, vector<int >(V, UNKNOWN));
56+ adj.resize (V);
57+ weight.resize (V, vector<int >(V, UNKNOWN));
5858
5959 while (e)
6060 {
@@ -76,16 +76,16 @@ struct Graph
7676
7777 // Add to edges and mark as used
7878 edges.push_back (Edge (u, v, w));
79- adj[u].push_back (v);
80- weight[u][v] = w;
79+ adj[u].push_back (v);
80+ weight[u][v] = w;
8181 maxWeight = max (maxWeight, w);
8282
8383 used[u][u] = used[v][v] = used[u][v] = used[v][u] = true ;
8484 e--;
8585 }
8686 for (int i = 0 ; i < V; i++)
8787 {
88- // Set V to -1 to indicate the graph is invalid
88+ // Set V to -1 to indicate the graph is invalid
8989 if (!used[i][i])
9090 {
9191 V = -1 ;
@@ -192,14 +192,14 @@ RESULT TestGraph(Graph G)
192192
193193 for (auto edge : G.edges )
194194 {
195- G.weight [edge.u ][edge.v ] += (distance[edge.u ] - distance[edge.v ]);
195+ G.weight [edge.u ][edge.v ] += (distance[edge.u ] - distance[edge.v ]);
196196 }
197197
198198 double result = 0 ;
199199
200200 for (int i = 0 ; i < G.V ; i++)
201201 {
202- vector<int > shortest = Dijkstra (i, G);
202+ vector<int > shortest = Dijkstra (i, G);
203203
204204 double average = 0 ;
205205 int count = 0 ;
0 commit comments