Click here to Skip to main content
15,917,652 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionSheet Metal Cutting Algorithm Pin
kirankkk200927-May-10 21:16
kirankkk200927-May-10 21:16 
AnswerRe: Sheet Metal Cutting Algorithm Pin
T M Gray28-May-10 11:53
T M Gray28-May-10 11:53 
GeneralRe: Sheet Metal Cutting Algorithm Pin
kirankkk200930-May-10 21:57
kirankkk200930-May-10 21:57 
AnswerRe: Sheet Metal Cutting Algorithm Pin
Moreno Airoldi28-May-10 22:29
Moreno Airoldi28-May-10 22:29 
GeneralRe: Sheet Metal Cutting Algorithm Pin
kirankkk200930-May-10 22:10
kirankkk200930-May-10 22:10 
QuestionDistributing n elements in g groups several times uniformly [modified] Pin
Alex Casals27-May-10 12:19
professionalAlex Casals27-May-10 12:19 
AnswerRe: Distributing n elements in g groups several times uniformly Pin
Peter_in_278027-May-10 12:41
professionalPeter_in_278027-May-10 12:41 
AnswerRe: Distributing n elements in g groups several times uniformly Pin
Moreno Airoldi28-May-10 23:17
Moreno Airoldi28-May-10 23:17 
I know there's a few tournament organization algorithms, but I'm not much into that, so I can't suggest you any.

You are using a stochastic algorithm, which can surely be ok. You just need to add some logic to de-randomize matchings in order to get the result you need.

A simple approach can be holding the number of times each pilot flies against each other in a list (array).
Select a random pairing, then randomly select one of the two paired pilots (or just iterate through pilots and choose the second pilot randomly, this depends on how you currently do pairing ofc).

Look into the selected pilot's list, starting at the index corresponding to the second pilot, then proceed in one direction until you get to the same position, holding the index of the cell with the least value you find.
When you're done, change the second pilot to the one whose corresponding cell held the least value.

This is the basic rough idea, it must of course be adapted to your current algorithm and data structures.
It should ensure a certain degree of randomness and come close to the result you need.

Good luck. Smile | :)
2+2=5 for very large amounts of 2
(always loved that one hehe!)

GeneralRe: Distributing n elements in g groups several times uniformly Pin
Alex Casals29-May-10 3:53
professionalAlex Casals29-May-10 3:53 
GeneralRe: Distributing n elements in g groups several times uniformly Pin
Moreno Airoldi29-May-10 20:59
Moreno Airoldi29-May-10 20:59 
GeneralTell Me A Joke Pin
Bassam Abdul-Baki27-May-10 0:27
professionalBassam Abdul-Baki27-May-10 0:27 
GeneralRe: Tell Me A Joke Pin
CPallini27-May-10 10:09
mveCPallini27-May-10 10:09 
GeneralRe: Tell Me A Joke Pin
Bassam Abdul-Baki28-May-10 4:31
professionalBassam Abdul-Baki28-May-10 4:31 
QuestionHow to tokenize a text to determine sentence frequency Pin
nagarsoft26-May-10 23:58
nagarsoft26-May-10 23:58 
AnswerRe: How to tokenize a text to determine sentence frequency Pin
Alan Balkany27-May-10 4:58
Alan Balkany27-May-10 4:58 
AnswerRe: algorithm to get each individual digit from a decimal number (integer) Pin
Richard MacCutchan17-May-10 10:42
mveRichard MacCutchan17-May-10 10:42 
AnswerRe: algorithm to get each individual digit from a decimal number (integer) Pin
Dr.Walt Fair, PE17-May-10 10:45
professionalDr.Walt Fair, PE17-May-10 10:45 
GeneralRe: algorithm to get each individual digit from a decimal number (integer) Pin
ant-damage17-May-10 10:54
ant-damage17-May-10 10:54 
GeneralRe: algorithm to get each individual digit from a decimal number (integer) Pin
Dr.Walt Fair, PE17-May-10 11:01
professionalDr.Walt Fair, PE17-May-10 11:01 
GeneralRe: algorithm to get each individual digit from a decimal number (integer) Pin
Anshul R9-Jun-10 4:12
Anshul R9-Jun-10 4:12 
AnswerRe: algorithm to get each individual digit from a decimal number (integer) Pin
Luc Pattyn17-May-10 11:25
sitebuilderLuc Pattyn17-May-10 11:25 
GeneralRe: algorithm to get each individual digit from a decimal number (integer) Pin
ant-damage17-May-10 12:07
ant-damage17-May-10 12:07 
GeneralRe: algorithm to get each individual digit from a decimal number (integer) Pin
molesworth17-May-10 22:21
molesworth17-May-10 22:21 
GeneralRe: algorithm to get each individual digit from a decimal number (integer) Pin
ant-damage18-May-10 9:50
ant-damage18-May-10 9:50 
GeneralRe: algorithm to get each individual digit from a decimal number (integer) Pin
ant-damage18-May-10 11:05
ant-damage18-May-10 11:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.