Wednesday, 14 August 2013

double elimination bracket algorithm

double elimination bracket algorithm

I'm trying to figure out how to best handle a double elimination bracket.
When I did my single elimination I did it like so
double rounds = Math.Round(Math.Log(totalfighters, 2));
double bye = Math.Pow(2, rounds) - totalfighters;
I basically had to figure out how many rounds and how many byes are
needed, and then coded up how I would distribute the matches. On my match
model I have the following:
Match { int fighter1 int fighter2 int winner }
I've been racking my brains as to how I can use the code above (if
possible) to generate a double elimination bracket. My main issue with the
double eimination is generating the Loser's bracket properly. Been trying
to use the following format:
http://www.printyourbrackets.com/7teamdoubleelimination.html
But I'm stuck on generating the loser's bracket.
Any thoughts? Or should I just compeltely ignore my algorithm for the
single elimnation?

No comments:

Post a Comment