<reponame>vincentdavis/special-sequences
from unittest import TestCase

from seqs.MinimumSpanningTree import MinimumSpanningTree


class MSTTest(TestCase):
    def test_MST(self):
        """Check that MinimumSpanningTree returns the correct answer."""
        G = {
            0: {1: 11, 2: 13, 3: 12},
            1: {0: 11, 3: 14},
            2: {0: 13, 3: 10},
            3: {0: 12, 1: 14, 2: 10},
        }
        T = [(2, 3), (0, 1), (0, 3)]
        for e, f in zip(MinimumSpanningTree(G), T):
            self.assertEqual(min(e), min(f))
            self.assertEqual(max(e), max(f))

from unittest import TestCase

from seqs.MinimumSpanningTree import MinimumSpanningTree


class MSTTest(TestCase):
    def test_MST(self):
        """Check that MinimumSpanningTree returns the correct answer."""
        G = {
            0: {1: 11, 2: 13, 3: 12},
            1: {0: 11, 3: 14},
            2: {0: 13, 3: 10},
            3: {0: 12, 1: 14, 2: 10},
        }
        T = [(2, 3), (0, 1), (0, 3)]
        for e, f in zip(MinimumSpanningTree(G), T):
            self.assertEqual(min(e), min(f))
            self.assertEqual(max(e), max(f))
Check that MinimumSpanningTree returns the correct answer.