Topic
2 replies Latest Post - ‏2012-12-27T20:46:26Z by SystemAdmin
SystemAdmin
SystemAdmin
386 Posts
ACCEPTED ANSWER

Pinned topic CP: Quadratic Assignment Problem with floating-point numbers

‏2012-12-23T19:42:32Z |
Hello,

I am new to CPLEX. I want to find a solution for the quadratic assignment problem. I have read that I have to use constraint programming and I have checked the example called "quadassign".

My Problem is that my starting values are not integers. Therefore I have changed the variable type to float as presented below:

//

using CP;

int nbPerm = ...;
range r = 1..nbPerm;
float dist[r][r] = ...;
float flow[r][r] =...;

execute {
cp.param.timeLimit=30;
}
dvar int permhttp://1..nbPerm in r;

dexpr float costi in rj in r = dist[i][j]*flow[permi][permj];

minimize sum(i in r, j in r) cost[i][j];
subject to {

allDifferent(perm);

};

//

When I execute the solver I get the error message: "IloAlgorithm cannot extract extractable."
So i'll be very happy and thankful if anyone can help me with my problem.

Tommy
Updated on 2012-12-27T20:46:26Z at 2012-12-27T20:46:26Z by SystemAdmin
  • rdumeur
    rdumeur
    12 Posts
    ACCEPTED ANSWER

    Re: CP: Quadratic Assignment Problem with floating-point numbers

    ‏2012-12-24T14:46:39Z  in response to SystemAdmin
    Dear Tommy24,

    What version of IBM ILOG CPLEX Studio are you using?
    I tried your example with dummy data :
    
    using CP;   
    
    int nbPerm = 2; range r = 1..nbPerm; 
    
    float dist[r][r] = [ [2, 3], [4, 5] ]; 
    
    float flow[r][r] = [ [6,7], [8,9 ] ];   execute 
    { cp.param.timeLimit=30; 
    } dvar 
    
    int perm[1..nbPerm] in r;   dexpr 
    
    float cost[i in r][j in r] = dist[i][j]*flow[perm[i]][perm[j]];   minimize sum(i in r, j in r) cost[i][j]; subject to 
    {   allDifferent(perm);   
    };
    


    and it executes without problem using version 12.5

    
    ! ---------------------------------------------------------------------------- ! Minimization problem - 2 variables, 1 constraint ! TimeLimit            = 30 ! Initial process time : 0,00s (0,00s extraction + 0,00s propagation) !  . Log search space  : 2,0 (before), 2,0 (after) !  . Memory usage      : 333,8 kB (before), 333,8 kB (after) ! Using parallel search with 2 workers. ! ---------------------------------------------------------------------------- !          Best Branches  Non-fixed    W       Branch decision *           100        1 0,04s         1            - ! ---------------------------------------------------------------------------- ! Search terminated normally, 1 solution found. ! Best objective         : 100 (optimal - effective tol. is 0,01) ! Number of branches     : 43 ! Number of fails        : 54 ! Total memory usage     : 1,3 MB (1,1 MB CP Optimizer + 0,2 MB Concert) ! Time spent in solve    : 0,12s (0,12s engine + 0,00s extraction) ! Search speed (br. / s) : 344,0 ! ----------------------------------------------------------------------------
    


    Cheers,
    • SystemAdmin
      SystemAdmin
      386 Posts
      ACCEPTED ANSWER

      Re: CP: Quadratic Assignment Problem with floating-point numbers

      ‏2012-12-27T20:46:26Z  in response to rdumeur
      Dear rdumeur,

      Thank you very much for your reply. I have used version 12.3 with wich it is not working.
      So I've tried it with version 12.5 and it runs without an error.

      Tommy