Exemplo n.º 1
0
        public void Graph9_BellmanFord()
        {
            var graph       = GraphGenerator.Graph9();
            var bellmanFord = new BellmanFord(graph);
            var result      = bellmanFord.Work(false);

            int[] excected = { 0, 1, 3, 1 };
            Assert.AreEqual(true, ArrayComparer.Compare(excected, result));
        }
Exemplo n.º 2
0
        public void Graph9_Dijkstra()
        {
            var graph    = GraphGenerator.Graph9();
            var dijkstra = new Dijkstra(graph);
            var result   = dijkstra.Work(false);

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