rec.games.trading-cards.jyhad

[LSJ] Optimal seating order

6 messages from 4 participants · 03 April 2006 – 05 April 2006
original thread on Google Groups

JH

I have created a php-script to create random "optimal" seating orders. Inspiration for this were the numerous cases in local tournaments where a player would either join the tournament after a round or dropped before the preliminary rounds were over. In those cases TheArchon often fails to give a suitable seating order. Comments would be appreciated. If someone wants to test the form send me an e-mail or ask through the list and I'll give you a password for the trial. First I create a totally random tables from the list of available players. Then I count a "similarity value" using predefined formulas. If similarity is 1 or more table is rejected. Here are the optimal seating order criteria and their weighs: 1. No pair of players repeat their predator-prey relationship. This is mandatory, by the VEKN rules. - Table rejected -> reroll 2. No pair of players share a table through all three rounds, when possible. - If more than 10 players table rejected -> reroll - If 10 players or less add 0.01 per pair 3. Available VPs are equitably distributed. - If a player would have more vp available than average+1 or less than average-1 table rejected -> reroll 4. No pair of players share a table more often than necessary. - For each pair add Players^2 / 40000 (0.04 if 40 players, 0.01 if 20 players, 0.0025 if 10 players etc..) 5. A player doesn't sit in the fifth seat more than once. - Table rejected -> reroll 6. No pair of players repeat the same relative position[*], when possible. - add 0.01 for each pair 7. A player doesn't play in the same seat position, if possible. - add 0.01 if repeat 8. Starting transfers are equitably distributed. [NOAL] - If a player would have more starting transfers on average than average +1 or less than average-1 table rejected -> reroll 9. No pair of players repeat the same relative position group[^], when possible. - add 0.001 for each pair

ira...@gmail.com

JH wrote: > I have created a php-script to create random "optimal" seating orders. > Inspiration for this were the numerous cases in local tournaments where > a player would either join the tournament after a round or dropped > before the preliminary rounds were over. In those cases TheArchon often > fails to give a suitable seating order. This is a great idea, and I'm excited that someone else has already worked on it so much! > Comments would be appreciated. If someone wants to test the form send me > an e-mail or ask through the list and I'll give you a password for the > trial. I'd love to test it, and would happily look at source code, too. I'm familiar with PHP, and have been working on the same problem for a while, though I've been thinking about 2-round tournaments specifically. For anyone new to the discussion, here is a thread on optimal seating: http://tinyurl.com/r63au > Here are the optimal seating order criteria and their weighs: All of your criteria are exactly right. Your weights may be wrong. >From a private e-mail discussion I had with LSJ in Dec 2002, he made it clear that a higher numbered rule is less important than a lower numbered rule. For clarity, I'll just post that e-mail below, since I think it's quite relevant to the discussion of using a computer program to generate optimal seating charts. > 3. Available VPs are equitably distributed. > - If a player would have more vp available than average+1 or less than > average-1 table rejected -> reroll This may be slightly too simplistic. See LSJ's explanation in the e-mail reposted below. Ira (in a private e-mail to me) >From vte...@white-wolf.com Wed Dec 18 13:13:25 2002 Subject: Re: optimal tournament seating At 06:00 AM 12/18/2002, you wrote: >Hey LSJ, > > I have a few more questions about the seating rules; I can probably write >a program to do "optimal" seatings, but it may be hard. Did you do all of >the seating by hand? Yes. > Also, for all of these questions, assume I'm talking about 2 round >tournaments. If the answer is different for 3 rd tournaments, feel free >to elaborate if you have the time. > > > 2. No pair of players share a table through all three rounds, when > > possible. > > So this rule can be completely ignored for 2 round tournaments, correct? It would be "No players share a table in both rounds" > > 3. Available VPs are equitably distributed. > > I'm not sure what this means. Does it mean that you must have only 4 and >5 player tables? Are 3 or 6 player tables illegal? 4 and 5 are the only options. What it means is that you can't have player A play at a 4-player table in both rounds (8 available VPs) while player B plays at a 5-player table in both rounds (10 avialable VPs). The maximum difference in available VPs should be 1. > > 4. No pair of players share a table more often than necessary. > > 5. A player doesn't sit in the fifth seat more than once. > > 6. No pair of players repeat the same relative position[*], when possible. > > 7. A player doesn't play in the same seat position, if possible. > > 8. Starting transfers are equitably distributed. [NOAL] > > 9. No pair of players repeat the same relative position group[^], when > > possible. > > What is the relative importance of these rules? For instance, what if >one seating arrangement caused a player to sit in the same seat, and >another causes a pair of players to repeat the same relative position, and >everything else is equal. Which would be the more optimal seating? The rules are listed in order. A higher numbered rule is less important than a lower numbered rule. > I would like to write a computer program to figure all this out, and >ideally I'd like to give it numbers like: > >repeat predator prey = +1000000 >a pair of players sharing the same table = +10 >a player sitting in the 5th seat more than once = +10 >a pair of players repeating the same relative pos = +10 >a player sitting in the same seat = +10 >for each player, sum their transfers over all rounds. the target number >is # of rounds times 2.5 transfers. For each player, for each transfer >away from that number = +2 >a pair of players repeat the same relative position group = +5 > > Obviously I'm choosing weights that will make a significant difference in >the definition of "optimal." Once the weights are set, I run through >every possible configuration, and the lowest total is the optimal one. > > Perhaps this whole endeavor is dumb, and if so, feel free to tell me >that. :) It's not dumb - it's difficult. I've started down that path a few times myself. Weight the highest numbered rule with a 1. Figure out the number of "violations" of that rule that can occur. Call that number X1. Let the next rule be weighted at X1+1. Figure out the maximum number of violations for that rule. Let the next rule be weighted (X2+1)*(X1+1). And so on. > also, if player A and B are next to each other in round 1, and then >sitting at different tables in round 2, then that satisfies all of the >conditions, right? So long as they're sitting in different numbered seats in each round (player A isn't playing first in both rounds, for instance), and their starting transfers are close (A sits at 1 and 2 while B sits at 3 and 4 would be improper by rule #8). > Ideally, each round would be played against 4 new >opponents, right? Yes, but not possible until you get to 25 players. (Or 16, where you see 3 new players each round). -- LSJ (vte...@white-wolf.com) V:TES Net.Rep for White Wolf, Inc. Links to V:TES news, rules, cards, utilities, and tournament calendar: http://www.white-wolf.com/vtes/

LSJ

JH wrote: > I have created a php-script to create random "optimal" seating orders. > Inspiration for this were the numerous cases in local tournaments where > a player would either join the tournament after a round or dropped > before the preliminary rounds were over. In those cases TheArchon often > fails to give a suitable seating order. Change "often" to "effectively always" -- the optimal seating charts in the Archon should never be used "as-is" after a drop or add -- they should always be inspected for validity. > Comments would be appreciated. If someone wants to test the form send me > an e-mail or ask through the list and I'll give you a password for the > trial. > > First I create a totally random tables from the list of available > players. Then I count a "similarity value" using predefined formulas. If > similarity is 1 or more table is rejected. Which means that you're actually looking for a "good" seating order, and stopping at the first one you find that is "good". But it's unlikely that the first good one you find will be anywhere close to optimal. That said, though, finding a "good" seating to handle drops and adds as they happen (on the fly) is much better than trying to do it by hand, in most cases. So clearly finding a good seating is a noble endeavor. > 3. Available VPs are equitably distributed. > - If a player would have more vp available than average+1 or less than > average-1 table rejected -> reroll Should change this to "If a player has more VP available than minimum+1 table rejected -> reroll" (This criterion should always be able to be achieved, except possibly in very very small tournaments). The rest of the weights look like magic numbers (not derived from any "fundamental truths"). Should be OK for a tool -- but you may want to give the option of changing those weights to the user, too, if they are just magic numbers. Thanks for the efforts.

JH

LSJ wrote: > JH wrote: >>First I create a totally random tables from the list of available >>players. Then I count a "similarity value" using predefined formulas. If >>similarity is 1 or more table is rejected. > > Which means that you're actually looking for a "good" seating order, > and stopping at the first one you find that is "good". > > But it's unlikely that the first good one you find will be anywhere > close to optimal. > > That said, though, finding a "good" seating to handle drops and adds as > they happen (on the fly) is much better than trying to do it by hand, > in most cases. So clearly finding a good seating is a noble endeavor. The script is also given a parameter which tells it how long to look for an optimal seating at minimum, a maximum of 10 seaconds. If no "good" seatings are found within that time period it takes the first "good" seating order it finds within the next 10 seconds. If a "good" seating is found during the initial period the script runs the predetermined time, trying to find a "better" seating order. If a seating order with lower (=better) value is found it is taken instead of the original. The script also tells you how many points it gave the table it prints out (1 is very bad, 0 is perfect). Sometimes it takes more than 20 seconds given to find a seating order with acceptable parameters, and that's when you have to run it again. I'd love to make a Java version of it so that you could download it and run from your own computer. The server-side version must have some restrictions in it to avoid near infinite loops. >>3. Available VPs are equitably distributed. >>- If a player would have more vp available than average+1 or less than >>average-1 table rejected -> reroll > > Should change this to "If a player has more VP available than minimum+1 > table rejected -> reroll" (This criterion should always be able to be > achieved, except possibly in very very small tournaments). I changed that. It's pretty hard to do well with a swift script without putting too much time in it. I could propably spend a week optimising just this part of the code, as it also has to take into account all the players who have played fewer tables. > The rest of the weights look like magic numbers (not derived from any > "fundamental truths"). Should be OK for a tool -- but you may want to > give the option of changing those weights to the user, too, if they are > just magic numbers. The "magic numbers" are just that, "magic numbers". In a future version I might give the user options to adjust them. I'd also like to know if you have an opinion about the "magic numbers". > Thanks for the efforts. Thanks for the appreciation.

Shade

JH wrote: > Sometimes it takes more than 20 seconds given to find a seating order > with acceptable parameters, and that's when you have to run it again. > I'd love to make a Java version of it so that you could download it and > run from your own computer. The server-side version must have some > restrictions in it to avoid near infinite loops. I thought about a Java version when I was playing around with this. In the end I decided Excel would be a better generic platform, you should be able to get most of the PHP stuff into VBA... although VBA is pretty horrible compared to PHP. I had the same issue with my Excel version and infinite loops, did a similar thing to you to stop it by the sound of it. Might be an elegant way to get around it but it's probably easier to just kill it after X seconds / iterations, especially since there is no customer paying to do it properly ;-)

LSJ

JH wrote: > LSJ wrote: > > That said, though, finding a "good" seating to handle drops and adds as > > they happen (on the fly) is much better than trying to do it by hand, > > in most cases. So clearly finding a good seating is a noble endeavor. > > The script is also given a parameter which tells it how long to look for > an optimal seating at minimum, a maximum of 10 seaconds. If no "good" > seatings are found within that time period it takes the first "good" > seating order it finds within the next 10 seconds. If a "good" seating > is found during the initial period the script runs the predetermined > time, trying to find a "better" seating order. If a seating order with > lower (=better) value is found it is taken instead of the original. The > script also tells you how many points it gave the table it prints out (1 > is very bad, 0 is perfect). Ah. Neat-O. > The "magic numbers" are just that, "magic numbers". In a future version > I might give the user options to adjust them. I'd also like to know if > you have an opinion about the "magic numbers". They look suitable from here. But I haven't subjected them to any careful analysis. :-)