In this section, we present the proofs of correctness of the Procedure *SHIFT* (Lemma 1) and Algorithm *CPP* (Theorem 4).

### Lemma 1

*Let**P*^{θ}*be a smallest power of a path that contains**G*_{l−1}=*G*[*v*_{1},…,*v*_{l−1}] *as an induced subgraph*, *with respect to the ordering**v*_{1}<⋯<*v*_{l−1}. *Let**v*_{
l
}∈*V*(*G*) *be the next vertex inserted in**P*^{θ}*and*\(v_{l-t-1}v_{l} \not\in E(G), \ v_{l-t}v_{l} \in E(G)\)*and*\(d_{P_{n_{\theta}}}(v_{l-t}, v_{l})= \theta+1\). *Then*, *the output of the Procedure* SHIFT, *the power of a path**P*^{θ+1}, *is a smallest power of a path that contains**G*_{
l
}=*G*[*v*_{1},…,*v*_{l−1},*v*_{
l
}] *as an induced subgraph*, *with respect to the ordering**v*_{1}<⋯<*v*_{l−1}<*v*_{
l
}.

### Proof

Since \(v_{l-t-1}v_{l} \not\in E(G)\), *v*_{l−t}*v*_{
l
}∈*E*(*G*) and \(\theta+1=\allowbreak d_{P_{n_{\theta}}}(v_{l-t}, v_{l})\), the Procedure *SHIFT* must increase the power *θ* by one unit (Step 1). But the increase of *θ* to *θ*+1 creates several adjacencies in *P*^{θ} between pairs of vertices of the set {*v*_{1},…,*v*_{
l
}} that are non-adjacent in *G*. In order to preserve the adjacencies and non-adjacencies between vertices of *G* in *P*^{θ}, Procedure *SHIFT* is forced to insert one vertex between the vertex that received *v*_{l−t−1} in *P*^{θ} and its consecutive vertex in *P*^{θ}. Again, counting in descending order from vertex *v*_{l−t−1}, the adjacencies were violated in each “block” of *θ* vertices in *P*^{θ}. So, the procedure must insert one vertex to each *θ*+1 vertices in descending order, from vertex *v*_{l−t−1} in *P*^{θ}. We observe that the set formed by the initial vertices of *V*(*P*^{θ}) has cardinality less than or equal to *θ*+1, because dividing \(\mathrm {order}_{P^{\theta}}(v_{l-t-1}) \ \) by *θ*+1 the remainder is greater than or equal to 1 and less than or equal to *θ*+1.

In each step, the procedure inserts the smallest number of vertices necessary to guarantee that the power of a path *P*^{θ+1}, created by Procedure *SHIFT*, contains *G*_{
l
}[*v*_{1},…,*v*_{
l
}] as an induced subgraph. So, the power *θ*+1 and the number of inserted vertices are minimum and, consequently, *P*^{θ+1} is a smallest power of a path that contains *G*_{
l
}[*v*_{1},…,*v*_{
l
}] as an induced subgraph. □

First, we prove that Algorithm *CPP* correctly returns a smallest power of a path according to the ordering given by Algorithm *Recognize* [3].

### Lemma 2

*Let**G**be a connected unit interval graph*. *Algorithm* CPP *generates the smallest power of a path*\(P_{n_{\theta}}^{\theta}\), *with respect to**θ**and**n*_{
θ
}, *that contains**G**as an induced subgraph according to the ordering**v*_{1}<⋯<*v*_{
n
}*given by the input of* CPP.

### Proof

Algorithm *CPP* constructs a sequence of powers of paths \(P^{\theta_{0}} \subseteq P^{\theta_{1}} \subseteq \cdots \subseteq P^{\theta}\), where *θ*_{
i
}=*θ*_{i−1}+1. This is done by successively adding, in each \(P^{\theta_{i}}\), vertices of *G* following the input ordering, preserving the adjacencies and non-adjacencies between vertices of *G* and minimizing *θ* and *n*_{
θ
}. Initially, the power of a path \(P^{\theta_{0}}\) receives the maximal clique containing *v*_{1}, i.e., \(V(P^{\theta_{0}}) =\{u_{1}, \ldots, u_{\xi_{P^{\theta_{0}}}(v_{1})}\}\) and *θ*_{0}=*ξ*_{
G
}(*v*_{1})−1. This is the smallest power of a path that contains \(G[v_{1}, \ldots, v_{\xi_{G}(v_{1})}]\) as an induced subgraph.

Suppose that the *l*−1 first vertices, i.e., {*v*_{1},…,*v*_{l−1}}, were already been inserted by Algorithm *CPP* in the power of a path *P*^{θ}, i.e., *P*^{θ} is the smallest power of a path, with respect to *θ* and *n*_{
θ
} that contains *G*[*v*_{1},…,*v*_{l−1}] as an induced subgraph. Let *v*_{
l
}∈*V*(*G*) the next vertex to be inserted by Algorithm *CPP* in *P*^{θ}. Suppose that *v*_{
l
} is adjacent, in *P*^{θ}, to {*v*_{l−t},…,*v*_{l−1}}. Vertex *v*_{
l
} must be inserted in *P*^{θ} between positions \(\xi_{P^{\theta}}(v_{l-t-1})+1\) and \(\xi_{P^{\theta}}(v_{l-t})\) so that *G*[*v*_{1},…,*v*_{
l
}] be an induced subgraph of *P*^{θ}. Then, \(d_{P_{n_{\theta}}}(v_{l-t-1}, v_{l}) \geq \theta+1\) and \(d_{P_{n_{\theta}}}(v_{l-t}, v_{l}) \leq \theta\). We consider two cases with respect to the adjacencies of *v*_{
l
} in *G*. From now on, we refer to Fig. 2, and Fig. 3 and Fig. 4, where dashed lines represent adjacencies.

Case 1: If *t*=*θ*, then after insertion of *v*_{
l
}, \(\theta + 1 \leq d_{P_{n_{\theta}}}(v_{l-t-1},v_{l})\), because the set {*v*_{l−t},…,*v*_{l−1}} has *t*=*θ* elements (see Fig. 2). In order to minimize *θ* and *n*_{
θ
}, Algorithm *CPP* must insert *v*_{
l
} in the consecutive vertex to *v*_{l−1} in the power of a path *P*^{θ}, and as a consequence \(d_{P_{n_{\theta}}}(v_{l-t}, v_{l}) \leq \theta + 1\). In effect, since *v*_{l−1} is adjacent to *v*_{l−t} in *P*^{θ}, by hypothesis, *v*_{l−1} was inserted in *P*^{θ} such that \(d_{P_{n_{\theta}}}(v_{l-t}, v_{l-1}) \leq \theta\) and *v*_{
l
} was inserted in the consecutive vertex to *v*_{l−1} in *P*^{θ}, then the claim is true. If \(d_{P_{n_{\theta}}}(v_{l-t}, v_{l}) \leq \theta\), Algorithm *CPP* inserted *v*_{
l
} without changing *θ*, the number of vertices of *P*^{θ} became *n*_{
θ
}+1, and so this insertion was minimum. If \(d_{P_{n_{\theta}}}(v_{l-t},v_{l}) = \theta+1\), Algorithm *CPP* called the Procedure *SHIFT* and, by Lemma 1, we conclude the proof.

Case 2: If 1<*t*<*θ*, Algorithm *CPP* must insert *v*_{
l
} in *P*^{θ} such that \(d_{P_{n_{\theta}}}(v_{l-t-1}, v_{l}) \geq \theta + 1\) so that *v*_{l−t−1} and *v*_{
l
} are not adjacent. We observe the position of *v*_{l−1} in *P*^{θ}. If *v*_{l−1} is not adjacent to *v*_{l−t−1} in *P*^{θ} (see Fig. 3), in order to minimize the number of vertices of *P*^{θ}, Algorithm *CPP* inserts *v*_{
l
} in the consecutive vertex to *v*_{l−1}. By hypothesis, vertex *v*_{l−1} was inserted in *P*^{θ} so that \(d_{P_{n_{\theta}}}(v_{l-t}, v_{l-1})\leq \theta\). Then, if \(d_{P_{n_{\theta}}}(v_{l-t}, v_{l-1}) < \theta\), we have \(d_{P_{n_{\theta}}}(v_{l-t}, v_{l}) \leq \theta\). Thus *v*_{
l
} was inserted in *P*^{θ} without changing *θ*, the number of vertices of *P*^{θ} became *n*_{
θ
}+1, and so this insertion was minimum. If \(d_{P_{n_{\theta}}}(v_{l-t}, v_{l-1}) = \theta\), we have \(d_{P_{n_{\theta}}}(v_{l-t},v_{l}) = \theta + 1\), Procedure *SHIFT* was called and, by Lemma 1, we conclude the proof.

If *v*_{l−1} is adjacent to *v*_{l−t−1} in *P*^{θ} (see Fig. 4), the position of *v*_{l−t−1} in *P*^{θ} is between *l*−*t*+1 and \(\xi_{P^{\theta}}(v_{l-t-1})\), including them. Again, in order to minimize the number of vertices of *P*^{θ}, vertex *v*_{
l
} is inserted \((\xi_{P^{\theta}}(v_{l-t-1}) - \mathrm {order}_{P^{\theta}}(v_{l-1}))\) vertices after vertex *v*_{l−1} in *P*^{θ}. Thus,

Since \(d_{P_{n_{\theta}}}(v_{l-t}, v_{l}) < d_{P_{n_{\theta}}}(v_{l-t-1}, v_{l}) = \theta +1\), we have \(d_{P_{n_{\theta}}}(v_{l-t}, v_{l}) \leq \theta\). So, *v*_{
l
} was inserted in *P*^{θ} without changing *θ*, and the number of vertices of *P*^{θ} became \(n_{\theta}+(\xi_{P^{\theta}}(v_{l-t-1}) - \mathrm {order}_{P^{\theta}}(v_{l-1}))+1\). This insertion was minimum, because \(d_{P_{n_{\theta}}}(v_{l-t-1}, v_{l}) = \theta +1\).

This concludes the proof of the Lemma 2. □

In order to show that the Algorithm *CPP* returns the smallest power of a path containing *G* as an induced subgraph, we present two results with a given power of a path *P*^{σ} containing *G* as an induced subgraph. First, we shall give some notation from [3]. Given an unit interval graph *G* and an unit interval model associated to its vertices *I*={*v*_{1},*v*_{2},…,*v*_{
n
}}, we recall that the interval associated to vertex *v* is (*a*_{
v
},*b*_{
v
}). We say that *v*_{1},*v*_{2},…,*v*_{
n
} is a *natural labeling* for the vertices of *G*, if \(a_{v_{i}} \leq a_{v_{i+1}}\), for each 1≤*i*≤*n*−1. The ordering *v*_{1}<*v*_{2}<…<*v*_{
n
} is a *natural ordering*, if *v*_{1},*v*_{2},…,*v*_{
n
} is a natural labeling for *V*(*G*). A vertex is a *left anchor* if it can receive the label *v*_{1} in some natural labeling for *V*(*G*). Consider the model *I*′ obtained by mirroring an unit interval model *I* (that is, replacing each interval (*a*,*b*) by (−*b*,−*a*)). Model *I*′ is also a valid unit interval model for *G*, so the rightmost interval in *I* is also a left anchor.

In the next results, we show properties of the ordering of *V*(*G*) induced by a natural ordering that is generated by the subscripts of a natural labeling of a power of a path.

### Lemma 3

*Let*\(P_{n_{\sigma}}^{\sigma}\)*be a power of a path that contains**G**as an induced subgraph*. *The ordering of the vertices of**V*(*G*) *induced by a natural ordering of the vertices of**V*(*P*^{σ}) *satisfies Property *2.

### Proof

Suppose that this ordering of *V*(*G*) does not satisfy Property 2. Then, there exist three vertices *v*_{
r
},*v*_{
s
},*v*_{
t
}∈*V*(*G*) such that *v*_{
r
}<*v*_{
s
}<*v*_{
t
} with \(v_{r}v_{s}\not\in E(G)\) and *v*_{
r
}*v*_{
t
}∈*E*(*G*). It follows that *v*_{
r
}*v*_{
t
}∈*E*(*G*)⊂*E*(*P*^{σ}). Therefore, \(1\leq |\mathrm {order}_{P^{\sigma}}(v_{r}) - \mathrm {order}_{P^{\sigma}}(v_{t})|\leq \sigma\). Since *v*_{
r
}<*v*_{
s
}<*v*_{
t
} in *V*(*P*^{σ}), we have \(|\mathrm {order}_{P^{\sigma}}(v_{r}) - \mathrm {order}_{P^{\sigma}}(v_{s})|\leq |\mathrm {order}_{P}(v_{r}) - \mathrm {order}_{P}(v_{t})|\), and then \(1\leq |\mathrm {order}_{P^{\sigma}}(v_{r}) - \mathrm {order}_{P^{\sigma}}(v_{s})|\leq \sigma\). Consequently, *v*_{
r
}*v*_{
s
}∈*E*(*P*^{σ}) and \(v_{r}v_{s} \not\in E(G)\), i.e., \(P_{n_{\sigma}}^{\sigma}\) does not contain *G* as an induced subgraph. □

Vertices \(v, \overline{v} \in V(G)\) are *indistinguishable vertices* (*twin vertices*) if \(N_{G}[v] = N_{G}[\overline{v}]\). The next result states that it is possible to change the position, between indistinguishable vertices of *V*(*G*) in a natural ordering of *V*(*P*^{σ}).

### Lemma 4

*Let**v*, \(\overline{v} \in V(G)\)*such that*\(N_{G}[v] = N_{G}[\overline{v}]\)*with**v*=*u*_{
i
}*and*\(\overline{v} = u_{j}\)*in**V*(*P*^{σ}). *If we change the positions of vertices**v**and*\(\overline{v}\)*in**P*^{σ}, *i*.*e*., *v*=*u*_{
j
}*and*\(\overline{v} = u_{i}\), *graph**G**will still be an induced subgraph of**P*^{σ}.

### Proof

Without loss of generality, suppose *i*<*j*. By Lemma 3, the ordering of *V*(*G*) induced by a natural ordering of *V*(*P*^{σ}) satisfies Property 2. So, \(N_{G}[v]=\{v_{\eta_{G}(v)},\ldots, v_{\xi_{G}(v)}\}\) and \(N_{G}[\overline{v}]=\{v_{\eta_{G}(\overline{v})}, \ldots,v_{\xi_{G}(\overline{v})}\}\). Since \(N[v] = N[\overline{v}]\), we have \(\xi_{G}(\overline{v}) =\xi_{G}(v)\) and \(\eta_{G}(\overline{v}) = \eta_{G}(v)\). Then, \(v_{\xi_{G}(v)} =v_{\xi_{G}(\overline{v})}\), \(v_{\eta_{G}(v)} = v_{\eta_{G}(\overline{v})}\), \(v_{\xi_{G}(v)+1}=v_{\xi_{G}(\overline{v})+1}\) and \(v_{\eta_{G}(v)-1} = v_{\eta_{G}(\overline{v})-1}\). Thus, by changing the positions of vertices *v* and \(\overline{v}\) in *P*^{σ}, we have \(\mathrm {order}_{P^{\sigma}}(\overline{v}) - \mathrm {order}_{P^{\sigma}}(v_{\eta_{G}(\overline{v})-1}) \geq \sigma +1\); then edge \(\overline{v}v_{\eta_{G}(\overline{v})-1} \not\in E(P^{\sigma})\). Also, for any *v*′∈*V*(*G*) with \(\mathrm {order}_{G}(v') < \mathrm {order}_{G}(v_{\eta_{G}(\overline{v})-1})\), edge \(\overline{v}v' \not\in E(P^{\sigma})\). Similarly, \(\mathrm {order}_{P^{\sigma}}(v_{\xi_{G}(v)+1}) - \mathrm {order}_{P^{\sigma}}(v)\geq \sigma + 1\), i.e., edge \(vv_{\xi_{G}(v)+1} \not\in E(P^{\sigma})\) and also, for any *v*′∈*V*(*G*) with \(\mathrm {order}_{G}(v_{\xi_{G}(v)+1}) < \mathrm {order}_{G}(v')\), edge \(vv' \not\in E(P^{\sigma})\).

Analogously, \(\sigma \geq \mathrm {order}_{P^{\sigma}}(\overline{v})- \mathrm {order}_{P^{\sigma}}(v_{\eta_{G}(v)})\), i.e., edge \(\overline{v}v_{\eta_{G}(\overline{v})} \in E(P^{\sigma})\) and, for any *v*′∈*V*(*G*) with \(\mathrm {order}_{G}(v_{\eta_{G}(\overline{v})}) < \mathrm {order}_{G}(v') < \mathrm {order}_{G}(\overline{v})\), edge \(\overline{v}v' \in E(P^{\sigma})\). Similarly \(\sigma \geq \mathrm {order}_{P^{\sigma}}(v_{\xi_{G}(\overline{v})}) - \mathrm {order}_{P^{\sigma}}(v)\), i.e., edge \(vv_{\xi_{G}(v)} \in E(P^{\sigma})\) and, for any *v*′∈*V*(*G*) with \(\mathrm {order}_{G}(v) < \mathrm {order}_{G}(v') <\mathrm {order}_{G}(v_{\xi_{G}(v)})\), edge *vv*′∈*E*(*P*^{σ}). □

In what follows, we denote by *v*_{
i
}<_{
B
}*v*_{
j
} if order_{
G
}(*v*_{
i
})<order_{
G
}(*v*_{
j
}) considering the ordering of *V*(*G*) given by Algorithm *Recognize* [3]. First, Theorem 4, we need two results.

### Theorem 3

(Theorem 2.2 [3])

*Let**I**be an unit interval model of an unit interval graph**G**with natural labeling**v*_{1},…,*v*_{
n
}. *Then*, *for all vertices*\(\bar{v},\ v \in V(G)\), *if*\(a_{\bar{v}} < a_{v}\)*but*\(v <_{B} \bar{v}\), *we have*\(N_{G}[v]=N_{G}[\bar{v}]\).

As consequence of Theorem 2.3 of [3], we have the following result.

### Lemma 5

([3])

*Let*\(v'_{1} <_{B} v'_{2} <_{B} \cdots <_{B} v'_{n}\)*be an ordering of**V*(*G*) *given by Algorithm *Recognize [3] *of an unit interval graph**G*. *Given a natural labeling**v*_{1},…,*v*_{
n
}*then*\(N_{G}[v'_{1}]=N_{G}[v_{1}]\)*or*\(N_{G}[v'_{1}]=N_{G}[v_{n}]\).

Finally, the correctness of Algorithm *CPP* is given by theorem below.

### Theorem 4

*Let**G**be an unit interval graph*. *Algorithm* CPP *returns the smallest power of a path*\(P^{\theta}_{n_{\theta}}\)*with respect to**θ**and**n*_{
θ
}, *that contains**G**as an induced subgraph*.

### Proof

Let \(P^{\sigma}_{n_{\sigma}}\) be the smallest power of a path that contains *G* as an induced subgraph. Let \(\overline{u}_{1} < \cdots < \overline{u}_{n_{\sigma}}\) be a natural ordering of *V*(*P*^{σ}) and let \(\overline{v}_{1} < \cdots < \overline{v}_{n}\) be the ordering of *V*(*G*) induced by the natural ordering of *V*(*P*^{σ}). Clearly, \(\overline{v}_{1}, \ldots, \overline{v}_{n}\) is a natural labeling of *V*(*G*). Let *I* be a family of intervals for this labeling of *V*(*G*), such that each *v*∈*V*(*G*) is associated to (*a*_{
v
},*b*_{
v
})∈*I*.

If we prove \(\overline{v}_{1} < \overline{v}_{2} < \cdots < \overline{v}_{n}\) is equal to \(v'_{1} <_{B}v'_{2} <_{B} \cdots <_{B} v'_{n}\) up to indistinguishable vertices, we have *θ*=*σ* and *n*_{
θ
}=*n*_{
σ
}. In fact, since *P*^{σ} is the smallest power of a path that contains *G* as an induced subgraph, then *σ*≤*θ* and *n*_{
σ
}≤*n*_{
θ
}. On the order hand, by Lemma 2, the power of a path *P*^{θ} returned by Algorithm *CPP* is the smallest power of a path that contains *G* as an induced subgraph with respect to the ordering, \(v'_{1}<_{B} v'_{2} <_{B} \cdots <_{B} v'_{n}\). So, if this ordering is equal to \(\overline{v}_{1} < \overline{v}_{2} < \cdots < \overline{v}_{n}\), up to indistinguishable vertices, by Lemma 4, *P*^{σ} contains *G* as an induced subgraph with respect to the ordering \(v'_{1} <_{B} v'_{2} <_{B}\cdots <_{B} v'_{n}\). Then, by minimality of *θ* and *n*_{
θ
} with respect to \(v'_{1} <_{B} v'_{2} <_{B}\cdots <_{B} v'_{n}\), we have *σ*≥*θ* and *n*_{
σ
}≥*n*_{
θ
}.

First, suppose that the left anchor \(\overline{v}_{1}\) is equal to \(v'_{1}\). Suppose, by absurd, that there exist \(v, \ \tilde{v} \in V(G)\), such that \(v < \tilde{v}\), \(\tilde{v} <_{B} v\) and \(N_{G}[v] \neq N_{G}[\tilde{v}]\). Since \(v < \tilde{v}\) then \(a_{v} \leq a_{\tilde{v}}\). If \(a_{v} = a_{\tilde{v}}\), since all intervals of *I* have the same length, we have \(b_{v} = b_{\tilde{v}}\) and hence \(N_{G}[v] =N_{G}[\tilde{v}]\) a contradiction to the hypothesis. If \(a_{v} < a_{\tilde{v}}\), since \(\tilde{v} <_{B} v\) then, by Theorem 3, \(N_{G}[v] = N_{G}[\tilde{v}]\), a contradiction to the hypothesis. Thus, for all pair of vertices \(v, \tilde{v} \in V(G)\) such that \(v < \tilde{v}\) and \(\tilde{v} <_{B} v\), then \(N_{G}[v] = N_{G}[\tilde{v}]\). Consequently, we have *σ*=*θ* and *n*_{
σ
}=*n*_{
θ
}.

Now, suppose that the left anchor \(\overline{v}_{1}\) is different from \(v'_{1}\). By Lemma 5, either \(N_{G}[\overline{v}_{1}] = N_{G}[v'_{1}]\) or \(N_{G}[\overline{v}_{n}] =N_{G}[v'_{1}]\). If \(N_{G}[\overline{v}_{1}] = N_{G}[v'_{1}]\), by Lemma 4, we can change the positions of these vertices in *V*(*P*^{σ}), i.e., \(\overline{u}_{\mathrm {order}_{P^{\sigma}}(v'_{1})}=\overline{v}_{1}\) and \(\overline{u}_{\mathrm {order}_{P^{\sigma}}(\overline{v}_{1})} = v'_{1}\) and *G* will still be an induced subgraph of *P*^{σ}. After this change \(v'_{1} < \overline{v}_{2} < \cdots <\overline{v}_{1} < \cdots < \overline{v}_{n}\) is the new ordering of *V*(*G*) induced by the ordering of *V*(*P*^{σ}). We repeat the same argument used in the previous case, where \(\overline{v}_{1}\) is equal to \(v'_{1}\) and we conclude the proof. If \(N_{G}[\overline{v}_{n}] = N_{G}[v'_{1}]\), since \(\overline{v}_{n}\) is the left anchor of the natural labeling \(\overline{v}_{n} < \overline{v}_{n-1} <\cdots < \overline{v}_{1}\) of *V*(*G*) induced by the natural ordering \(\overline{u}_{n_{\sigma}} < \cdots < \overline{u}_{1}\) of *V*(*P*^{σ}) then, we can repeat the previous argument for the natural labeling \(\overline{v}_{n} < \overline{v}_{n-1} < \cdots < \overline{v}_{1}\) and so we conclude the proof. □

The Algorithm *CPP* analyzes each vertex of *G* in the ordering returned by Algorithm *Recognize* [3] a single time. In the worst case, the Algorithm *CPP* calls Procedure *SHIFT* for each vertex *v*_{
l
}∈*V*(*G*) only once. Since for each vertex *v*_{
l
} the Procedure *SHIFT* analyzes the set of vertices of *G*_{
l
} at most once, the complexity of the Algorithm *CPP* is \(\mathcal{O}(n^{2})\).