예제 #1
0
        public void TestThoughtWorksRailNetwork10()
        {
            // The number of different routes from C to C with a distance of less than 30.
            // In the sample data, the trips are: CDC, CEBC, CEBCDC, CDCEBC, CDEBC, CEBCEBC, CEBCEBCEBC.
            PathGenerators pathGenerator = new PathGenerators(this.Graph);
            var            paths         = pathGenerator.GeneratePathsWithinRangeOfCost("C", "C", 1, 30);

            Console.WriteLine(paths?.Count.ToString() ?? "NO SUCH ROUTE");
        }
예제 #2
0
        public void TestThoughtWorksRailNetwork10()
        {
            // The number of different routes from C to C with a distance of less than 30.
            // In the sample data, the trips are: CDC, CEBC, CEBCDC, CDCEBC, CDEBC, CEBCEBC, CEBCEBCEBC.
            PathGenerators pathGenerator = new PathGenerators(this.Graph);
            var            paths         = pathGenerator.GeneratePathsWithinRangeOfCost("C", "C", 1, 30);

            Assert.IsNotNull(paths, "There should be paths");
            Assert.IsTrue(paths.Count == 7, "The number of paths from C to C with a distance of under 30 should be 7");
        }