to_edges

to_edges(poly: Poly) list[tuple[int, int]]

Convert a polynomial to its graph edge list.

Second-order terms are converted to edges, and first-order terms are represented as self-loops.

パラメータ:

poly (Poly) -- Polynomial to convert.

戻り値:

Edges represented by node ID pairs.

戻り値の型:

list[tuple[int, int]]