コード例 #1
0
        public void Graph10_BellmanFord()
        {
            var graph       = GraphGenerator.Graph10();
            var bellmanFord = new BellmanFord(graph);
            var result      = bellmanFord.Work(false);

            int[] excected = { 0, 1, 10, 3, 4, 30, 40 };
            Assert.AreEqual(true, ArrayComparer.Compare(excected, result));
        }
コード例 #2
0
        public void Graph10_Dijkstra()
        {
            var graph    = GraphGenerator.Graph10();
            var dijkstra = new Dijkstra(graph);
            var result   = dijkstra.Work(false);

            int[] excected = { 0, 1, 10, 3, 4, 30, 40 };
            Assert.AreEqual(true, ArrayComparer.Compare(excected, result));
        }