I have wrote the .mod file for the Single Allocation Hub Location Problem, following the mathematical program given in this paper:

Skorin-Kapov D, Skorin-Kapov J, O'Kelly M (1996) Tight linear programming relaxations of uncapacitated p-hub median problems. European Journal of Operational Research 94 (1996) 582-593

Somehow I can not obtain the results provided by the authors. I am doing something wrong, but I can not find out what I am doing wrong.

// nodes
int n = ...;
range N = 0..n-1;

// direct-line transport cost
float directTransportCost[N][N] = ...;

// discount coefficient
float alpha = ...;

// demand
float w[N][N] = ...;

// transport cost
float c[i in N][j in N][k in N][m in N] = 
  directTransportCost[i][k] + alpha * directTransportCost[k][m] + directTransportCost[m][j];

// decision variables
dvar boolean z[N][N];
dvar float+ x[N][N][N][N];

// cost minimization objective
    (sum(i in N, j in N, k in N, m in N) w[i][j] * c[i][j][k][m] * x[i][j][k][m]);

subject to  {   
    // number of hubs
        // ctNumberOfHubs:
        sum(k in N) z[k][k] == 4; // Inconsistency is observed not only for 4 hubs, but for every given number of hubs

    // single allocation
    forall(i in N)
            sum(k in N) z[i][k] == 1;

    // allocation to hub
    forall(i in N, k in N)
            z[i][k] <= z[k][k];

    // allocation of flow from origin
    forall(i in N, j in N, k in N)
            sum(m in N) x[i][j][k][m] == z[i][k];

    // allocation of flow to destination
    forall(i in N, j in N, m in N)
            sum(k in N) x[i][j][k][m] == z[j][m];    

asked 23 Feb '18, 19:46

DDCh's gravatar image

accept rate: 0%

Wherein lies the inconsistency? Is it the solution's objective function value? Or is it the solution itself? If you only have access to the objective function values and there's an inconsistency there, it could be as simple as setting the optimality tolerance to 0 in the CPLEX parameters.

(26 Feb '18, 05:27) Sune

@Sune The inconsistency is in the objective value and usually in the solution itself.

(26 Feb '18, 05:30) DDCh

Have you tried setting the optimality tolerance to zero?

(26 Feb '18, 06:00) Sune

I set the optimality tolerance to zero, but unfortunately it did not help. If you like, I can provide one corresponding .dat file.

(26 Feb '18, 07:04) DDCh

@Sune If I am using the CPLEX Studio, then the obtained solutions are correct, only the objective value is little bit less (which can be explained by setting tolerance, or that rounding errors were smaller). On the other hand, when I call through Python API subprocess.check_call([oplrun, modname, datname]) I do not get the optimal solutions.

(27 Feb '18, 09:19) DDCh

I do not know the python api (at all). But if you want to oplrun a mod +dat and include some settings other than the standard, you should run it as "oplrun hub.mod hub.dat hub.ops". If you do not provide the same settings when calling through the python api, it's not fair to expect the same result.

(27 Feb '18, 13:03) Sune
showing 5 of 6 show 1 more comments
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 23 Feb '18, 19:46

Seen: 1,728 times

Last updated: 27 Feb '18, 13:03

OR-Exchange! Your site for questions, answers, and announcements about operations research.