How this calculation works
Find an ordering that minimizes the largest number of simultaneously crossing graph edges. The returned prefix cut counts explain the bottleneck, rather than measuring how far apart adjacent vertices sit in a list.
cw(G)=min_order max_prefix |{uv∈E:u in prefix,v outside}|; DP(S)=min_v∈S max(DP(S−v),cut(S)).A worked example
For the four-vertex star with center0, order1,0,2,3 has crossing counts1,2,1,0. No ordering can reduce the maximum below2: the center has three incident edges, which must be split across its position. The cutwidth is2.
Good to know
Simple undirected graph with1–12 vertices; exact subset dynamic programming and reconstructed ordering. No weights, parallel edges or directed-edge convention. At most4096 subset states. Vertex labels are zero-based.
Count crossings of cuts, not edge lengths
A linear ordering separates already placed vertices from the unplaced vertices after each position. A crossing edge has exactly one endpoint in that prefix. Its contribution is one regardless of how many positions separate its endpoints.
The largest prefix crossing count is the width of that ordering. Cutwidth chooses an ordering minimizing this maximum. It models simultaneous connections through a moving boundary, whereas graph bandwidth limits the largest individual endpoint separation.
Compare this with the Graph bandwidth calculator with optimal vertex ordering. Bandwidth minimizes endpoint index gaps,not the number of simultaneously crossing edges.
Declare the full vertex set
Enter one row per undirected edge, using consecutive labels from zero. Declared vertices with no incident edges still participate in the ordering. Reversing an edge row does not create a second legitimate edge in a simple graph.
Loops and repeated unordered pairs are rejected because they would change the interpretation of a crossing count. This calculator treats every edge equally and does not infer capacity or cost from an extra column.
A subset remembers enough for dynamic programming
The crossing count of a prefix depends only on its vertex set, not on the order within that set. For each subset, the dynamic program considers which vertex was placed last and combines the previous optimum with the new crossing count.
Taking the larger of those two quantities preserves the worst cut encountered so far. Minimizing over the final vertex establishes the exact recurrence. Remembering that final choice lets the calculator reconstruct a complete witness order, rather than returning an unexplained integer.
The star distributes its central connections
Place one leaf before the center of the displayed star and two leaves afterward. After the first leaf, one edge crosses. After the center, two edges lead toward the remaining leaves; the following cuts have one and zero crossings.
The maximum is therefore two. With three edges incident to the center, either at least two lie before it or at least two lie after it, giving a matching lower bound. The ordering is optimal even though other label orders can be equally good.
Read every prefix count in the witness
The final prefix contains all vertices and has zero crossing edges. Including that endpoint makes it easier to align the returned counts with the ordering. Each earlier number can be checked directly against the entered edge list.
Several neighboring cuts can share the maximum, and several orders can attain the optimum. The witness is one deterministic choice, not a claim of unique layout. Relabeling vertices may alter the chosen order without altering cutwidth.
An exact small answer has a finite scope
The subset table grows exponentially with the declared vertex count. Limiting the graph to twelve vertices makes complete optimization practical and avoids substituting an unverified greedy ordering for an exact optimum.
This page does not claim the scalability of specialized layout software. It also does not compare geometric line crossings in a drawing: edges drawn over one another on screen are different from edges crossing a prefix partition.
Use a bottleneck measure with the right objective
A lower cutwidth can help compare serial layouts with a limited number of active connections. To make that interpretation valid, define what an edge represents and why all connections should receive equal weight in the first place.
If your real objective is total edge length, weighted congestion, bandwidth or pathwidth, use the corresponding mathematical model. A good cutwidth order can perform poorly for a different layout objective, even when the graph itself is unchanged.
A few questions, answered
Is cutwidth the same as bandwidth?
No. Cutwidth counts edges crossing a prefix boundary; bandwidth measures endpoint position gaps.
Are isolated vertices included?
Yes. Declare them in the vertex count even if they have no edge rows.
Is the returned ordering optimal?
Yes, within the stated small simple-graph scope, the subset recurrence is exhaustive.
Does the last count have to be zero?
Yes. The full vertex set has no edges leading outside itself.