tutte#
Tutte polynomial for planar graphs represented as PlanarDiagram
objects.
This computes the Tutte polynomial T(_x, _y)
for planar graphs (no crossings)
using the standard deletion–contraction recursion until only loops and bridges remain,
where each terminal graph contributes _x^(#bridges) * _y^(#loops)
.
Functions
|
Return terminal diagrams after recursive deletion–contraction. |
|
Compute the Tutte polynomial |
- tutte(k)#
Compute the Tutte polynomial
T(_x, _y)
of a planar graph (no crossings).- Parameters:
k (PlanarDiagram | OrientedPlanarDiagram) – Planar diagram representing a planar graph (unoriented or oriented).
- Returns:
SymPy expression
T(_x, _y)
.- Raises:
ValueError – If
k
is not a planar graph (contains crossings).- Return type:
Expr