Skip to content

Commit 934d1e8

Browse files
committed
add 100x100 test for the assignment problem
1 parent 9e36c4d commit 934d1e8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/testassignment.jl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,28 @@
2222
1 0 0
2323
]
2424
end
25+
26+
27+
@testset "Relatively big Assignment Problem (100x100)" begin
28+
29+
n = 100
30+
31+
mat = rand(10:1000, n, n)
32+
33+
# Ensure that the ith row has a 1 in the ith column
34+
for i in 1:n
35+
mat[i, i] = 1
36+
end
37+
38+
a = AssignmentProblem(mat)
39+
result::AssignmentResult = solve(a)
40+
41+
@test result.problem isa AssignmentProblem
42+
@test result.cost == n
43+
44+
for i in 1:n
45+
@test result.solution[i, i] == 1
46+
end
47+
48+
end
2549
end

0 commit comments

Comments
 (0)