def test_empty_graph(self): MST, cost = prims_algo(self.G5, start=1) self.assertEqual(MST, self.correct_MST5) self.assertEqual(cost, self.correct_cost5)
def test_disconnected_graph(self): MST, cost = prims_algo(self.G4, start=1) self.assertEqual(MST, self.correct_MST4) self.assertEqual(cost, self.correct_cost4)
def test_triangle_graph(self): MST, cost = prims_algo(self.G2, start=1) self.assertEqual(MST, self.correct_MST2) self.assertEqual(cost, self.correct_cost2)
def test_trickier_mst(self): MST, cost = prims_algo(self.G3, start=1) self.assertEqual(MST, self.correct_MST3) self.assertEqual(cost, self.correct_cost3)
def test_linear_graph(self): MST, cost = prims_algo(self.G1, start=1) self.assertEqual(MST, self.correct_MST1) self.assertEqual(cost, self.correct_cost1)