{
  "id": "seven-bridges-of-konigsberg",
  "title": "Seven Bridges of Königsberg",
  "lang": "en",
  "source_lang": "en",
  "summary": "The Seven Bridges of Königsberg is a historical route-finding problem whose impossibility, proved by Leonhard Euler, helped establish graph theory.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "Königsberg bridge problem",
    "Seven bridges problem"
  ],
  "generated_at": "2026-11-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/seven-bridges-of-konigsberg/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/seven-bridges-of-konigsberg/",
      "json": "https://aiwiki.page/zh/seven-bridges-of-konigsberg.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "The Seven Bridges of Königsberg is a mathematical problem asking whether a walk through the city of Königsberg could cross each of its seven bridges exactly once. In 1736, Leonhard Euler established that no such walk was possible, even if the walker could finish somewhere other than the starting point. His solution replaced the geographical details with a structure of connections, making the problem a foundational example of graph theory."
    },
    {
      "heading": "Historical setting",
      "text": "Königsberg, a Prussian city now known as Kaliningrad, developed around branches of the Pregel River, now called the Pregolya. The historical arrangement involved four land regions: the northern and southern banks and two islands, Kneiphof and Lomse. Seven bridges connected these regions.\n\nThe question was whether someone could traverse all seven bridges without crossing any bridge twice. Movement within a land region was unrestricted, but movement between regions had to use the bridges. Swimming, taking a boat, or otherwise crossing the river outside the bridges was excluded.\n\nEuler treated the problem in his Latin paper Solutio problematis ad geometriam situs pertinentis, meaning “Solution of a problem relating to the geometry of position.” The work is conventionally dated to 1736; it appeared in print in 1741 in a volume of the St Petersburg Academy’s proceedings bearing the earlier year.\n\nThe phrase geometria situs referred to a study of spatial relationships distinct from measurement-based geometry. Euler’s argument is also associated with the historical development of topology, although the problem belongs most directly to graph theory in modern terminology."
    },
    {
      "heading": "Representation as a graph",
      "text": "The decisive simplification is to ignore distances, bridge lengths, street layouts, and the precise shapes of the islands. Only which land regions each bridge connects matters.\n\nRepresent each land region by a vertex and each bridge by an edge joining the corresponding vertices. Because some pairs of regions were connected by more than one bridge, the resulting structure is a multigraph: a graph that permits multiple edges between the same pair of vertices.\n\nLet:\n\n- \\(K\\) represent Kneiphof;\n- \\(L\\) represent Lomse;\n- \\(N\\) represent the northern bank;\n- \\(S\\) represent the southern bank.\n\nThe seven edges are:\n\n\\[KN,\\ KN,\\ KS,\\ KS,\\ KL,\\ LN,\\ LS.\\]\n\nRepeated pairs represent distinct bridges, not repeated use of one bridge.\n\nThe degree of a vertex is the number of edge ends incident with it. The degrees in the Königsberg graph are therefore:\n\nLand region | Vertex | Degree\nKneiphof | \\(K\\) | 5\nLomse | \\(L\\) | 3\nNorthern bank | \\(N\\) | 3\nSouthern bank | \\(S\\) | 3\n\nAll four vertices have odd degree.\n\nIn modern language, the requested walk would be an Eulerian trail: a walk that uses every edge exactly once. Vertices may be visited repeatedly. If the walk also finishes at its starting vertex, it is an Eulerian circuit."
    },
    {
      "heading": "Why the walk is impossible",
      "text": "The central observation concerns entering and leaving a land region.\n\nWhenever a walker arrives at an intermediate region by one bridge, another unused bridge must be used to leave it. The bridges used at that region consequently occur in arrival–departure pairs.\n\nThis gives two possibilities:\n\n- The walk starts and ends at the same vertex. Every arrival is paired with a departure, so every vertex must have even degree.\n- The walk starts and ends at different vertices. The starting vertex has one unpaired departure, and the ending vertex has one unpaired arrival. These two vertices have odd degree; every other vertex has even degree.\n\nThus a walk using every edge exactly once can have either zero or two odd-degree vertices, but not four.\n\nThe Königsberg graph has degrees\n\n\\[5,\\ 3,\\ 3,\\ 3,\\]\n\nso it has four odd-degree vertices. The required walk is therefore impossible, regardless of the starting point.\n\nThis proof avoids checking every possible ordering of the seven bridges. Its conclusion depends only on the pattern of connections, not on any particular route choice."
    },
    {
      "heading": "The general Eulerian criterion",
      "text": "For a finite undirected graph with at least one edge, an Eulerian trail exists exactly when:\n\n- all vertices incident with an edge belong to one connected component; and\n- the number of odd-degree vertices is either zero or two.\n\nIf there are zero odd-degree vertices, an Eulerian circuit exists. If there are exactly two, an Eulerian trail exists and must begin at one odd-degree vertex and end at the other.\n\nThe connectivity condition is essential. Two separate circuits can have only even-degree vertices, yet no single walk can cover both without an additional connection.\n\nThe arrival–departure argument establishes the necessity of the degree condition. Sufficiency can be shown constructively. In a connected graph with all degrees even, follow unused edges until a closed trail is formed. If unused edges remain, connectivity ensures that some vertex of the existing trail is incident with unused edges. Form another closed trail there and insert it into the first. Repeating this process eventually uses every edge.\n\nIf exactly two vertices have odd degree, temporarily add an edge joining them. All degrees then become even. Construct an Eulerian circuit and remove the added edge; the remaining sequence is an Eulerian trail between the two odd-degree vertices.\n\nThis construction underlies efficient algorithms for finding Eulerian trails."
    },
    {
      "heading": "Changes to the bridge arrangement",
      "text": "The graph formulation makes it possible to analyze modified versions of the problem without reconstructing the whole route by trial and error.\n\nRemoving one bridge\n\nRemoving an edge decreases the degree of each endpoint by one. In the original graph, both endpoints have odd degree, so both become even. The other two vertices remain odd.\n\nRemoving any single bridge from this particular graph also leaves it connected. Consequently, the six remaining bridges admit an Eulerian trail, though not an Eulerian circuit.\n\nAdding one bridge\n\nAdding a bridge between two distinct land regions changes the parity of both endpoint degrees. Because all four original degrees are odd, the two affected vertices become even and the other two remain odd.\n\nThe resulting eight-bridge graph therefore admits an Eulerian trail. It still does not admit an Eulerian circuit.\n\nAllowing one bridge to be crossed twice\n\nIf the requirement is relaxed so that one bridge may be used twice, an eight-crossing walk is possible, provided the start and finish may differ.\n\nMathematically, the repeated crossing is represented by duplicating one edge. This changes two odd degrees to even degrees, leaving exactly two odd-degree vertices. An Eulerian trail in the augmented graph describes the desired walk through the physical bridges.\n\nA closed walk would require additional repeated crossings, since every degree would need to be even."
    },
    {
      "heading": "Mathematical significance and applications",
      "text": "The problem’s importance lies in its abstraction: a geographical puzzle becomes a question about vertices, edges, connectivity, and parity. The same reasoning applies to networks whose physical appearance is entirely different.\n\nIts generalizations include the route inspection problem, also called the Chinese postman problem. That problem asks for a shortest closed walk traversing every edge of a network at least once. When an Eulerian circuit does not already exist, some edges must be repeated; the optimization task is to choose those repetitions at minimum cost. This has applications in road inspection, street sweeping, and other services that must cover network links.\n\nEdge-covering problems differ from the traveling salesman problem, which concerns visiting specified locations while minimizing total travel cost. The Königsberg problem requires every bridge to be crossed exactly once, not every land region to be visited exactly once. Repeated visits to a region are allowed and often necessary.\n\nThe historical conclusion applies to the original seven-bridge arrangement. Later changes to the city’s bridges produce different graphs and therefore require a fresh analysis of connectivity and vertex degrees."
    }
  ],
  "links": [
    "leonhard-euler",
    "graph-theory",
    "geometry",
    "topology",
    "vertex-degree",
    "mathematical-proof",
    "algorithm",
    "traveling-salesman-problem"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}