How this calculation works
The crossing number minimizes edge crossings over plane drawings of a graph. Edges may curve, so it is different from a straight-line or rectilinear crossing count for fixed vertex positions. The submitted graph has no coordinates because the task optimizes its topological drawing.
Use a correct exact planarity/embedding engine. For each crossing count k from0 to3 choose independent original-edge crossing pairs, disallow self-crossings/adjacent crossings and repeated pair crossing in a good drawing. Enumerate order of crossing points on each original edge, subdivide accordingly, and impose alternating halfedge rotation at each crossing vertex. Exhaustively test orientable rotation systems with these constraints; Euler face test componentwise distinguishes sphere genus0. Return edge crossing list, edgewise order and rotation embedding. Failure throughk=3 proves only lowerbound4, not an exact crossing count. State cap gives weaker bounds.A worked example
With the prefilled inputs, crossingNumber = 1.
Good to know
Topological good drawings;independent edge pairs cross at most once. Alternating half-edge rotation at every inserted crossing is enforced.
Reference: Primary method reference or author-maintained documentation (opens in a new tab) ↗
Count topological crossings, not drawing intersections
The crossing number minimizes edge crossings over plane drawings of a graph. Edges may curve, so it is different from a straight-line or rectilinear crossing count for fixed vertex positions. The submitted graph has no coordinates because the task optimizes its topological drawing.
For a minimum good drawing, unnecessary self-crossings and crossings of adjacent edges can be removed. The search can therefore restrict attention to independent edge pairs and carefully controlled crossing patterns. These reductions need the stated drawing convention rather than an unexamined assumption about any plotted picture.
Compare with the Minimum rectilinear graph crossings calculator on supplied planar sites. Minimize crossings over arbitrary good topological drawings; fixedsite straightedges impose a stronger geometryconstraint.
A crossing becomes a constrained degree-four vertex
Use the prefilled input structure and preserve the declared column or index order. Replace every proposed crossing by a new vertex where the two original edges are subdivided. That operation creates a planarization candidate, but ordinary planarity of the subdivided graph is not enough. The two halves of each original edge must alternate around the crossing vertex.
Without the alternating order, a planar embedding could merely let the routes turn around each other. Such an embedding would not represent a true crossing of the original edges. The certificate must preserve both the original-edge identity and the rotation of halfedges at every artificial vertex.
Search crossing pairs and their order along edges
At a fixed candidate crossing count, choose the involved independent edge pairs. When an edge crosses several others, enumerate the order in which its crossing points occur from one endpoint to the other. Different orders can yield different planarization feasibility.
For each candidate, test a planar rotation system subject to the alternating-crossing constraints. A valid sphere embedding plus the original-edge reconstruction supplies an upper-bound drawing. Exact minimum follows only after every smaller crossing count has been excluded by complete search or a separate valid lower bound.
Use the bipartite complete graph as a nonplanar example
The complete bipartite graph with three vertices in each part has nine edges and admits a drawing with one crossing. It is nonplanar, so zero crossings are impossible. Combining that obstruction with a valid one-crossing certificate gives crossing number one.
The example should include the actual crossed edge pair, edgewise crossing order and planarized rotation system generated by the engine. A familiar theorem about this graph is an independent expected result, but it does not excuse returning an incomplete or unreplayable drawing witness.
Make the certificate explain the counted crossing
A static SVG should distinguish a true crossing from a graph vertex. Original vertices need visible disks and labels; a crossing should retain separate edge identities rather than appearing as an ordinary connected junction. Its surrounding alternating edge order should match the stored certificate.
List each crossing as a pair of original edge labels. Also show the order of crossings along any edge that meets more than one. This table lets readers verify that a drawn intersection was counted exactly once and that the visualization represents the claimed combinatorial model.
A search through three crossings may yield only a bound
If every candidate through three crossings is exhausted without a feasible drawing, the valid conclusion is that the crossing number is at least four. The proposed search has not computed the exact answer beyond its supported crossing budget, even if a generic result field expects a number.
A work cap raises an unresolved error rather than returning the interval that might be inferred from unfinished internal search. When the requested crossing budget is completely exhausted, the returned result instead states a lower bound one larger than that budget and a generic independent-edge-pair upper bound. That upper bound is not accompanied by a constructed drawing.
Planarity checks must certify their own conventions
The zero-crossing case reduces to ordinary planarity and should agree with an independently tested embedding routine. For planarization cases, verify the Euler characteristic and face traversal of the rotation system, and enforce the special cyclic order at every crossing vertex.
Use planar graphs, both Kuratowski graphs and carefully designed multiple-crossing examples as regression cases. A general graph-drawing library that happens to produce attractive coordinates does not itself certify the global minimum or the required alternating rotations. The public prefill is K3,3 with a requested maximum of one crossing. Its certificate uses original edge indices, inserted crossing vertices and cyclic rotation rows, with six planarized faces. The one-crossing result is exact only because the zero-crossing search also completed. A requested bound of zero would instead return a lower-bound result, not the number one as a constructed drawing. Topological good drawings;independent edge pairs cross at most once. Alternating half-edge rotation at every inserted crossing is enforced.
A few questions, answered
Can I give vertex coordinates to get this crossing number?
Coordinates define a particular drawing or a fixed-site problem. This page concerns the minimum over topological drawings of the abstract graph.
Why is a planar subdivision not enough as a certificate?
A crossing vertex requires alternating halfedges from its two original edges. An unconstrained planar embedding may connect those halfedges in a different cyclic order.
What does a lower bound of four mean?
It means the search excluded drawings with zero through three crossings. It does not establish that four crossings suffice.
Is an attractive drawing proof of optimality?
No. It proves at most an upper bound after its crossings are verified. A matching lower-bound argument is also needed.