Try generating double elimination tournament bracket
A double-elimination tournament is a type of elimination tournament competition in which a participant ceases to be eligible to win the tournament's championship upon having lost two games or matches. It stands in contrast to a single-elimination tournament, in which only one defeat results in elimination.
One method of arranging a double-elimination tournament is to break the competitors into two sets of brackets, the Winners Bracket and Losers Bracket (W and L Brackets for short; also sometimes Upper Bracket and Lower Bracket, respectively) after the first round. The first round winners proceed into the W Bracket and the losers proceed into the L Bracket. The W Bracket is conducted in the same manner as a single-elimination tournament, except that the losers of each round "drop down" into the L Bracket. Another method of double elimination tournament management is the Draw and Process.
As with single-elimination tournaments, most often the number of competitors is equal to a power of two (8, 16, 32, etc.) so that each round there are an even number of competitors and never any byes. The maximum number of games in a double elimination tournament is one less than twice the number of teams participating (e.g., 8 teams – 15 games). The minimum number is two less than twice the number of teams (e.g., 8 teams – 14 games).
Below is a simple example of Double elimination tournament bracket generated using https:www.zenorganizer.com an online tournament management software.
Below is a little bigger example.