In mathematics, the Hamiltonian cycle polynomial of an n×n-matrix is a polynomial in its entries, defined as
ham(A)=∑σ∈Hn∏i=1nai,σ(i) where Hn is the set of n-permutations having exactly one cycle. This is an algebraic option useful, in a number of cases, for determining the existence of a Hamiltonian cycle in a directed graph. It is a generalization of the number of Hamiltonian cycles of a digraph as the sum of the products of its Hamiltonian cycles' arc weights (all of which equal unity) for weighted digraphs with arc weights taken from a given commutative ring. In the meantime, for an undirected weighted graph the sum of the products of the edge weights of its Hamiltonian cycles containing any fixed edge (i,j) can be expressed as the product of the weight of (i,j) and the Hamiltonian cycle polynomial of a matrix received from its weighted adjacency matrix via subjecting its rows and columns to any permutation mapping i to 1 and j to 2 and then removing its 1-st row and 2-nd column. In (Knezevic & Cohen (2017)) it was shown that
ham(A)=∑J⊆{2,…,n}det(−AJ)per(AJ¯) where AJ is the submatrix of A induced by the rows and columns of A indexed by J, and J¯ is the complement of J in {1,…,n}, while the determinant of the empty submatrix is defined to be 1. Due to this and Borchardt's identities, for a non-singular n×n Cauchy matrix C(x,y) ham(C(x,y))=det(−D12C∗2(x,y)D22+I/1)det(C(x,y)) where D1,D2 are diagonal matrices that make D1C(x,y)D2 unitary (in a real field or a field of a finite characteristic, or orthogonal in the field of complex numbers), C∗2(x,y) is the Hadamard (entry-wise) square of C(x,y), and I/1 is the identity n×n-matrix with the entry of indexes 1,1 replaced by 0.
In a field of characteristic 2 the equality ham(A)=∑J⊆{2,…,n}det(−AJ)per(AJ¯) turns into ham(A)=∑J⊆{2,…,n}det(AJ)det(AJ¯) what therefore provides an opportunity to polynomial-time calculate the Hamiltonian cycle polynomial of any unitary matrix U (i.e. such that UTU=I where I is the identity n×n-matrix), because in such a field each minor of a unitary matrix coincides with its algebraic complement: ham(U)=det2(U+I/1) where I/1 is the identity n×n-matrix with the entry of indexes 1,1 replaced by 0. Hence if it's possible to polynomial-time assign weights from a field of characteristic 2 to a digraph's arcs that make its weighted adjacency matrix unitary and having a non-zero Hamiltonian cycle polynomial then the digraph is Hamiltonian. Therefore the Hamiltonian cycle problem is computable on such graphs in polynomial time. In characteristic 2, the Hamiltonian cycle polynomial of an n×n-matrix is zero if n > 2k where k is its rank or if it's involutory and n > 2.
Besides, in an arbitrary ring R whose characteristic isn't an even natural number, for any skew-symmetric n×n-matrix A there exists a power series in a formal variable ε U(ε)=∑n=0∞Unεn such that it's a unitary n×n-matrix over R(ε) and U0=I, U1=A, while for any U(ε) satisfying these conditions ham(A) equals the coefficient at the n-th power of ε in the power series ham(U(ε)). And for any ring R of an even characteristic the same is true when the diagonal of AAT is a multiple of 2. It implies that computing, up to the n-th power of ε, the Hamiltonian cycle polynomial of a unitary n×n-matrix over the infinite extension of any ring of characteristic q (not necessarily prime) by the formal variable ε is a #qP-complete problem if q isn't 2 and computing the Hamiltonian cycle polynomial of a k-semi-unitary matrix (i.e. an n×n-matrix V such that rank(VTV−I)=k) over such an extension of any ring of characteristic 2 is a #2P-complete problem for any k > 0 (because any k-semi-unitary matrix can be received from a unitary matrix via removing k rows and k columns). For k=1 the latter statement can be re-formulated as the #2P-completeness of computing, for a given unitary n×n-matrix U over a field of characteristic 2, the n×n-matrix H(U) whose i,j-th entry is the Hamiltonian cycle polynomial of a matrix received from U via subjecting its rows and columns to any permutation mapping j to 1 and i to 2 and then removing its 1-st row and 2-nd column (i.e. the sum of the products of the arc weights of the corresponding weighted digraph's Hamiltonian paths from vertex i to vertex j) for i ≠ j and zero for i = j. This matrix satisfies the matrix equation U(H(U))T=H(U)UT, while ham(UUaaT1)=(a12+...+an2)ham(U) where a is an arbitrary n-vector (what can be interpreted as the polynomial-time computability of the Hamiltonian cycle polynomial of any 1-semi-unitary m×m-matrix A such that AAT=I+bbT where b is the m-th column of A with its m-th entry replaced by 0 and I is the identity m×m-matrix).
Moreover, it would be worth noting that in characteristic 2 the Hamiltonian cycle polynomial possesses its invariant matrix compressions (partly analogical to the Gaussian modification that is invariant for the determinant), taking into account the fact that ham(X)=0 for any t×t-matrix X having three equal rows or, if t > 2, a pair of indexes i,j such that its i-th and j-th rows are identical and its i-th and j-th columns are identical too. Hence if a matrix has two equal rows with indexes i and j then adding one of them to any third one doesn't change this polynomial in characteristic 2 what allows to Gaussian-style eliminate all the entries of its i-th column except the i,i-th and j,i-th ones (in case if they aren't zero) and remove its i-th column and j-th row (in the manner described above) – then the Hamiltonian cycle polynomial of the initial matrix equals this polynomial of the new one multiplied by the initial j,i-th entry.
Also in characteristic 2 and for matrices with more than two rows the Hamiltonian cycle polynomial isn't changed by adding the i-th column to the j-th one in a matrix where the i-th and j-th rows are identical what, particularly, yields the identity
… excerpt ends here. Continue reading the full article.