Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbowly committed Oct 18, 2023
1 parent 9ed1faa commit f8bf258
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_bipartite_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ def test_random(self):
self.assertEqual(matching.shape, adjacency.shape)
self.assert_is_unweighted_matching(matching)

def test_random_csr_matrix(self):
# Property test for matchings on random graphs
adjacency, nodes1, nodes2 = random_bipartite(n1=8, n2=7, p=0.5, seed=98634)

matching = maximum_bipartite_matching(sp.csr_matrix(adjacency), nodes1, nodes2)

self.assertIsInstance(matching, sp.spmatrix)
self.assertIsNot(matching, adjacency)
self.assertEqual(matching.shape, adjacency.shape)
self.assert_is_unweighted_matching(matching)

def test_random_csr_array(self):
# Property test for matchings on random graphs
adjacency, nodes1, nodes2 = random_bipartite(n1=8, n2=7, p=0.5, seed=98634)
Expand Down

0 comments on commit f8bf258

Please sign in to comment.