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

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

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