The objective is to to create a draw that is fair to all the participants. To create a tennis draw, you first have to figure out how many players/teams to seed. Seeding means ranking the players, starting with the best. Count up how many players there are and divide by 4. If there is a remainder, add one to the quotient, and that gives you the number of seeds. For instance, if there were 25 players, you would get 25/4 = 6 and a remainder of 1, so 7 seeds.
Although it doesn’t usually happen, you will make up a draw that is a power of 2. So you will assume there are 4,8,16,32, or 64 players in the draw. The number you will work with as a base is the next higher power of 2 above the number of players. (5-8 would use 8, 9-16 would use 16, 17-32 would use 32, 33-64 would use 64 as the base. Once you have the base, you subtract the number of players from the base, and that gives you the number of byes. (25 would have 7 byes, 11 would have 5, etc)
Number the players from 1 to the total number. I use an old deck of cards with ace through ten as is, and then 11 on renumbered. This basically gives you a random number generator. You don’t have to assign numbers to match the seeds. Take out the cards for the seeded players. The number one seed goes at the top, and the number 2 seed goes at the bottom. You next want to place the 3rd and 4th seeds. Take out the cards for both from the deck. Shuffle them and put the top card at posiiton base/2 and the bottom card at the base/2 + 1 position (if base is 32, put top card at 16 and second at 17. So the #1 seed will play either the 3rd or 4th in the semifinal based on the random draw).
The next thing to do is to distribute the remaining seeds. If you have 4 or more seeds, you now have 4 quadrants. Shuffle the remaining cards, and put them one at a time into the quadrants, starting at the quadrant with the #4 seed, then the #3, #2, #1. Keep going until all the seeds have been assigned a position. Spread them around so seeds don’t meet in early rounds. This only happens if you have more than 5 seeds.
Once the seeds have been distributed, the next thing to do is to distribute the byes. Give a bye to each of the seeded players, starting at #1. After you have gone through all the seeds, if there are still more byes, distribute them to the various quadrants starting at the 1st, then the 2nd, 3rd, and 4th. Just make sure that a bye doesn’t play a bye.
Now all you have left is the unseeded players. Shuffle the cards, and put them in the draw in each succeeding open space. After you get through, it’s ok to rearrange a bit if you see some obvious mismatches.
I’m sure there are programs out there that create draws, so if someone wants to find one, go for it and you can throw away the old deck of cards.