Advanced maths

Graph boxicity calculator with an interval intersection representation

Find a minimum-dimensional axis-parallel box intersection representation of a small graph, with coordinate interval witnesses.

Your numbers

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

Find a minimum-dimensional axis-parallel box intersection representation of a small graph, with coordinate interval witnesses.

THE FORMULAbox(G)=min d such that E(G)=intersection of d interval-supergraph edge sets; a pair is adjacent exactly when its boxes intersect in every coordinate.

A worked example

The four-cycle has boxicity2. Top,bottom,left and right rectangular strips realize its four cycle edges; opposite strips are separated in one coordinate.

Good to know

Simple graphs on2–6vertices, at most10 nonedges. Enumerate interval supergraphs and solve an exact cover of nonedges by excluded pairs, with complete intersection verification. Complete graphs use the explicit zero-dimensional convention. Global state cap; no approximate dimension returned after exhaustion.

Intersection dimension describes adjacency

A box in d dimensions is a Cartesian product of d closed intervals. Associate one box with each vertex. Two vertices are adjacent exactly when their boxes overlap in every coordinate. Boxicity asks for the smallest number of coordinates that can represent the entire supplied graph in this way. It is a dimension of an intersection representation, not a graph-distance embedding dimension.

In particular, boxicity does not ask Euclidean distances to equal shortest-path distances. It also does not require unit side lengths or disjoint interiors for nonidentical vertices. These distinctions separate it from partial-cube recognition, unit-box models and geometric packing. The returned coordinates are one combinatorial witness; many continuously different boxes can encode exactly the same adjacency matrix.

Four strips realize a cycle as rectangle intersections0123Opposite pairs do not meet0 and 2: separate in y1 and 3: separate in xFour-cycle boxicity = 2
Scroll across to see the full diagram.
The four-cycle has boxicity2. Top,bottom,left and right rectangular strips realize its four cycle edges; opposite strips are separated in one coordinate.

Compare this with the Interval graph recognition calculator with an interval representation. Find the least number of interval supergraphs whose edge intersection equals the supplied graph, and return all coordinate intervals. Existing interval recognition only answers whether one interval representation exists; this constructs a minimum box-intersection dimension for noninterval graphs.

Supply a complete adjacency specification

Enter a small simple graph using the vertex count and undirected edges. An omitted pair is a required nonedge and must be separated in at least one coordinate. An entered edge must overlap in every coordinate. Isolated vertices are legitimate; repeated pairs and loops are not alternate ways to attach geometric information to the graph.

The initial implementation uses complete finite enumeration under the displayed vertex, nonedge and state limits. The number of nonedges directly affects the cover search, so even a graph with few vertices may exceed the chosen work bound. A limit message is not a dimension estimate. Keep all representation coordinates on this page rather than making separate two-dimensional and three-dimensional variants.

Convert boxes to interval supergraphs

For one coordinate, ignore every other coordinate and connect vertices whose intervals overlap on that axis. This produces an interval graph that contains every original edge. It can contain extra edges because some required nonedges may be separated only on another axis. Intersecting the coordinate edge sets removes those extra adjacencies and must recover exactly the original graph.

An exact small-instance construction can enumerate interval supergraphs and record which original nonedges each one excludes. Choosing the fewest coordinate graphs becomes a finite cover problem over the nonedges. A coordinate cannot exclude an original edge. The interval witnesses and the final pairwise intersection test are essential: a cover of pair labels alone is not a geometric representation without valid interval graphs behind it.

Understand the complete-graph convention

Using zero coordinates, every pair overlaps vacuously, which represents a complete graph. This page states the convention box(K_n)=0. Some treatments insist on a positive coordinate count and use one for complete graphs instead. The difference is a convention for this special case, so compare definitions before treating two reported values as contradictory.

A noncomplete interval graph has boxicity one because its intervals already realize the required adjacencies on a single axis. A noninterval graph needs at least two coordinates. Recognizing that lower bound is different from constructing a minimum representation. The existing interval-recognition page handles the one-coordinate question; this calculator resolves the additional coordinate-cover optimization for its supported small graphs.

The four-strip construction

For the default four-cycle, let vertex0 use[0,3]×[0,1], vertex1 use[2,3]×[0,3], vertex2 use[0,3]×[2,3], and vertex3 use[0,1]×[0,3]. Adjacent strips meet at corner regions. Vertices0 and2 are separated vertically; vertices1 and3 are separated horizontally. Every pair therefore has the desired intersection status.

This proves an upper bound of two. The four-cycle is not an interval graph: it is an induced cycle of length four, which an interval graph cannot contain. That rules out dimension one, while dimension zero would be complete. The lower and upper bounds agree, so the construction certifies boxicity two rather than merely showing that two coordinates happen to work.

Read and verify every coordinate

A returned interval row supplies a lower and upper endpoint for each vertex on one coordinate axis. Closed intervals may meet at an endpoint, and that meeting counts as overlap. To check a pair, take the larger of its lower endpoints and compare it with the smaller upper endpoint on every axis. Equality still permits the pair to intersect.

For every input edge, the overlap test must pass in all coordinates. For every input nonedge, at least one coordinate must fail it. This complete pairwise certificate is stronger than looking at a two-dimensional drawing, particularly when more coordinates are needed. Coordinate rescaling and translation can alter the displayed numbers without changing the intersection graph or the optimum dimension.

Interpret bounded optimality carefully

The reported minimum relies on exhaustive resolution of the permitted interval-supergraph cover problem. A feasible box system is only an upper bound until smaller-dimensional systems have been ruled out. If enumeration or consecutive-order recognition reaches its resource cap, the page must report unresolved computation instead of labeling the best-known dimension as exact.

This is an educational small-graph calculator, not a high-dimensional visualization engine or an optimization service for large rectangle-packing systems. It does not infer ecological competition, physical contact or causality from a graph. Use the coordinate certificate to understand which nonedges require separation and why multiple interval views may be necessary to explain one adjacency pattern.

A few questions, answered

Does dimension zero mean the graph is empty?

No. With the convention used here, zero-dimensional boxes represent a complete graph because every pair intersects vacuously.

Do touching interval endpoints count as an edge?

Yes. Intervals are closed, so endpoint contact is an overlap on that coordinate.

Is this the same as a partial-cube embedding?

No. Boxicity represents adjacency by intersections; a partial cube preserves graph distances as Hamming distances.

Does a two-dimensional drawing prove boxicity two?

It proves an upper bound only. A separate argument or completed search must rule out one coordinate.

Find your calculator

Start typing to explore the library.