Skip to content
m·amathatlas
ExploreAboutOpen problemsCited authorsMy libraryFeedback
Sign in
FRENES
Loading views…Recent views only, across all languages. Vercel history is unavailable for this page. Repeat visits in the same tab are grouped for 30 minutes.
ShareLinkedInXFacebookWhatsApp
← All open problems
Unanswered question

NP-hardness of a string transformation problem with k templates

Theoretical computer science

Imported on November 28, 2026

The forum classified this question as unanswered when collected. This does not certify an open research problem; check the answers and revision history at the source.

Read the question with its definitions and background below. The source provides the full formulation and further discussion; the glossary and Wikipedia links offer additional reading aids.

Problem statement

Given strings xxx and yyy, a template length lll, and a maximum number of different templates kkk, the task is to determine if it's possible to convert xxx into yyy using no more than kkk different templates, each of exactly length lll. For example, if x=AAAx = AAAx=AAA, y=ABCy = ABCy=ABC, l=2l = 2l=2, and k=2k = 2k=2, the answer would be YES because it's feasible to achieve the transformation with just two different templates of length 2. For example ABABAB to get ABAABAABA and then BCBCBC to get the desired ABCABCABC.

The goal would be to prove that this problem is NP-hard by reducing a known problem to this problem. I've tried many problems but never successfully. Thanks for your help!

EDIT:

A template is a string of length lll (fixed for all templates and given as a parameter of the problem) that is composed of the letter of the alphabet (AAA to ZZZ). It can be 'printed' onto the original string. It will replace all the characters that were present in the section of the string where the template is applied.

To clarify the use of templates, here is a more detailed example:

Let’s take x=AAAAAAx = AAAAAAx=AAAAAA. If the first template is set to be t1=ADFt_1 = ADFt1​=ADF, we could choose to ‘print’ t1t_1t1​ at position 1 of xxx, resulting in ADFAAAADFAAAADFAAA. If we decide to use another template t2=XYZt_2 = XYZt2​=XYZ, we could then ‘print’ that at position 4 of the string to get ADFXYZADFXYZADFXYZ. We could then choose to use the first template t1=ADFt_1 = ADFt1​=ADF again at position 2 to obtain AADFYZAADFYZAADFYZ. We cannot 'print' these templates at positions 5 or 6, as that would cause an attempt to write ttt out of bounds (every character of ttt needs to align with an existing character of xxx).

Statement and context adapted from MathOverflow · Paul Calvi

CC BY-SA 4.0 · Formatting adapted; mathematical formulas preserved · Source history

Topics : algorithms · computational-complexity · computer-science

Authors listed by the source : Paul Calvi

Sources and original status

  • MathOverflow Status in source : unanswered at collection

Last activity on the question : June 2, 2024

Coverage, sources and method

This count measures imported entries, including distinct variants. It is not a count of all open mathematical questions worldwide. One entry may belong to several fields and sources.

This directory is neither exhaustive nor updated in real time. “Reported open” describes the source classification observed at import; imported entries have not each undergone independent mathematical verification. The 32 explained entries were reviewed separately.

Formal Conjectures: only “research open” statements with no reported formal proof are retained; their tag is checked in a pinned repository revision. Variants remain distinct. A “sorry” placeholder is not sufficient to establish open status.

Erdős: solved or independent problems and entries with a Lean solution are excluded, including “open (Lean)”. Exact matches to the main Formal Conjectures statements are merged.

Open Problem Garden: the open index is checked against the solved index; spam, identified clones and some outdated statuses are excluded. Statements and definition context are attributed to their original pages; formulas are preserved and the content remains under the GFDL. Recognized duplicates across sources are merged; this does not resolve every mathematical equivalence.

OEIS: direct extraction of conjectural comments and formulas, one entry per sequence, excluding mentioned resolutions. MathOverflow and Math Stack Exchange: questions classified as unanswered by their API, excluding closed posts and non-research categories. They remain distinct from problems reported open. This is a partial, dated collection; every entry credits its authors and license.

Documented exclusions account for recent announcements and conflicting statuses. A stronger variant or a special case can remain open after a different statement is settled.

Attribution: The Formal Conjectures Authors; teorth/erdosproblems and contributors; Open Problem Garden and contributors. Each source retains its license.

  • Formal Conjectures · 1,924 · Apache-2.0 / CC-BY-4.0
  • Erdős Problems (teorth) · 622 · Apache-2.0
  • Open Problem Garden · 404 · GFDL (source content); only title/category/link metadata imported
  • OEIS · 18,857 · CC BY-SA 4.0
  • MathOverflow · 19,035 · CC BY-SA (version on each entry)
  • Mathematics Stack Exchange · 35 · CC BY-SA (version on each entry)
Report a development or correction
mathatlas

An independent atlas to understand, read, and question research.

The papers present claimed results at different stages of verification.
NewsletterShare feedbackAbout Data and privacy
Created by Sonny Mupfuni