Ejemplo n.º 1
0
 public TestRunner()
 {
     Factory = new GraphFactory <int, double>();
     Parser  = new DefaultGraphTextLineParser();
     Files   = new HashSet <string>();
     Graphs  = new Dictionary <string, IGraph <int> >();
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
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 <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>();
        }
Ejemplo n.º 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>();
        }
Ejemplo n.º 7
0
 public ConnectedComponentTests()
 {
     Factory = new GraphFactory <int, double>();
     Parser  = new DefaultGraphTextLineParser();
 }
Ejemplo n.º 8
0
 public MaxMatchingsTests()
 {
     Factory = new GraphFactory <int, double>();
     Parser  = new DefaultGraphTextLineParser();
 }
Ejemplo n.º 9
0
 public ShortestPathTests()
 {
     Factory = new GraphFactory <int, double>();
     Parser  = new DefaultGraphTextLineParser();
 }
Ejemplo n.º 10
0
 public MinimumSpanningTreeTests()
 {
     Factory = new GraphFactory <int, double>();
     Parser  = new DefaultGraphTextLineParser();
 }