Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Element constraint

    Posted 06/28/12 05:17 PM

    Originally posted by: mslusky


    I’m trying to solve a problem that, similar to traveling salesman, involves n cities and an nxn matrix of travel times, and we want a constraint that the time of the i-th visit happens at least that amount before the (i-1)-th visit.

    I want:
    
    _model.add( _visitTimes[v][i] >= _visitTimes[v][i-1] + _travelTimes[ _visits[v][i-1] ][ _visits[v][i] ];
    


    but I don't know how to implement this with concert.

    _travelTimes is an IloArray<IloIntArray>, _visitTimes is an IloArray<IloIntVarArray>, and _visits is an IloArray<IloIntVarArray>.

    _visits represents the locations of the visit.
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Element constraint

    Posted 07/04/12 09:50 AM

    Originally posted by: SystemAdmin


    The way to go is to flatten the travel time matrix and use an IloTableConstraint. For this, you need to create an IloIntTupleSet that has 3 columns : the first one is the depature city index, the second one is the arrival city index and the third one is the travel time. For instance the matrix

    31 47 88
    77 81 94
    12 34 44

    is flattened to the tuple set:

    0 0 31
    0 1 47
    0 2 88
    1 0 77
    1 1 81
    ...

    Then you introduce a new variable T[i][v] for the travel time of each visit and post a table constraint over _visitTimes[v]i-1 _visitTimes[v][i] and T[v][i]. It will formulate the desired relation between the 3 variables. Table constraints achieve arc-consistency and thus ensure optimal domain reduction.

    Regards,

    Philippe
    #CPOptimizer
    #DecisionOptimization