Exemplo n.º 1
0
        public void Test_Weigth()
        {
            EdgeWeightedGraph graph = this.CreateGraph();
            PrimMSTAlgorithm  msta  = PrimMSTAlgorithm.Create(graph);

            Assert.Equal(1.6, Math.Round(msta.Weight, 1));
        }
Exemplo n.º 2
0
        public void Test_GetEdges_Iteration()
        {
            EdgeWeightedGraph graph = this.CreateGraph();
            PrimMSTAlgorithm  msta  = PrimMSTAlgorithm.Create(graph);

            AssertUtilities.Sequence(new Edge[4]
            {
                new Edge(0, 1, .5),
                new Edge(1, 2, .3),
                new Edge(1, 3, .6),
                new Edge(0, 4, .2)
            },
                                     msta.GetEdges());
        }