Esempio n. 1
0
        public void BreadthFirstSearchTest()
        {
            Graph g = CreateGraph();

            Dictionary <int, int> distances;

            GraphAlgorithms.BreathFirstSearch(g, 0, out distances);

            Assert.AreEqual(0, distances[0], "Distance from 0");
            Assert.AreEqual(1, distances[11], "Distance from 11");
            Assert.AreEqual(2, distances[6], "Distance from 6");
            Assert.AreEqual(3, distances[5], "Distance from 5");
        }