{
  "id": 18574836,
  "title": "Seeding a single-elimination bracket: byes, top seeds and a 3rd-place match",
  "url": "https://urgent.news/2026/11/06/seeding-a-single-elimination-bracket-byes-top-seeds-and-a-3rd-place",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-06T21:49:00.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/meetandplay/seeding-a-single-elimination-bracket-byes-top-seeds-and-a-3rd-place-match-1o67"
  },
  "original_language": "en",
  "account": "In the world of single-elimination tournaments, there are three key questions to consider when structuring a bracket: how to handle byes, avoid top seeds meeting in the first round, and incorporate a third-place match without disrupting the layout. This article delves into how these elements are implemented in a TypeScript codebase.\n\nThe first step in creating a seeded bracket is rounding up to the nearest power of two. Brackets must have sizes of 2, 4, 8, 16... Anything else is rounded up, and the empty slots become byes. For instance, with six entrants, a bracket of 8 is created, leaving two byes. The function nextPowerOfTwo calculates the next power of two, and byeCount determines the number of byes required.\n\nThe second step focuses on seeding order. The standard recursive method places seed 1 opposite seed 16, followed by 8 v 9, 5 v 12, 4 v 13, and so on. This sequence can be generated by repeatedly interleaving each seed with its complement. The resulting order ensures that the top seeds cannot face each other until the final, the top four cannot meet before the semi-finals, and the top eight cannot confront each other until the quarter-finals, and so forth. This arrangement is an automatic outcome of the construction, eliminating the need for a separate check.\n\nThe third step addresses byes in the context of top seeds. As slots are filled by matching each seed with its corresponding entry in the entry list, any seed without an entrant becomes a bye. In the case of six entrants in an 8-slot bracket, the missing slots become byes for seeds 7 and 8. Due to the order pairing the highest seed numbers with missing slots, the byes inevitably face the top seeds. This process is automated, with no need for special-case code, and the conventional outcome of receiving a bye for high seeding is achieved naturally.\n\nLastly, the knockoutBracket function generates all rounds simultaneously. Round 1 pairs adjacent slots, and subsequent rounds pair the winner_of references from the previous round's fixtures. This approach allows for the efficient construction of the entire tournament bracket in a single step.",
  "summary": "Single-elimination brackets look simple until you ask three questions: where do the byes go, how do you stop the top seeds from meeting in round one, and how do you add a third-place match without breaking the layout. This post walks through how we build a seeded bracket in TypeScript. The code is from the tournament module of a framework-free domain package; snippets are trimmed from the real…",
  "key_points": [
    "Byes are added by rounding up bracket size to nearest power of two",
    "Top seeds avoid first-round matchups through seeded order",
    "Third-place match automatically occurs without extra coding"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}