Je crois avoir trouvé une réduction du chemin hamiltonien , prouvant ainsi le problème NP-difficile.
Appelons le mot w ∈ Σ ∗ un témoin pour A , s'il satisfait la condition de la question (pour chaque L ∈ A , il y a m ≥ 1 tel que { w m + i ∣ 0 ≤ i < | L | } = L ) .w∈Σ∗AL∈Am≥1{wm+i∣0≤i<|L|}=L
Considérons la version de décision du problème d'origine, c'est-à-dire décider si pour certains A et k ≥ 0 , il y a un témoin pour A de longueur au plus k . Ce problème peut être résolu en utilisant le problème d'origine comme un oracle en temps polynomial (trouver le témoin le plus court, puis comparer sa longueur à k ).Ak≥0Akk
Maintenant, au cœur de la réduction. Soit G = ( V , E ) un graphe simple, non orienté et connecté. Pour chaque v ∈ V , soit L v = { v } ∪ { e ∈ E ∣ v ∈ e } l'ensemble contenant le sommet v et toutes ses arêtes adjacentes. Réglez Σ = E et A = { L v ∣ v ∈ V } . Alors GG=(V,E)v∈VLv={v}∪{e∈E∣v∈e}vΣ=EA={Lv∣v∈V}G has a Hamiltonian path if and only if there is a witness for AA of length at most 2|E|+12|E|+1.
Proof. Let v1e1v2…en−1vnv1e1v2…en−1vn be a Hamiltonian path in GG and H={e1,e2,…,en−1}H={e1,e2,…,en−1} the set of all edges on the path. For each vertex vv, define the set Uv=Lv∖HUv=Lv∖H. Choose an arbitrary ordering αvαv for each UvUv. The word w=αv1e1αv2e2…en−1αvnw=αv1e1αv2e2…en−1αvn is a witness for AA, since Lv1Lv1 is represented by the substring α1e1α1e1, LvnLvn by en−1αnen−1αn, and for each vivi, i∉{1,n}, Lvi is represented by ei−1uviei. Furthermore, each edge in E occurs twice in w with the exception of |V|−1 edges in H, which occur once, and each vertex in V occurs once, giving |w|=2|E|+1.
For the other direction, let w be an arbitrary witness for A of length at most 2|E|+1. Clearly, each e∈E and v∈V occurs in w at least once. Without loss of generality, assume that each e∈E occurs in w at most twice and each v∈V occurs exactly once; otherwise a shorter witness can be found by removing elements from w.
Let H⊆E be the set of all edges occurring in w exactly once. Given the assumptions above, it holds that |w|=2|E|−|H|+|V|.
Consider a contiguous substring of w of the form ue1e2…ekv, where u,v∈V, ei∈E. We say that u,v are adjacent. Notice that if ei∈H, then ei={u,v}, because ei occurs only once, yet it is adjacent to two vertices in G. Therefore, at most one of ei can be in H. Similarly, no edge in H can occur in w before the first vertex or after the last vertex.
Now, there are |V| vertices, therefore |H|≤|V|−1. From there, it follows that |w|≥2|E|+1. Since we assume |w|≤2|E|+1, we get equality. From there we get |H|=|V|−1. By pigeonhole principle, there is an edge from H between each pair of vertices adjacent in w. Denote h1h2…hn−1 all elements from H in the order they appear in w. It follows that v1h1v2h2…hn−1vn is a Hamiltonian path in G. ◻
Since the problem of deciding the existence of Hamiltonian path is NP-hard and the above reduction is polynomial, the original problem is NP-hard too.