Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  CP Optimizer: cannot solve the simple problem

    Posted Thu October 07, 2021 10:13 AM
    Edited by System Admin Fri January 20, 2023 04:09 PM
    Hi everyone, 

    My colleagues work on the big project and they have created the model that cplex cannot solve. I simplified the model to show you:

    example.mod

    using CP;

    // standard duration of melting
    int duration = ...;

    tuple backetType {
        int id;
        string name;
    }

    // backet contains meltings
    {backetType} Backets = ...;

    tuple meltingType {
        int id;
        int backet;
    }
    // meltings
    {meltingType} Meltings = ...;

    // 1 backet = 8 meltings
    dvar interval BacketInterval[b in Backets] optional size duration * 8;
    dvar interval MeltingInterval[m in Meltings] optional size duration;

    subject to {
        forall (b in Backets) {
            span(BacketInterval[b], all(m in Meltings : m.backet == b.id) MeltingInterval[m]);
        }
    }

    example.dat

    duration = 60;

    Backets = {
        <1, "A1">
    };

    Meltings = {
        <11, 1>
    };


    I have tried to run the model via oplrun.exe - the solve process doesn't start (it freezes on the problem generation stage). 

    Of course, the model shouldn't have the solution. The reason in the definition of BucketInterval - it should have the size 8*60, but when we use span constraint it will be impossible (only one MeltingInterval exists with the size 60). So I think that cplex should return that there is no solution. Why cplex didn't it?



  • 2.  RE: CP Optimizer: cannot solve the simple problem
    Best Answer

    Posted Thu October 07, 2021 11:30 AM
    Hi,

    if you turn

    dvar interval BacketInterval[b in Backets] optional size duration * 8;
    dvar interval MeltingInterval[m in Meltings] optional size duration;​


    into

    dvar interval BacketInterval[b in Backets] optional 
    in 0..1000  
    size duration * 8 ;
    dvar interval MeltingInterval[m in Meltings] optional 
    in 0..1000 
    size duration ;



    you ll get a solution very quickly

    regards



    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------



  • 3.  RE: CP Optimizer: cannot solve the simple problem

    Posted Thu October 07, 2021 12:02 PM
    Hi Alex,

    Thank you for your advice. So when we can estimate possible values of variables we should limit bounds in the variable definition?


  • 4.  RE: CP Optimizer: cannot solve the simple problem

    Posted Fri October 08, 2021 04:13 AM
    Yes indeed

    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------