Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Minimization problem

    Posted Tue August 02, 2011 10:01 AM

    Originally posted by: jef_ti


    Hi all,

    i was testing a minimization method and had this strange behavior, why solver tried to minimize a value when the 0 was already achieved?


    // Tardiness of applied activities
    dexpr int totalAtraso = sum(e in TodasAtividades) ((sizeOf(dvEscalonamentoAtividadesRota[e]) - e.transitTime) * presenceOf(dvEscalonamentoAtividadesRota[e]));

    minimize totalAtraso;


    Engine log:

    !
    ! Minimization problem - 142 variables, 535 constraints
    ! Preprocessing : 88 extractables eliminated
    ! TimeLimit = 30
    ! Initial process time : 0,00s (0,00s extraction + 0,00s propagation)
    ! . Log search space : 1.331,3 (before), 1.330,7 (after)
    ! . Memory usage : 0,9 Mb (before), 1,3 Mb (after)
    !
    ! Branches Non-fixed Branch decision Best
    * 55 0,03s - 0
    1.000 75 on _itv71 F 0
    2.000 75 on _itv108 0
    3.000 183 on _itv131 0
    4.000 1 on _itv69 0
    5.000 1 on _itv127 F 0
    6.000 1 on _itv129 0
    7.000 1 on _itv68 F 0
    8.000 1 on _itv97 F 0
    9.000 1 on _itv65 0
    10.000 1 on _itv119 F 0
    11.000 1 on _itv68 0
    12.000 1 on _itv130 0
    13.000 1 on _itv138 F 0
    14.000 1 on _itv97 0
    15.000 1 on _itv85 F 0
    16.000 1 on _itv85 0
    17.000 1 on _itv117 0
    18.000 1 on _itv132 0
    19.000 1 on _itv66 F 0
    ! Time = 6,65s, Average fail depth = 22, Memory usage = 3,4 Mb
    ! Branches Non-fixed Branch decision Best
    20.000 1 on _itv71 0
    21.000 1 on _itv42 0
    22.000 1 on _itv138 F 0
    23.000 1 on _itv119 F 0
    24.000 1 on _itv116 0
    25.000 1 on _itv34 0
    26.000 1 on _itv88 0
    27.000 1 on _itv121 F 0
    28.000 1 on _itv138 0
    29.000 1 on _itv134 0
    30.000 1 on _itv42 0
    31.000 1 on _itv30 F 0
    32.000 1 on _itv127 0
    33.000 1 on _itv128 F 0
    34.000 1 on _itv102 0
    35.000 1 on _itv63 F 0
    36.000 1 on _itv139 0
    37.000 1 on _itv42 0
    38.000 1 on _itv86 0
    39.000 1 on _itv26 F 0
    ! Time = 15,09s, Average fail depth = 21, Memory usage = 5,6 Mb
    ! Branches Non-fixed Branch decision Best
    40.000 1 on _itv127 0
    41.000 1 on _itv64 F 0
    42.000 1 on _itv90 0
    43.000 1 on _itv30 0
    44.000 1 on _itv44 0
    45.000 1 on _itv117 0
    46.000 1 on _itv38 F 0
    47.000 1 on _itv119 F 0
    48.000 1 on _itv130 0
    49.000 1 on _itv122 0
    50.000 1 on _itv62 F 0
    51.000 1 on _itv115 F 0
    52.000 1 on _itv85 0
    53.000 1 on _itv135 F 0
    54.000 1 on _itv134 0
    55.000 1 on _itv102 0
    56.000 1 on _itv127 0
    57.000 1 on _itv85 0
    58.000 1 on _itv133 F 0
    59.000 1 on _itv135 0
    ! Time = 21,92s, Average fail depth = 21, Memory usage = 7,4 Mb
    ! Branches Non-fixed Branch decision Best
    60.000 1 on _itv86 0
    61.000 1 on _itv53 0
    62.000 1 on _itv46 0
    63.000 1 on _itv50 0
    64.000 1 on _itv115 0
    65.000 1 on _itv64 0
    66.000 1 on _itv129 0
    67.000 1 on _itv51 0
    68.000 1 on _itv102 0
    69.000 1 on _itv120 F 0
    70.000 1 on _itv63 F 0
    71.000 1 on _itv131 0
    72.000 1 on _itv99 0
    73.000 1 on _itv113 F 0
    74.000 91 on _itv67 0
    75.000 1 on _itv24 F 0
    76.000 1 on _itv88 0
    77.000 1 on _itv60 F 0
    78.000 1 on _itv68 F 0
    79.000 1 on _itv115 0
    ! Time = 29,31s, Average fail depth = 21, Memory usage = 9,0 Mb
    ! Branches Non-fixed Branch decision Best
    80.000 1 on _itv66 0
    81.000 1 on _itv38 F 0
    ! Search terminated, replaying best solution found
    !
    ! Solution status : Terminated by limit, solution found
    ! Number of branches : 81.337
    ! Number of fails : 36.312
    ! Total memory usage : 10,1 Mb (9,2 Mb CP Optimizer + 0,9 Mb Concert)
    ! Time spent in solve : 30,01s (30,01s engine + 0,00s extraction)
    ! Search speed (br. / s) : 2.709,9
    !

    Thanks in advance,

    Jefferson Soares Biernastki
    Coordenação de Sistemas Operacionais
    Gerência de Tecnologia
    ALL - América Latina Logística
    Fone: (41) 2141-8613
    Fax: (41) 2141-7408

    Visit our website: www.all-logistica.com
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Minimization problem

    Posted Tue August 02, 2011 10:22 AM

    Originally posted by: SystemAdmin


    Hello,
    It could be because this part of the expression can be negative: sizeOf(dvEscalonamentoAtividadesRota[e]) - e.transitTime. This will happen, among other things if the interval variable is absent as, in this case, the value of sizeOf(dvEscalonamentoAtividadesRota[e]) will be 0. You could tell this expression to be always non-negative by saying that the value of sizeOf(dvEscalonamentoAtividadesRota[e]) when the interval is absent is e.transitTime. And in that case, you do not even need to multiply by presenceOf(dvEscalonamentoAtividadesRota[e]). That is :

    
    dexpr 
    
    int totalAtraso = sum(e in TodasAtividades) ((sizeOf(dvEscalonamentoAtividadesRota[e], e.transitTime) - e.transitTime);
    


    Philippe
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Minimization problem

    Posted Tue August 02, 2011 10:35 AM

    Originally posted by: jef_ti


    Wonderful tip, it worked perfectly.

    Thanks.

    !
    ! Minimization problem - 142 variables, 535 constraints
    ! Preprocessing : 88 extractables eliminated
    ! OptimalityTolerance = 0
    ! Initial process time : 0,00s (0,00s extraction + 0,00s propagation)
    ! . Log search space : 1.331,3 (before), 1.330,7 (after)
    ! . Memory usage : 0,9 Mb (before), 1,3 Mb (after)
    !
    ! Branches Non-fixed Branch decision Best
    * 55 0,02s - 0
    ! Search terminated, replaying optimal solution
    !
    ! Solution status : Terminated normally, optimal found (tol. = 0)
    ! Number of branches : 56
    ! Number of fails : 4
    ! Total memory usage : 2,5 Mb (1,6 Mb CP Optimizer + 1,0 Mb Concert)
    ! Time spent in solve : 0,02s (0,02s engine + 0,00s extraction)
    ! Search speed (br. / s) : 3.589,7
    !
    Jefferson Soares Biernastki
    Coordenação de Sistemas Operacionais
    Gerência de Tecnologia
    ALL - América Latina Logística
    Fone: (41) 2141-8613
    Fax: (41) 2141-7408

    Visit our website: www.all-logistica.com
    #CPOptimizer
    #DecisionOptimization