MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / test3

Function test3

code/graph/dinic.test.cpp:51–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void test3() {
52 int N = 20;
53 int MAX = 100000;
54
55 flow_network mf(N);
56 ek::flow_network mf2(N);
57
58 for(int i = 0; i < N; i++) {
59 for(int j = 0; j < N; j++) {
60 int cap = rng() % MAX + 1;
61 mf.add_edge(i, j, cap, cap);
62 mf.add_edge(i, j, cap, cap);
63 mf2.add_edge(i, j, cap, cap);
64 mf2.add_edge(i, j, cap, cap);
65 }
66 }
67
68 for(int i = 0; i < N; ++i) {
69 for(int j = 0; j < N; ++j) {
70 if (i != j)
71 assert_equal(mf2.max_flow(i, j), mf.max_flow(i, j));
72 }
73 }
74}
75
76void test() {
77 /* Field testing: Uva10330, UVa10480, UVa12125, Kattis maxflow */

Callers 1

testFunction · 0.70

Calls 3

assert_equalFunction · 0.50
add_edgeMethod · 0.45
max_flowMethod · 0.45

Tested by

no test coverage detected