public void DivideProblemOfSize15Test()
        {
            var file = File.ReadAllText("test_of_size_15.vrp");
            var problemBytes = Encoding.UTF8.GetBytes(file);

            var dvrpTaskSolver = new DVRPTaskSolver.DVRPTaskSolver(problemBytes);

            var partialProblemsBytes = dvrpTaskSolver.DivideProblem(0);

            Assert.AreEqual(32768, partialProblemsBytes.Length);
        }
        public void DivideProblemOfSize1Test()
        {
            var file = File.ReadAllText("test_of_size_1.vrp");
            var problemBytes = Encoding.UTF8.GetBytes(file);

            var dvrpTaskSolver = new DVRPTaskSolver.DVRPTaskSolver(problemBytes);

            var partialProblemsBytes = dvrpTaskSolver.DivideProblem(0);

            var partialProblems = new int[partialProblemsBytes.Length][];
            for (var i = 0; i < partialProblemsBytes.Length; i++)
                partialProblems[i] = DVRPLocationsSubset.GetFromByteArray(partialProblemsBytes[i]).Locations;

            var expected = new int[2][];
            expected[0] = new int[0];
            expected[1] = new[] { 1 };

            Assert.AreEqual(expected.Length, partialProblemsBytes.Length);
            for (var i = 0; i < expected.Length; i++)
                CollectionAssert.AreEqual(expected[i], partialProblems[i]);
        }
        private DVRPPartialSolution CalculatePartialProblem(string fileName, int[] subset)
        {
            var file = File.ReadAllText(fileName);
            var problemBytes = Encoding.UTF8.GetBytes(file);

            var dvrpTaskSolver = new DVRPTaskSolver.DVRPTaskSolver(problemBytes);
            var subsetBytes = DVRPLocationsSubset.Serialize(subset);

            var solutionBytes = dvrpTaskSolver.Solve(subsetBytes, new TimeSpan());
            return DVRPPartialSolution.GetFromByteArray(solutionBytes);
        }