Decision Optimization

Decision Optimization

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

 View Only

Reducing Iterations in Set Construction

  • 1.  Reducing Iterations in Set Construction

    Posted Tue August 04, 2009 12:50 AM

    Originally posted by: SystemAdmin


    [UDOPS said:]

    Any suggestions on how to make this set construction more efficient, or is this as good as it gets? For example, I iterate over "Jobs" repeatedly.

    {graphindex} Graph=
    /* Moves at source, backlog nodes*/
    {{ <j.KEYrec, 0, -1, 0, 1, 1>,
    <j.KEYrec, 0, -1, Machine&#91;<j.KEYrec,11>], 1, 1>,
    <j.KEYrec, 0, -1, Machine&#91;<j.KEYrec,1>], 1, 1>}  | j in Jobs}
    union {{ <j.KEYrec, 0, 0, 0, t-1, t>,
    <j.KEYrec, 0, 0, Machine&#91;<j.KEYrec,11>], t-1, t>,
    <j.KEYrec, 0, 0, Machine&#91;<j.KEYrec,1>], t-1, t>} | j in Jobs, t in {2..Horizon}}
    /* Moves at interior queues and machines, remember queue is i+10*/
    union {{ <j.KEYrec, i, Machine&#91;<j.KEYrec,i+10>], Machine[<j.KEYrec,i+10>], t-1, t>,
    <j.KEYrec, i, Machine&#91;<j.KEYrec,i+10>], Machine[<j.KEYrec,i>], t-1, t>}
    | j in Jobs, i in {1..j.OperationCount-1}, t in {2..Horizon}}
    union {{ <j.KEYrec, i, Machine&#91;<j.KEYrec,i>], Machine[<j.KEYrec,i+1>], t-OperTime[<j,i>], t>,
    <j.KEYrec, i, Machine&#91;<j.KEYrec,i>], Machine[<j.KEYrec,i+11>], t-OperTime[<j,i>], t>}
    | j in Jobs, i in {1..j.OperationCount-1}, t in {OperTime[<j,i>]+1..Horizon}}
    /* Moves at final queue, machine, and sink node */
    union {{ <j.KEYrec, j.OperationCount, Machine&#91;<j.KEYrec,j.OperationCount+10>], Machine[<j.KEYrec,j.OperationCount+10>], t-1, t>,
    <j.KEYrec, j.OperationCount, Machine&#91;<j.KEYrec,j.OperationCount+10>], Machine[<j.KEYrec,j.OperationCount>], t-1, t>}
    | j in Jobs, t in {2..Horizon}}
    union { <j.KEYrec, j.OperationCount, Machine&#91;<j.KEYrec,j.OperationCount>], 999, t-OperTime[<j,i>], t>
    | j in Jobs, t in {OperTime[<j,j.OperationCount>]+1..Horizon}};
    #DecisionOptimization
    #OPLusingCPLEXOptimizer