예제 #1
0
 public TestRunner()
 {
     Factory = new GraphFactory <int, double>();
     Parser  = new DefaultGraphTextLineParser();
     Files   = new HashSet <string>();
     Graphs  = new Dictionary <string, IGraph <int> >();
 }
예제 #2
0
 public MaxFlowTests()
 {
     Factory             = new GraphFactory <int, double>();
     Parser              = new DefaultGraphTextLineParser();
     CombineFlowValues   = (double currentFlow, double augmentingFlow) => currentFlow + augmentingFlow;
     SubstractFlowValues = (double currentFlow, double augmentingFlow) => currentFlow - augmentingFlow;
 }
예제 #3
0
        public void TestSmallGraphs()
        {
            DefaultGraphTextLineParser parser = new DefaultGraphTextLineParser();
            Graph <int, double>        graph1 = Factory.CreateGraphFromFile("./graphs/complete/K_12.txt", parser);
            Graph <int, double>        graph2 = Factory.CreateGraphFromFile("./graphs/complete/K_12e.txt", parser);

            TestTspAlgorithms(graph1, 12, 12, 45.19);
            TestTspAlgorithms(graph2, 12, 12, 36.13);
        }
예제 #4
0
        public void TestTinyGraphs()
        {
            DefaultGraphTextLineParser parser = new DefaultGraphTextLineParser();
            Graph <int, double>        graph1 = Factory.CreateGraphFromFile("./graphs/complete/K_10.txt", parser);
            Graph <int, double>        graph2 = Factory.CreateGraphFromFile("./graphs/complete/K_10e.txt", parser);

            TestTspAlgorithms(graph1, 10, 10, 38.41);
            TestTspAlgorithms(graph2, 10, 10, 27.26);
        }
예제 #5
0
파일: TestRunner.cs 프로젝트: alex-c/Graft
        public TestRunner()
        {
            Factory = new GraphFactory <int, double>();
            Parser  = new DefaultGraphTextLineParser();
            Files   = new HashSet <string>();
            Graphs  = new Dictionary <string, IWeightedGraph <int, double> >();

            // Set which algorithms should be tested
            AlgorithmsToTest = new HashSet <ALGORITHM>()
            {
                ALGORITHM.KRUSKAL,
                ALGORITHM.PRIM
            };

            // Configure Serilog
            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Debug()
                         .WriteTo.Console()
                         .CreateLogger();

            // Set Serilog logger to Microsoft's ILogger
            Logger = new LoggerFactory().AddSerilog().CreateLogger <TestRunner>();
        }
예제 #6
0
        public TestRunner()
        {
            Factory = new GraphFactory <int, double>();
            Parser  = new DefaultGraphTextLineParser();
            Files   = new HashSet <string>();
            Graphs  = new Dictionary <string, IWeightedGraph <int, double> >();

            // Set which algorithms should be tested
            AlgorithmsToTest = new HashSet <TspAlgorithm>()
            {
                TspAlgorithm.NearestNeighbor,
                TspAlgorithm.DoubleTree,
                TspAlgorithm.BruteForce
            };

            // Configure Serilog
            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Debug()
                         .WriteTo.Console()
                         .CreateLogger();

            // Set Serilog logger to Microsoft's ILogger
            Logger = new LoggerFactory().AddSerilog().CreateLogger <TestRunner>();
        }
예제 #7
0
 public ConnectedComponentTests()
 {
     Factory = new GraphFactory <int, double>();
     Parser  = new DefaultGraphTextLineParser();
 }
예제 #8
0
 public MaxMatchingsTests()
 {
     Factory = new GraphFactory <int, double>();
     Parser  = new DefaultGraphTextLineParser();
 }
예제 #9
0
 public ShortestPathTests()
 {
     Factory = new GraphFactory <int, double>();
     Parser  = new DefaultGraphTextLineParser();
 }
예제 #10
0
 public MinimumSpanningTreeTests()
 {
     Factory = new GraphFactory <int, double>();
     Parser  = new DefaultGraphTextLineParser();
 }