예제 #1
0
        public void GeneticAlgorithmTets()
        {
            string[]              lines       = File.ReadAllLines("BarabasiAlbertGraph1_M2.txt");
            GraphParser           graphParser = new GraphParser();
            Graph                 graph       = graphParser.ParseSimpleTxtFormat(lines);
            GeneticAlgorithmCore  ga          = new GeneticAlgorithmCore(graph, 20, 0.4, 0.4);
            FindingVertexResponse result      = ga.StartAlgorithm();

            Console.WriteLine(result.R);
        }
예제 #2
0
        public void CorrectGraphTest1()
        {
            string[] textGraph = new string[] {
                "0 1",
                "1 2",
            };
            GraphDTO graph = _parser.ParseSimpleTxtFormat(textGraph);

            Assert.AreEqual(graph.N, 3);
            Assert.AreEqual(graph.M, 2);
        }