I need to develope site with feature create tournament bracket (single and double elimination like this http://challonge.com/tournament/bracket_generator).
I try to solve this problem, but cant figure out how correctly do it. I'm confused. I'm sure I need to use tree for create tournament, fill it with matches, and store all of it at db . But my own ideas are very bad.
I think there are some academical algorithms which solve this problem. Could somebody give me materials (books, literature) about this question.