MCPcopy Create free account
hub / github.com/Ayush7614/Daily-Coding-DS-ALGO-Practice / main

Function main

Algorithms/JohnsonAlgorithm.cpp:198–228  ·  view source on GitHub ↗

main function

Source from the content-addressed store, hash-verified

196
197// main function
198int main () {
199
200 int t;
201 cin >> t;
202
203 int n, m;
204 for (int t_no = 0; t_no < t; t_no ++) {
205 cin >> n >> m;
206
207 int u, v, w;
208 for (int i = 0; i < m; i ++) {
209 cin >> u >> v >> w;
210 adj[u].push_back({v, w});
211 edges.push_back({u, {v, w}});
212 }
213
214 int res = johnson(t_no, n, m);
215
216 if (res == 0) {
217 cout << "graph " << t_no + 1 << " ";
218 cout << "no" << endl;
219 }
220
221 cout << endl;
222 for (int i = 1; i <= n; i ++) {
223 adj[i].clear();
224 adj_new[i].clear();
225 }
226 edges.clear();
227 }
228}
229
230
231/*

Callers

nothing calls this directly

Calls 1

johnsonFunction · 0.85

Tested by

no test coverage detected