You have the
Miller-Tucker-Zemlin constraints in your code, commented out. There is one indexing error related to them in the code. You have to enforce the constraints for all arcs i->j
except where i or j is the depot. (Check the indexing of the constraint in the Wikipedia entry.)
Also, you provide no context for the parameter n. In the MTZ constraints, n is typically the number of nodes (including the depot), but in your data file you have seven nodes but n = 5. This is not automatically a problem, since you have three vehicles, but it does indirectly constrain the model to use all three vehicles, even if it would be more efficient to use only two. That may be intentional on your part; I'm just pointing it out.
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
------------------------------
Original Message:
Sent: Sat September 25, 2021 09:37 PM
From: Kien Hua Ting
Subject: Subtour Elimination Constraints for Vehicle Routing Problem
Hi. I am a newbie in this CPLEX software. Recently i am working on the vehicle routing problem. I do encounter a problem which is regarding the code for subtour elimination constraints. The version of CPLEX that I am using currently is version 20.1.0.0. Can I have some suggestion from the expert here in providing a guidance and references for me. Hope to receive replies from expert in related field of study. Thank you. Here is the mod and dat file for the vehicle routing problem .
------------------------------
Kien Hua Ting
------------------------------
#DecisionOptimization