Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Assigning queues to numbers

    Posted 12/29/18 05:10 AM

    Originally posted by: leonhbr


    Hey everybody,

    I am starting to use CPLEX  during my studies and I need to know how to assign queues of intigers to a specific set of numbers. For instance, I have the given sets A={1,2,3,4} and B={5,6,7}. Now I want to assign them to given Intervals I= {1,2,3,4} and J={5,6,7,8}. In this case, there are 4 possible sollutions, give be the real world context:

    1. {1,2,3,4} is assigned to {1,2,3,4} and {5,6,7} is assigned to {5,6,7}
    2. {1,2,3,4} is assigned to {1,2,3,4} and {5,6,7} is assigned to {6,7,8}
    3. {1,2,3,4} is assigned to {5,6,7,8} and {5,6,7} is assigned to {1,2,3}
    4. {1,2,3,4} is assigned to {5,6,7,8} and {5,6,7} is assigned to {2,3,4}

    So in other words, I am not allowed to split up the queues and each queue should be in one intervals. It is also important, that the order of the queues and the intervals can not be changed. For example, it should not be allowed, that {1,2,3,4} is assigned to {4,3,2,1} and vice versa.

    When I try to implement this constraint, the solution gets wrong. You can find the constraint and the data set attatched. I think, that the problem is generated by constraint_3 but I don't know how to solve it.

    Does anybody have an idea how to solve this?

    Kind regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Assigning queues to numbers

    Posted 01/04/19 01:54 PM

    I don't understand your model since it has no comments at all.

    How about this approach: For each queue q, each set S and each position p in set S define a decision variable x[q][S][p] that is 1 if q is assigned to S and the assignment starts in p and 0 otherwise. Then add constraints that forbid all the impossible combinations:

    - assigned queues cannot overlap,

    - if a queue is assigned to position p then there must be enough room in S for the whole q after p.

    - ...

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Assigning queues to numbers

    Posted 01/06/19 09:28 AM

    Originally posted by: leonhbr


    Hey,

    I added some comments in the program so that I hope you can understand it better. The problem is, that i cannot use the decision variable like you said, because this constrain is just part of a big modell. I just need help for the ordering. Probably you get a better understanding of my problem, when i illustrate it with an more practical example.

    For instance you want to park 7 cars on 2 lanes. The way the cars have to be parked is give. For instance, the cars 1,2,3,4 have to be parked  one after the other and the cars 5,6,7 have to be parked one after other. You are not allowed to swape the order of the cars, but it is not fixed which car queue has to stand on which lane. When you suppose that each car has the same lenght, than you can split each lane into 4 slots, so that you can number all the slots from 1 to 8. The target ist to assign each car to one slot, so that the queue restrictions from aboth are still considered.

    My question is, how I creat a constraint that ensures all possibilities to park these car queues without leaving to much possibilities open. Probablly I just have an syntax error in my code.

    I hope I made my problem more understandable and I am looking forward to an answer.

    Kind regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Assigning queues to numbers

    Posted 01/14/19 06:35 AM

    Ok, now I am not clear what your actual problem is. When you say "probably I just have a syntax error in my code", does that mean your model does not compile? Or does it mean some constraints (which?) don't work as you expect them to?

    It is still unclear to me what exactly you are missing.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Assigning queues to numbers

    Posted 01/17/19 09:47 AM

    Originally posted by: leonhbr


    Hey,

    i meant that some constraints does not work the way they should work, but I already fixed it.

    Thanks for your answers!

    Kind regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer