Exemple #1
0
        public void FindShortestPathTest_SimpleMatrix_SuccessfulFounded()
        {
            AdjacencyList list = FileHandler.CreateAdjacencyList(@"..\..\..\SimpleMatrix.txt");

            double[,] expected = { { 0, 1, 3 }, { 2, 0, 5 }, { 4, 5, 0 } };

            var actual = AlgorithmFloyd.FindShortestPathMatrix(list).Item1;

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void FindShortestPathTest_IsolatedVertex_IsolatedVertexInMatrix()
        {
            AdjacencyList list = FileHandler.CreateAdjacencyList(@"..\..\..\IsolatedVertex.txt");

            double[,] expected =
            {
                {                       0,                       1, Double.PositiveInfinity }
                ,{                       2,                       0, Double.PositiveInfinity }
                ,{ Double.PositiveInfinity, Double.PositiveInfinity,                       0 }
            };

            var actual = AlgorithmFloyd.FindShortestPathMatrix(list).Item1;

            Assert.AreEqual(expected, actual);
        }