Advanced maths

Orientable graph genus calculator from rotation systems

Minimize orientable cellular embedding genus over complete bounded rotation-system enumeration, returning face walks and Euler data.

Your numbers

Zero-based labels 0 through n−1; all declared vertices remain included.
One row: u v. No loops or duplicate unordered pairs.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Minimize orientable cellular embedding genus over complete bounded rotation-system enumeration, returning face walks and Euler data.

THE FORMULAφ=ρ∘α on directed darts; g=(2−|V|+|E|−cycles(φ))/2.

A worked example

The default K3,3 graph has orientable genus one. An optimum rotation system has three faces, so 6−9+3=0=2−2g.

Good to know

Connected simple undirected graphs on 1–8 vertices with at most 18 edges. Exhaust all cyclic neighbor orders, capped at 200,000 completed systems; a cap error means no minimum certified, even if a planar witness was encountered. Orientable cellular embeddings only; n=1 has one empty face.

Count handles for an orientable embedding

The orientable genus of a connected graph is the fewest handles required on a closed orientable surface that admits a crossing-free embedding. Genus zero corresponds to a sphere and hence to ordinary planar embeddability. Genus one corresponds to a torus, where opposite directions around a handle can accommodate additional connections.

The calculator represents cellular embeddings, whose face regions are disks, by cyclic orders of neighbors around each vertex. These orders describe a combinatorial surface rather than coordinates for a drawing. Two-dimensional line crossings in a sketch are therefore not the quantity being minimized; the topology encoded by the rotation system is.

K3,3 needs an orientable handle012345V = 6, E = 9Optimum F = 3V − E + F = 0g = (2 − 0)/2 = 1
Scroll across to see the full diagram.
This schematic shows adjacency, not a surface embedding; the rotation and face certificate establishes genus one.

Compare this with the Graph planarity calculator with embedding certificate. Minimize genus over orientable cellular embeddings rather than answer only whether a planar embedding exists.

Enter a small connected simple graph

Supply up to eight vertices and eighteen undirected edges with zero-based labels. The graph must be connected. Loops, duplicate unordered edges and weights are rejected. A one-vertex graph with no edges is a special accepted case, assigned genus zero and one empty face for the sphere convention.

The degree pattern matters strongly for resource usage because a vertex of degree d has (d−1)! possible cyclic neighbor orders. Several high-degree vertices can make even a small graph expensive. The input-size limits and completed-system cap both apply, and neither is a claim that every accepted-size graph finishes successfully.

Check the complete bipartite example

The default graph joins each of vertices zero, one and two to each of vertices three, four and five. This is the complete bipartite graph K3,3 with six vertices and nine edges. The minimum-genus rotation system returned by the search has three face boundary walks.

Euler’s equation then gives six minus nine plus three equal to zero, which equals two minus twice genus one. Planarity would require genus zero instead. The example illustrates a genuinely nonplanar optimum rather than merely discovering a planar rotation and stopping at a zero lower bound.

Enumerate cyclic orders completely

At each vertex the first listed neighbor is fixed and the remaining neighbors are permuted. Fixing that first position removes cyclic duplicates without removing distinct rotations. The Cartesian product of these local orders enumerates every rotation system needed to represent orientable cellular embeddings of the connected graph.

The implementation evaluates every completed system and retains the smallest genus. It deliberately does not stop after finding a good embedding or after reaching genus zero. A final minimum is returned only after the full bounded enumeration completes. Thus an interrupted search cannot silently turn its best-so-far surface into a certified optimum.

Trace faces with directed darts

Each undirected edge has two directed versions called darts. To follow a face, reverse the current dart at its endpoint and then take the next neighbor in that endpoint’s cyclic order. Repeating this permutation returns to the starting dart, giving one complete face boundary walk.

Every dart belongs to exactly one such orbit, so all face walks together must contain twice the number of edges in total boundary steps. A bridge can appear twice in a boundary walk, and a vertex can repeat within one face. Those repetitions are valid surface-combinatorial behavior rather than duplicate input edges.

Audit the Euler certificate

The returned rotations list the cyclic neighbors at each original vertex. The face walks and their count determine the Euler characteristic V−E+F. For a connected orientable cellular embedding, two minus that characteristic must be a nonnegative even integer, and half of it is the genus.

Checking one rotation system establishes a feasible embedding at its genus. Establishing minimum genus additionally requires completion of the whole search. The systems counter reports evaluated systems, not face count or drawing crossings. Keep these roles separate when reviewing a result, particularly for a graph with many possible local cyclic orders.

Respect cap and surface conventions

The search rejects completion beyond two hundred thousand evaluated rotation systems with an explicit resource error. It returns no optimum after such a failure, even when a lower-genus witness was found earlier. Reduce the graph and rerun if a complete exact certificate is needed within this deliberately bounded tool.

Nonorientable surfaces, disconnected-component genus conventions and geometric vertex placement are outside this calculator. A torus embedding is not supplied as a rendered torus drawing; the returned cyclic orders and face walks are its certificate. For planar-only questions a dedicated planarity calculator may finish more efficiently and provide a more directly familiar representation.

A few questions, answered

Does genus one mean one drawing crossing?

No. It means an orientable surface with one handle admits an embedding.

Can a face walk repeat vertices?

Yes. Boundary walks can repeat vertices or traverse a bridge twice.

Is a cap failure a proof of nonplanarity?

No. It means enumeration was incomplete and no minimum is certified.

Are nonorientable surfaces included?

No. Only orientable cellular embeddings are represented by this search.

Find your calculator

Start typing to explore the library.