An SPQR tree is a tree data structure that represents the decomposition of a biconnected graph into its triconnected components along vertex cuts of size 2. Each graph vertex of the tree has an associated multigraph, called its skeleton, and has one of four types.
| type | skeleton |
| S | a cycle graph with at least three vertices |
| P | a dipole graph with at least three multiple edges |
| Q | a single real edge |
| R | a graph with vertex connectivity at least 3 that is neither a cycle graph nor a dipole graph |
The letters S, P, and R stand for series, parallel, and rigid, respectively, while Q-nodes represent individual graph edges. Some definitions omit Q-nodes. The skeleton edges corresponding to edges of the original graph are called real edges. Every graph edge of the SPQR tree corresponds to a pair of virtual edges, one in each of the two incident skeletons. The two virtual edges have the same pair of endpoints, called poles. Replacing paired virtual edges by the corresponding pertinent graphs reconstructs the original graph.
After each graph edge between two S-nodes or between two P-nodes is contracted, the resulting reduced SPQR tree is unique up to graph
isomorphism. Rooted variants depend on the choice of a graph
edge as root, and conventions differ in their treatment of Q-nodes. The SPQR
tree has linear total size and can be constructed in time (Hopcroft and Tarjan 1973, Gutwenger and
Mutzel 2001).
For a graph that is both a planar graph and a biconnected graph, the SPQR tree compactly represents all planar embeddings. The skeleton of an R-node has two possible oriented embeddings, related by reflection, while the multiple edges in a P-node skeleton can be arranged by arbitrary cyclic permutations. S- and Q-node skeletons introduce no choices. Consequently, if the graph edges are labeled and reflection is distinguished, the number of rotation systems defining planar embeddings is
where is the number of R-nodes,
is the set of P-nodes, and
is the number of edges in the skeleton of P-node
. Here the exclamation point denotes the factorial.
This formula does not identify rotation systems related by a graph
automorphism or by a global reflection (Di Battista
and Tamassia 1996).
For a connected graph that is not a biconnected graph, a block-cut tree first decomposes the graph into blocks, after which an SPQR tree can be constructed for each nontrivial block that is a biconnected graph.