Skip to content

Commit

Permalink
tests: is_biconnected()
Browse files Browse the repository at this point in the history
  • Loading branch information
szhorvat committed Jan 30, 2024
1 parent c0c74bc commit d5ddf17
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_structural.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ class BiconnectedComponentTests(unittest.TestCase):
g1 = Graph.Full(10)
g2 = Graph(5, [(0, 1), (1, 2), (2, 3), (3, 4)])
g3 = Graph(6, [(0, 1), (1, 2), (2, 3), (3, 0), (2, 4), (2, 5), (4, 5)])
g4 = Graph.Full(2)
g5 = Graph.Full(1)

def testBiconnectedComponents(self):
s = self.g1.biconnected_components()
Expand All @@ -261,6 +263,13 @@ def testArticulationPoints(self):
self.assertTrue(self.g2.cut_vertices() == [1, 2, 3])
self.assertTrue(self.g3.articulation_points() == [2])

def testIsBiconnected(self):
self.assertTrue(self.g1.is_biconnected())
self.assertTrue(self.g2.is_biconnected())
self.assertFalse(self.g3.is_biconnected())
self.assertTrue(self.g4.is_biconnected())
self.assertFalse(self.g5.is_biconnected())


class CentralityTests(unittest.TestCase):
def testBetweennessCentrality(self):
Expand Down

0 comments on commit d5ddf17

Please sign in to comment.