28
Stack Exchange
votes

Is Hankelability NP-hard?

Posted on 4/16/2015
UQ ID:15
Science
Theoretical Computer Science
Original

I asked this question on SO on April 7 and added a bounty which has now expired but no poly time solution has been found yet.

I am trying to write code to detect if a matrix is a permutation of a Hankel matrix. Here is the spec.

Input: An n by n matrix M whose entries are 1 or 0.

Output: A permutation of the rows and columns of M so that M is a Hankel matrix if that is possible. A Hankel matrix has constant skew-diagonals (positive sloping diagonals).

When I say a permutation, I mean we can apply one permutation to the order of the rows and a possibly different one to the columns.

A very nice time algorithm is known for this problem if we only allow permutation of the order of rows.

Peter de Rivaz pointed out this paper as a possible route to proving NP-hardness but I haven't managed to get that to work.

Keywords & Tags
cc.complexity-theory
Model Answers (9)
Submitted answers from various AI models
Unsolved
No reviews yet

K2-Think

Pending UQ Validation
Needs Human Verification
MBZUAI-IFM
Qwen2.5-32B
Sep 18, 2025, 01:50 PM

The problem of determining if a given n×n binary matrix can be permuted (via row and column permutations) into a Hankel matrix is NP-hard.

This conclusion is supported by the referenced paper "Re-orderable Matrix: Recognition and Uniqueness" which states that recognizing whether a matrix can be reordered into a Hankel matrix (or Toeplitz matrix) via row and column permutations is NP-hard.

Key ...

0 model reviews
0 human reviews
No reviews yet

GPT-5

Failed UQ Validation
Needs Human Verification
OpenAI
Sep 2, 2025, 06:56 AM

Short answer: Yes. The decision version of Hankelability is NP-complete (already for 0–1 matrices).

Why the problem is in NP Given a certificate consisting of two permutations of {1,…,n} (for the rows and the columns) and a 0–1 pattern on anti-diagonals (a bit for each sum k=2,…,2n), you can verify in O(n^2) time that, after permuting rows and columns accordingly, every anti-diagonal is constant ...

0 model reviews
0 human reviews
No reviews yet

o3

Failed UQ Validation
Needs Human Verification
OpenAI
Aug 1, 2025, 12:00 AM

Yes – deciding whether a 0/1-matrix can be permuted independently in its rows and its columns so as to become Hankel is NP-complete (“Hankelability” is NP-hard and lies in NP).


  1. The decision problem

HANKELABILITY

Input : an n × n 0...

0 model reviews
0 human reviews
No reviews yet

o4 mini

Failed UQ Validation
Needs Human Verification
OpenAI
Aug 1, 2025, 12:00 AM

Here is a clean summary of what is known:

  1. The decision problem “HANKELABILITY”
    Input: an n×n 0–1‐matrix M.
    Question: Do there exist two permutations P (of the rows) and Q (of the columns) and a vector f:[2…2n]→{0,1} so that for all i,j
    (P M Q)[i,j] = f(i+j)?

  2. HANKELABILITY is in NP.
    A certificate is just the two permutations P,Q (and the f-vector can be read...

0 model reviews
0 human reviews
No reviews yet

Claude Opus 4

Failed UQ Validation
Needs Human Verification
Anthropic
Aug 1, 2025, 12:00 AM

This is an interesting computational problem about determining whether a binary matrix can be transformed into a Hankel matrix through row and column permutations.

Let me analyze the complexity of this problem:

The Problem (Hankelability)

  • Input: An n×n binary matrix M
  • Question: Do there exist permutations π (for rows) and σ (for columns) such that M'[i,j] = M[π(i),σ(j)] is a Hank...
0 model reviews
0 human reviews
No reviews yet

Gemini 2.5 Pro

Failed UQ Validation
Needs Human Verification
Google
Aug 1, 2025, 12:00 AM

Excellent question. This is a classic example of a problem that seems simple on the surface but is computationally very hard.

Summary

Yes, the problem of determining if a matrix is a permutation of a Hankel matrix (which I'll call Hankelability) is NP-hard.

Intuition

The difficulty arises from the need to find two permutations simultaneously: one for the rows (p) and one fo...

0 model reviews
0 human reviews
No reviews yet

o3 Pro

UQ Validated
Failed Human Verification
OpenAI
Aug 1, 2025, 12:00 AM

Yes – deciding whether a 0/1 matrix can be turned into a Hankel matrix by independently permuting its rows and its columns is an NP-complete problem (so, unless P = NP, no polynomial-time algorithm exists).

Why the problem is in NP
If two permutations σ (of the rows) and τ (of the columns) are given it takes Θ(n²) time to build the rearranged matrix σ M τ and to verify that every north-east / s...

0 model reviews
0 human reviews
No reviews yet

DeepSeek R1

Failed UQ Validation
Needs Human Verification
DeepSeek
deepseek-ai/DeepSeek-R1
Aug 1, 2025, 12:00 AM
<think> We are given an n by n matrix M with entries 1 or 0. We wish to know if there is a permutation of the rows and a permutation of the columns such that the resulting matrix is Hankel. A Hankel matrix has constant skew-diagonals (i.e., the entries on each diagonal from top-left to bottom-right are constant).

Note: In a Hankel matrix, the (i,j) entry depends only on i+j. Specifically, for a f...

0 model reviews
0 human reviews
No reviews yet

Claude 3.7 Sonnet

Failed UQ Validation
Needs Human Verification
Anthropic
Aug 1, 2025, 12:00 AM

Is Hankelability NP-hard?

The question asks whether it's NP-hard to determine if a binary matrix can be transformed into a Hankel matrix through independent permutations of its rows and columns.

Problem Analysis

A Hankel matrix is one where each skew-diagonal (running from bottom-left to top-right) contains identical values. Formally, a matrix H is Hankel if H(i,j) = H(k,l) whenever i+...

0 model reviews
0 human reviews
Submit Your Model's Answer
Your submission will be validated by our LLM validator and then by human experts

You need to be logged in to submit an answer