メインコンテンツへスキップ

Solving the CVRP variant problem

ユーザーの入力を待っています。

コメント

3件のコメント

  • Mario Ruthmair
    • Gurobi Staff Gurobi Staff

    Hi Anja,

    Your Benders approach is quite complex to debug. What exactly happened? Does it give you wrong solutions or does it take too long to solve? An instance with 5 nodes should be rather easy to solve, independent of the input data and the VRP variant. If it takes too long, could you post a log of your solve?

    Best regards,
    Mario

    0
  • Anja Conda
    • Gurobi-versary
    • First Comment
    • First Question

    Yes, he got the wrong solution. Taking the example of the 5 points mentioned above, the solution obtained by the current model is 1.42. But when I calculated the obtained sequence, it should be 1.09.

    the log is as follows:

    Set parameter Threads to value 1
    Set parameter MIPGap to value 0
    Set parameter LazyConstraints to value 1
    Set parameter TimeLimit to value 3600
    Gurobi Optimizer version 10.0.0 build v10.0.0rc2 (win64)

    CPU model: Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz, instruction set [SSE2|AVX|AVX2]
    Thread count: 4 physical cores, 8 logical processors, using up to 1 threads

    Optimize a model with 60 rows, 37 columns and 188 nonzeros
    Model fingerprint: 0x3b140fac
    Variable types: 7 continuous, 30 integer (30 binary)
    Coefficient statistics:
      Matrix range     [2e-01, 1e+00]
      Objective range  [3e-01, 1e+00]
      Bounds range     [1e+00, 2e+01]
      RHS range        [4e-01, 1e+00]
    Presolve removed 7 rows and 0 columns
    Presolve time: 0.00s
    Presolved: 53 rows, 37 columns, 219 nonzeros
    Variable types: 7 continuous, 30 integer (30 binary)

    Root relaxation: objective -9.514286e-02, 20 iterations, 0.00 seconds (0.00 work units)

        Nodes    |    Current Node    |     Objective Bounds      |     Work
     Expl Unexpl |  Obj  Depth IntInf | Incumbent    BestBd   Gap | It/Node Time

         0     0   -0.09514    0    9          -   -0.09514      -     -    0s
    H    0     0                       2.3000000   -0.09514   104%     -    0s
    H    0     0                       2.2900000   -0.09514   104%     -    0s
    H    0     0                       1.6700000   -0.09514   106%     -    0s
         0     0    0.46410    0   14    1.67000    0.46410  72.2%     -    0s
         0     0    0.52996    0   12    1.67000    0.52996  68.3%     -    0s
         0     0    0.55260    0   12    1.67000    0.55260  66.9%     -    0s
         0     0    0.55260    0   12    1.67000    0.55260  66.9%     -    0s
         0     0    0.63448    0   16    1.67000    0.63448  62.0%     -    0s
    H    0     0                       1.6400000    0.63448  61.3%     -    0s
    H    0     0                       1.4200000    0.63448  55.3%     -    0s
         0     0    0.65632    0   15    1.42000    0.65632  53.8%     -    0s
         0     0    0.66232    0   17    1.42000    0.66232  53.4%     -    0s
         0     0    0.70098    0   16    1.42000    0.70098  50.6%     -    0s
         0     0    0.70248    0   16    1.42000    0.70248  50.5%     -    0s
         0     0    0.70248    0   16    1.42000    0.70248  50.5%     -    0s
         0     0    0.71012    0   20    1.42000    0.71012  50.0%     -    0s
         0     0    0.71480    0   20    1.42000    0.71480  49.7%     -    0s
         0     0    0.71569    0   20    1.42000    0.71569  49.6%     -    0s
         0     0    0.71569    0   20    1.42000    0.71569  49.6%     -    0s
         0     0    0.72210    0   18    1.42000    0.72210  49.1%     -    0s
         0     0    0.72333    0   18    1.42000    0.72333  49.1%     -    0s
         0     0    0.75916    0   20    1.42000    0.75916  46.5%     -    0s
         0     0    0.76583    0   19    1.42000    0.76583  46.1%     -    0s
         0     0    0.76583    0   19    1.42000    0.76583  46.1%     -    0s
         0     0    0.76670    0   19    1.42000    0.76670  46.0%     -    0s
         0     0    0.76700    0   21    1.42000    0.76700  46.0%     -    0s
         0     0    0.76835    0   21    1.42000    0.76835  45.9%     -    0s
         0     0    0.76839    0   22    1.42000    0.76839  45.9%     -    0s
         0     0    0.77138    0   21    1.42000    0.77138  45.7%     -    0s
         0     0    0.77175    0   21    1.42000    0.77175  45.7%     -    0s
         0     0    0.77206    0   21    1.42000    0.77206  45.6%     -    0s
         0     0    0.77225    0   22    1.42000    0.77225  45.6%     -    0s
         0     0    0.77225    0   22    1.42000    0.77225  45.6%     -    0s
         0     2    0.77451    0   22    1.42000    0.77451  45.5%     -    0s

    Cutting planes:
      Learned: 1
      Gomory: 2
      Cover: 1
      MIR: 9
      StrongCG: 1
      GUB cover: 1
      Relax-and-lift: 4
      Lazy constraints: 3

    Explored 38 nodes (443 simplex iterations) in 0.44 seconds (0.02 work units)
    Thread count was 1 (of 8 available processors)

    Solution count 5: 1.42 1.64 1.67 ... 2.3

    Optimal solution found (tolerance 0.00e+00)
    Best objective 1.420000000000e+00, best bound 1.420000000000e+00, gap 0.0000%

    User-callback calls 554, time in user-callback 0.37 sec
    regret:1.4199999999999962
    sol:[(1, 0), (0, 2), (0, 3), (4, 0), (3, 1), (2, 5), (5, 4)]
    ******************************
    xe:{(0, 1): 0, (0, 2): 1, (0, 3): 1, (0, 4): 0, (0, 5): 0, (1, 0): 1, (1, 2): 0, (1, 3): 0, (1, 4): 0, (1, 5): 0, (2, 0): 0, (2, 1): 0, (2, 3): 0, (2, 4): 0, (2, 5): 1, (3, 0): 0, (3, 1): 1, (3, 2): 0, (3, 4): 0, (3, 5): 0, (4, 0): 1, (4, 1): 0, (4, 2): 0, (4, 3): 0, (4, 5): 0, (5, 0): 0, (5, 1): 0, (5, 2): 0, (5, 3): 0, (5, 4): 1}
    original y_sol:{(0, 1): 0, (1, 0): 0, (0, 2): 0, (2, 0): 0, (0, 3): 0, (3, 0): 1, (0, 4): 1, (4, 0): 1, (0, 5): 1, (5, 0): 0, (1, 2): 1, (2, 1): 0, (1, 3): 0, (3, 1): 0, (1, 4): 0, (4, 1): 0, (1, 5): 0, (5, 1): 1, (2, 3): 1, (3, 2): 0, (2, 4): 0, (4, 2): 0, (2, 5): 0, (5, 2): 0, (3, 4): 0, (4, 3): 0, (3, 5): 0, (5, 3): 0, (4, 5): 0, (5, 4): 0}
    regret:1.0900000000000007
    y_sol:{(1, 2), (3, 0), (0, 5), (2, 3), (0, 4), (5, 1), (4, 0)}
    y_val:3.05
    cost_x:4.140000000000001

    0
  • Mario Ruthmair
    • Gurobi Staff Gurobi Staff

    So, what you are saying is that the solution from the solver is valid (x and y variables), but the corresponding objective value is computed incorrectly?

    In this example, you added 3 lazy constraints that seem to affect the objective function. Could you print them when you add them in the callback?

    It also helps debug model issues when you write out the initial model (without lazy constraints) to an LP file immediately before calling optimize() and take a closer look at it. You can do this with model.write("model.lp").

    0

サインインしてコメントを残してください。