Originally posted by: CMohr
I am new to CPLEX and am trying to become familiar with how it works and running into some road blocks.
I'm trying to build and run a relatively simple Vehicle Routing Problem, using the similar TSP example project as a reference. My model in a nutshell is as follows:
Ive defined:
A range of Nodes (Cities) from 1 to n
tuple { i, j } to represent the edges (arcs from node i to j)
float c[ i, j ] to be referenced in a data file as an array of distances
Binary decision variable x[ i, j ] = 1 if arc i to j is utilized, else 0
My objective function is simply to minimize the sum of all c[ i, j ] * x[ i, j ] according to standard VRP constraints
When I run the model there are 3 errors:
1) Description Resource Path Location Type
Tuple not found in "Edges": <1, 1>. CVRP Unknown OPL Problem Marker
2) Description Resource Path Location Type
Scripting runtime error: (in generate) Processing OPL model "ModelConstraints" failed.. ModelConstraints.mod /CVRP 108:0 C:\Users\cmohr1\opl\CVRP\ModelConstraints.mod OPL Problem Marker
3) Description Resource Path Location Type
Execution of "main" failed: "C:\Users\cmohr1\opl\CVRP\ModelConstraints.mod", line 108: generate: Processing OPL model "ModelConstraints" failed.. ModelConstraints.mod /CVRP 97:1-5 C:\Users\cmohr1\opl\CVRP\ModelConstraints.mod OPL Problem Marker
For the first error, I am confused because there are 10 nodes and the model is symmetric so it expects 45 tuples (representing distances), which I have in the data file, and which would not include [1,1], [2,2], and so on.
I have no idea what errors 2 ad 3 mean, nor how to remedy them.
Attached is the code for my .mod file and data file. I also have another data file simply containing:
subtours = {};
I wrote the variables, model, and constraints. I simply copied the execute and main script portions from the example TSP project and changed certain values to fit with my model because before doing that when I ran the model I got 54 error messages, most of them being "Cannot extract expression for..." and "tuple not found...".
I am quite lost when trying to code this model and any help would be appreciated.
#DecisionOptimization#OPLusingCPLEXOptimizer