Consulting

Results 1 to 6 of 6

Thread: Permutation with a handicap

  1. #1
    VBAX Contributor
    Joined
    May 2008
    Posts
    109
    Location

    Permutation with a handicap

    Hi all,





    The question

    I have four items represented randomly in thirty-one rows (just a month). (see my example). I need to extract a sequence where the given items (a,b,c,d) must be sequenced the the best way possible for that case in an equal numeric distribution and with the maximum equidistance one from another.
    For example a,b,c,d,a,b,c,d,a,b,c,d, etc is good (not repeated items and equidistant items)
    Aabbcdaabbcc, is not good, (repeated and not equidistant items)
    I have a routine able to obtain a good permutation of the items but the difficulty is when, like in the example ( I have a bottleneck in some rows (4,10,25), there only two items or worse just one.. Considered this bottleneck, is it possible to find a routine to obtain the best result possible in that situation ?



    I would appreciate any kinds of assistance.



    sasa
    Last edited by sasa; 05-14-2008 at 06:58 AM.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Is it me or is the standard of questions dropping through the floor. I have a rough idea of what is being asked here, but a very rough idea at that. The question doesn't explain fully, the workbook is no extra help at all, no before and after examples, just a series of letters, and the routine referred to isn't even in the example workbook.

    Hang on, I have to fetch my crystal ball.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Contributor
    Joined
    May 2008
    Posts
    109
    Location

    I am here again

    Well, I see ?? it is difficult to explain my problem both because of my English and my question is not simple. I will try to express better, using a short and simplified example.
    We have four names Tom, Bill, Melanie, Mike and each name is in a cell of the same row. A1=Tom, B1=Bill, C1= Melanie, D1=Mike. The same names can be found in the cells below not necessarily in the same sequence (for example a2= Bill, b2= Tom, c2= Mike, d2= Melanie, in addition they cannot be present necessarily all together.( For example a3= Melanie b3=Mike c3= empty d3= empty and so on).
    Now if you look at my second example in column H you can see all the possible permutation of the four names, but in this case for example what I need are only those that end with Tom and have in the position before last Melanie or Mike.
    Practically in this case my bottleneck are the last two rows.
    Now this example is just one unity of four rows repeated along the thirty-one days of a month so I ask if is it possible to obtain a final result as a sequence of quatrains where the four names are in the better way possible four by four uniformly distribuited.

    sasa

  4. #4
    VBAX Contributor
    Joined
    May 2008
    Posts
    109
    Location
    May be my practical need can better explain what I mean. The four names are four workers and every day the are not necessarily present at work. So what I need is the possibility to obtain a sequence where considered that some days are present only one or two workers I can equally distribuite their work shift in the month. I need to alternate them in the best way possible. Infact if they are all avalable every day I can easy choice one among of the four and alternate them every day, but if I have some day only one or two avalable I am forced to select these, so in the other days I'd like to select the others to obtain a correct distribution of the work shifts.
    I think that select the quatrain where I have a limited choice of the workers, I need a routine able to find all the other quatrains that better combine with this one.
    Last edited by sasa; 05-14-2008 at 11:41 PM.

  5. #5
    VBAX Contributor
    Joined
    May 2008
    Posts
    109
    Location
    In other words I am wondering if is it possible to arrange a macro that can give any permutation of some items while leaving other items fixed in their positions.

    sasa

  6. #6
    VBAX Contributor
    Joined
    May 2008
    Posts
    109
    Location
    Snoopy was lost and abandoned on the sidewalk for many days.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •