1 Introduction

In general, the concept of adaptive stability for combinatorial optimization problems (COP) comes to the questions: (1) “is it possible to adapt a given optimal solution of a COP to some class of the initial data distortions by means of the fixed adaptation algorithm while preserving the optimality”; (2) “how to describe the distortions that allow such an adaptation”. These questions make practical sense if the complexity of the adaptation algorithm is lower in comparison with the complexity of the solution itself.

As we fix an adaptation algorithm and describe the distortions that may be adapted, adaptive stability approach is in a sense dual to the reoptimization, where the distortion class is fixed and the adaptation algorithm is desired. Reoptimization was widely studied, for example, in Bockenhauer et al. (2008), Ausiello et al. (2010), Zych (2012), Shachnai et al. (2012). There is another interesting approach connected with “universal” solutions, the solutions which (with minor natural adaptations) remain optimal for any problem stated on the subset of the initial data (see, for example, Papadimitriou 1994; Deineko et al. 1998).

These article generalizes the previous work on adaptive stability for the particular COPs and is devoted to the description of the framework which may be applied to a wide variety of COPs. The original results of the paper include the abstract form of the conditions (Sect. 2) and their application (Sect. 4). The short examples given in the course of the article serve the demonstration purpose only, the details on the particular COPs may be found in Ivanko (2012, 2013, 2014, 2014).

2 Abstract combinatorial optimization problem

Below we give the abstract notations supporting the generality of the description with the examples of two structurally different COPs:

  1. 1.

    the traveling salesman problem (TSP) (Gutin and Punnen 2006), where we have \(n\in {\mathbb {N}}\) points, “distance” function \(d{:}\,(\overline{1,n})^2\rightarrow {\mathbb {R}}\) and are interested in the shortest circular path visiting all the points once

    $$ d(\gamma (n),\gamma (1))+\sum _{i=1}^{n-1}d(\gamma (i),\gamma (i+1))\rightarrow \min _{\gamma :\overline{1,n}\leftrightarrow \overline{1,n}}; $$
    (1)
  2. 2.

    the tasks distribution problem (TDP) (Chentsov and Chentsov 2002), where we have \(N\in {\mathbb {N}}\) equal doers, the set of tasks \(K{:}\,0<|K|<\infty \), “difficulty” function \(d{:}\,{\mathcal {P}}(K)\rightarrow {\mathbb {R}}\) and wish to distribute the tasks among the doers minimizing the maximum load:

    $$ \max _{i=\overline{1,N}}\{d(K_i)\}\rightarrow \min _{\sqcup _{i=1}^N K_i=K}, $$
    (2)

    where \(\sqcup _{i=1}^N K_i=K\) is a partition of K into subsets \(\{K_1,\ldots ,K_N\}\).

First, we give some convenient notations and formulate COP in a rather general way. Let us fix a possible data set \(X\) (all the considered cities in TSP or tasks in TDP). For each finite set of initial data \(A\subset X:A\ne \varnothing \) we fix a finite set of feasible solutions \(M_A\ne \varnothing \), which may be constructed using the elements of the initial data set (all possible routes over the cities from \(A\) in TSP; all possible distributions of the elements of \(A\) among the workers in TDP). A cost function \(D\) is defined on the set of all possible feasible solutions:

$$ {\mathcal {M}}\,\triangleq \bigcup _{A\subseteq X} M_A \qquad D{:}\,{\mathcal {M}}\rightarrow {\mathbb {R}} $$

(cost is the sum of the edges weights in TSP or maximum “difficulty” over the distribution’s subsets in TDP). The introduced notations allow to define COP \(Z(A,X,D)\) as

$$ D(\alpha )\rightarrow \min _{\alpha \in M_A}. $$

Let the initial data set \(A\) be the subject to change: \(A\rightarrow A^*\subset X\). In Sect. 3 we consider three types of distortion:

$$ A^* = {\left\{ \begin{array}{ll} A\cup \{z\},&{} z\in X{\setminus} A, \\ A{\setminus} \{s\},&{} s\in A, \\ A{\setminus} \{s\}\cup \{z\} \end{array}\right. } $$

[for example, addition (\(z^+\)), removal (\(z^-\)) or substitution of one city in TSP or one task in TDP]. Hereinafter \(M_{A^*}\) is the corresponding set of the disturbed feasible solutions (for example, routes with a new city or distributions without one of the tasks). For \(B\in \{A,A^*\}\) let \(N_B\) be the set of optimal solutions among \(M_B\):

$$ N_B\,\triangleq\, {\mathop {{\mathrm {Argmin}}}\limits _{\alpha \in M_B}}\, D(\alpha ). $$

Definition 1

(Adaptive stability) Let us fix an adaptive multifunction \({\mathcal {A}}{:}\,M_A\rightarrow {\mathcal {P}}(M_{A^*})\). An optimal solution \(\alpha _0\in M_A\) is adaptively stable or \({\mathcal {A}}\)-stable to the disturbance \(A\rightarrow A^*\), if \({\mathcal {A}}(\alpha _0)\cap N_{A^*}\ne \varnothing \) (see Fig. 1).

Fig. 1
figure 1

Scheme of adaptive stability. The most interesting situation for applications arises when the solution of the problem is NP-hard while the adaptation algorithm is polynomial

Let \(\mathcal {G}\) be a finite set of structural parts (edges in TSP, subsets in TDP) such that all the feasible solutions may be represented (not necessarily injectively) in terms of \(\mathcal {G}\) elements

$$ \theta {:}\,\bigcup _{n=1}^{\infty }\mathcal {G}^n\rightarrow {\mathcal {M}} $$

(in TSP each route is the sequence of its vertices or edges or triplets; in TDP each distribution may be represented by one of possible sequences of its subsets). Usually there are more than one way to define the structural parts within the same COP and each definition induces the corresponding conditions of adaptive stability, chosen according to the research purpose.

Further we introduce and suppose to be nonempty:

  1. 1.

    the set of structural parts which “participate” in representation of at least one of the feasible solutions from \(M_A\):

    $$ G_A\,\triangleq\, \{s\in \mathcal {G}\ |\ \exists\, \alpha \in M_A\ \exists \ (s_1,\ldots , s_k) \in \theta ^{-1}(\alpha )\, \exists\, i\in \overline{1,k}:s_i=s\}\ne \varnothing $$

    (for example, all the edges from \(A^2\) in TSP or all the subsets of \(A\) in TDP);

  2. 2.

    the set of feasible solutions, “containing” the selected structural part

    $$ \forall s\in G_A\ \ M_A^s\,\triangleq\, \{\alpha \in M_A\ |\ \exists \ (s_1,\ldots ,s_k) \in \theta ^{-1}(\alpha )\ \exists\, i\in \overline{1,k}:s_i=s\}\ne \varnothing $$

    (the set of routes with the fixed edge in TSP; the set of distributions containing the fixed subset in TDP).

Let

$$ loc{:}\,G_A\rightarrow {\mathbb {R}} $$

be a local influence of an initial data disturbance on the cost of a feasible solution. For example, for \(z^+\)-TSP, where \(G_A=A^2\):

$$ loc(x,y)=d(x,z)+d(z,y)-d(x,y); $$

for \(z^+\)-TDP, where \(G_A={\mathcal {P}}(A)\):

$$ loc(K)=d(K\cup \{z\}). $$

Let

$$ glob{:}\,\mathcal {G}\times {\mathcal {M}}\rightarrow {\mathbb {R}} $$

be a function “preparing” the cost of a feasible solution to the disturbance [in TSP no preparation is needed and \(glob(s,\alpha )\equiv D(\alpha )\), \(glob\) for TDP will be considered in Sect. 3]. Function \(glob\) does not contain any information about the disturbance, all such information is supported by the function \(loc\).

Finally, we consider a function unifying global and local parts of the disturbed feasible solution

$$ F{:}\,{\mathbb {R}}^2\rightarrow {\mathbb {R}} $$

(summation in TSP and maximum in TDP), which is supposed to be monotonic in its first argument

$$ \forall x_1, x_2, y\in {\mathbb {R}}\ \ (x_1\le x_2)\ \ \Rightarrow \left( F(x_1,y)\le F(x_2,y)\right) . $$
(3)

The following splitting condition reflexes the structure of COPs, which allow uniform application of the adaptive stability conditions considered below.

Splitting condition The completely defined and surjective function \(dis{:}\,G_A\times M_A\rightarrow M_{A^*}\) exists and:

  1. 1.

    \(\forall s\in G_A\ \forall \alpha \in M_A^s\ \ D(dis(s,\alpha ))=F(glob(s,\alpha ),loc(s));\)

  2. 2.

    \(\forall \alpha ^*\in M_{A^*}\ \exists s\in G_A \ \exists \alpha \in M_A^s{:}\,\ \alpha ^*=dis(s,\alpha )\) (surjectiveness).

For \(z^+\)-TSP this condition is rather trivial and means that (1) each route may be disturbed at any edge by insertion of a new city and the resulting cost will be the sum of the original route cost and the cost of the insertion; (2) each disturbed route may be obtained by the insertion of a new city into one of the edges of one the original routes. For other cases of TSP and TDP the condition means almost the same (see Sect. 3; Ivanko 2014).

Definition 1 gives a general idea of adaptation algorithm. Hereinafter in Sect. 2 and in corollary Sect. 3 we restrict \({\mathcal {A}}\) by the following Definition 2. General approach to the application of adaptive stability in the beginning of Sect. 4 will return us to the general definition.

Definition 2

For a problem \(Z(A,D,X),\ A^*\subset X\) and \(\alpha \in M_A\) we restrict the allowed adaptations to the local disturbances of single structural parts:

$$ {\mathcal {A}}(\alpha )\,\triangleq\, \{\alpha ^*\in M_{A^*}\ |\ \exists s\in G_A\ \ (\alpha \in M_A^s) \& (\alpha ^*=dis(s,\alpha ))\}. $$

For \(z^+\)-TSP Definition 2 means that we consider an optimal route adaptively stable, if new city \(z\) may be “inserted” into one of the edges of the original route preserving the optimality of the last (see Sect. 3.1).

The above definitions and conditions outline the set of the problems allowing the application of the conditions considered in the following Theorems 1, 2. Supposedly the proposed scheme may be applied to the problems where dynamic programming is applicable (for example, TSP, knapsack problems, assignment problems, minimum spanning tree, vehicle routing problems, cutting problems).

Finally, we introduce a convenient function \(Glob{:}\,G_A\rightarrow {\mathbb {R}}\), where \(\forall s\in G_A\)

$$ Glob(s)\,\triangleq\, \min \limits _{\alpha \in M_A^s} glob(s,\alpha ), $$

and formulate the theorem, based on Bellman’s principle of optimality (Bellman 1957).

Theorem 1

(Adaptive stability criterion) For the problem \(Z(A,D,X)\) , disturbance \(A^*\subset X\) , structural part \(s_0\in G_A\) and optimal solution \(\alpha _0\in M_A^{s_0}\) the feasible solution \(dis(s_0,\alpha _0)\) is optimal over \(M_{A^*}\) if and only if

$$ D(dis(s_0,\alpha _0))=\min _{s\in G_A}[F(Glob(s),loc(s))]. $$
(*)

Proof

Splitting condition guarantees that \(dis(s_0,\alpha _0)\in M_{A^*}\). First, we show that \((*)\) leads to the optimality of \(dis(s_0,\alpha _0)\). Let us denote the right part of \((*)\) by \((**)\). For each \(\beta ^*\in M_{A^*}\) according to the splitting condition

$$ \exists s'\in G_A,\exists \beta \in M^{s'}_A{:}\,D(\beta ^*)=F(glob(s',\beta ),loc(s')). $$

By virtue of \(F\) monotonicity property:

$$ D(\beta ^*)=F(glob(s',\beta ),loc(s'))\ge F(Glob(s'),loc(s'))\ge (**)=D(dis(s_0,\alpha _0)). $$

Now let us show that the optimality of \(dis(s_0,\alpha _0)\) leads to \((*)\). Since \(G_A\) is finite and nonempty

$$ \exists \widetilde{s}\in G_A{:}\,(**)=F(Glob(\widetilde{s}),loc(\widetilde{s})). $$

The set \(M^{\widetilde{s}}_A\) is also finite and nonempty and so

$$ \exists \widetilde{\alpha }\in M^{\widetilde{s}}_A{:}\,Glob(\widetilde{s})=glob(\widetilde{s}, \widetilde{\alpha }). $$

Considering the last fact, optimality of \(dis(s_0,\alpha _0)\) and splitting condition we have

$$\begin{aligned} (**)& = F(Glob(\widetilde{s}),loc(\widetilde{s}))=F(glob(\widetilde{s}, \widetilde{\alpha }),loc(\widetilde{s}))\\&= D(dis(\widetilde{s}, \widetilde{\alpha }))\ge D(dis(s_0,\alpha _0)). \end{aligned}$$

On the other hand

$$ (**)\le\,F(Glob(s_0),loc(s_0))\le F(glob(s_0,\alpha _0),loc(s_0))=D(dis(s_0,\alpha _0)). $$

\(\square \)

Now let us consider a sufficient condition of adaptive stability. It allows to check “easily” whether it is possible to disturb a known optimal solution “locally”, while preserving its optimality.

The considered sufficient condition relies on the following two constraints:

  1. 1.

    if \(\alpha _0\) is optimal over \(M_A\), then \(\forall s_0\in G_A{:}\,\alpha _0\in M_A^{s_0}, \forall s'\in G_A, \forall \beta \in M_A^{s'}\)

    $$ glob(s_0,\alpha _0)\le glob(s',\beta ); $$
    (4)

    this condition is rather restrictive, but it automatically holds if \(glob(s,\alpha )\equiv D(\alpha )\), which is the case for TSP and more general graph placement problem (Ivanko 2014).

  2. 2.

    another form of monotonicity, introduced instead of condition (3)

    $$ \forall x_1, x_2, y_1, y_2\in {\mathbb {R}}\ \ (x_1\le x_2 \& y_1\le y_2) \Rightarrow (F(x_1,y_1)\le F(x_2,y_2)). $$
    (5)

Theorem 2

(Sufficient condition of adaptive stability) For the problem \(Z(A,D,X)\) , disturbance \(A^*\subset X\) , structural part \(s_0\in G_A\) and optimal solution \(\alpha _0\in M_A^{s_0}\) the feasible solution \(dis(s_0,\alpha _0)\) is optimal over \(M_{A^*}\) if

$$ loc(s_0) = \min _{s\in G_A} loc(s). $$
(***)

Proof

Again, for each \(\beta ^*\in M_{A^*}\) according to the splitting condition \(\exists s'\in G_A, \exists \beta \in M^{s'}_A\):

$$ D(\beta ^*)=F(glob(s',\beta ),loc(s')). $$

By virtue of the condition (4), theorem condition \((***)\) and monotonicity (5) we have

$$ D(\beta ^*)=F(glob(s',\beta ),loc(s')) \ge F(glob(s_0,\alpha _0),loc(s_0)) = D(dis(s_0,\alpha _0)). $$

\(\square \)

If \(|G_A|\) polynomially depends on \(|A|\) (as it happens in graph optimization problems, where \(G_A\) is the set of graph edges) and function \(loc\) may be computed polynomially (which is rather natural, as we try to introduce \(loc\) to be “simple”, “local” function), sufficient condition becomes polynomial. If \(|G_A|\) exponentially depends on \(|A|\) (as it happens in TDP), then the computational complexity of the condition \((***)\) remains exponential.

3 Examples

In this section we consider TSP and TDP adaptive stability conditions in accordance with the scheme of Sect. 2.

3.1 TSP

Let \(X\) be a finite set of possible TSP cities and \(d{:}\,X^2\rightarrow {\mathbb {R}}.\) For each initial set of cities \(S=\{y_1,\ldots ,y_n\}\subset X\) we fix the set of tours (feasible solutions)

$$ M(S)\,\triangleq\, \{(y_{\gamma (1)},\ldots ,y_{\gamma (n)})\ |\ \gamma {:}\,\overline{1,n} \leftrightarrow \overline{1,n}; \gamma (1)=1\}. $$

The length of a circular tour \(\alpha =(x_1,\ldots ,x_n)\in M(S)\) (cost function) is naturally defined as

$$D(\alpha)\,\triangleq\, d(x_n,x_1)+\sum _{i=1}^{n-1}d(x_i,x_{i+1}). $$

A tour \(\alpha _0\in M(S)\) is called optimal over \(M(S)\) if

$$ \alpha _0\in {\mathop {{\mathrm {argmin}}}\limits _{\alpha \in M(S)}}D(\alpha ). $$

For a tour \(\alpha =(x_1\ldots ,x_n)\in M(S)\) we introduce

  1. 1.

    three types of disturbance: addition of a new city \(S\rightarrow S\cup \{z\}\), where \(z\in X{\setminus} S\); deletion of an existing city \(S\rightarrow S\setminus \{x\}\), where \(x\in S\), and substitution \(S\rightarrow (S{\setminus} \{x\})\cup \{z\}\), where \(x\in S\), \(z\in X{\setminus} S\);

  2. 2.

    corresponding adaptations (\({\mathcal {A}}\))

    $$\begin{aligned}Ins(z,x_i,\alpha )&\,\triangleq\, (x_1\ldots ,x_i,z,x_{i+1},\ldots ,x_n)\in M(S\cup \{z\});\\Del(x_i,\alpha )&\,\triangleq\, (x_1\ldots ,x_{i-1},x_{i+1},\ldots ,x_n)\in M(S{\setminus} \{x_i\});\\Mov(z,x_i,\alpha )&\,\triangleq\, (x_1\ldots ,x_{i-1},z,x_{i+1},\ldots ,x_n)\in M((S{\setminus} \{x_i\})\cup \{z\}); \end{aligned}$$
  3. 3.

    the local costs of the disturbances (\(loc\) function) for every \((z,k,x,y)\in X^4\):

    $$\begin{aligned}\triangle _I(z,x,y)&\,\triangleq\, d(x,z)+d(z,y)-d(x,y),\\ \triangle _D(z,x,y)&\,\triangleq\, d(x,y)-d(x,z)-d(z,y),\\ \triangle _M(z,k,x,y)&\,\triangleq\, d(x,z)+d(z,y)-d(x,k)-d(k,y). \end{aligned}$$

We say that an optimal tour \(\alpha _0=(x_1,\ldots ,x_n)\in M(S)\) is adaptively stable to the addition (deletion; substitution) of a city \(z\in X{\setminus} S\) (\(x\in S\); \(x\in S, z\in X{\setminus} S\)) if there exists an element \(x_i\) of \(S\) such that \(Ins(z,x_i,\alpha _0)\) is optimal over \(M(S\cup \{z\})\) (independently of \(x_i\): \(Del(x,\alpha _0)\) is optimal over \(M(S{\setminus} \{x\})\); \(Mov(z,x,\alpha _0)\) is optimal over \(M((S{\setminus} \{x\})\cup \{z\})\)).

One can define another way to adapt an optimal tour to distortions and thus obtain another set of stability conditions. The only requirement for the adaptation algorithm is apparently its low complexity (in comparison with the complexity of finding an optimal solution).

At last we introduce the analogs of \(Glob(s)\):

$$ \mathbf{D}_{(x,y)}(S)\,\triangleq\, \min _{{\alpha \in M_{(x,y)}(S)}}\ D(\alpha ), $$

where

$$ M_{(x,y)}(S)\,\triangleq\, \{(\ldots ,x,y,\ldots )\in M(S)\} $$

and

$$ {\mathbf {D}}_{(x,k,y)}(S)\,\triangleq \, \min _{{\alpha \in M_{(x,k,y)}(S)}}\ D(\alpha ), $$

where

$$ M_{(x,k,y)}(S)\,\triangleq\, \{(\ldots ,x,k,y,\ldots )\in M(S)\}. $$

Corollary 1

(TSP adaptive stability criterion) Let \(\alpha _0=(\ldots ,q,\ldots )\in M(S)\) be an optimal tour and \(z\in X{\setminus} S\), then:

  1. 1.

    tour \(Ins(z,q,\alpha _0)\in M(S\cup \{z\})\) is optimal if and only if

    $$ D(Ins(z,q,\alpha _0))={\mathop {\mathop {\min }\limits _{(x,y)\in S^2}}\limits _{x\ne y}}({\mathbf {D}}_{(x,y)}(S)+\triangle _I(z,x,y)); $$
    (6)
  2. 2.

    tour \(Del(q,\alpha _0)\in M(S{\setminus} \{q\})\) is optimal if and only if

    $$ D(Del(q,\alpha _0))= {\mathop {\mathop {\min }\limits _{(x,y)\in (S{\setminus} \{q\})^2}}\limits _{x\ne y}}({\mathbf {D}}_{(x,q,y)}(S) +\triangle _D(q,x,y)); $$
  3. 3.

    tour \(Mov(z,q,\alpha _0)\in M((S{\setminus} \{q\})\cup \{z\})\) is optimal if and only if

    $$ D(Mov(z,q,\alpha _0))= {\mathop {\mathop {\min }\limits _{(x,y)\in (S{\setminus} \{q\})^2}}\limits _{x\ne y}}({\mathbf {D}}_{(x,q,y)}(S)+\triangle _M(z,q,x,y)). $$

Proposition 1

Asymptotic time complexity of the dynamic programming algorithm that computes the right-hand side of (6) is \(O(n^42^n)\).

Proof

The computation of each \({\mathbf {D}}_{(x,y)}(S)\) is actualy the solution of the corresponding TSP with asymptotic time complexity \(O(n^22^n)\) (Held and Karp 1962). The resulting expression is \(O(n^2)\cdot (O(n^22^n)+O(1))=O(n^42^n+n^2)=O(n^42^n)\). \(\square \)

A single check of condition (6) for one \(z\in X{\setminus} S\) is much more difficult than the direct solution of the corresponding TSP over \(M(S\cup \{z\})\) (as we have to compute \({\mathbf {D}}_{(x,y)}(S)\ \forall (x,y)\in S^2\)). Nevertheless in case of the whole adaptive stability area construction condition (6) may decrease the time complexity significantly (see the example at the end of Sect. 4).

Corollary 2

(TSP adaptive stability sufficient) Let \(|S|\ge 3\) , \(z\in X{\setminus} S\) and \(\alpha _0=(\ldots ,w,q,e,\ldots )\in M(S)\) be an optimal tour, then:

  1. 1.

    tour \(Ins(z,q,\alpha _0)\in M(S\cup \{z\})\) is optimal if

    $$ \triangle _I(z,q,e)={\mathop {\mathop {\min }\limits _{(x,y)\in S^2}}\limits _{x\ne y}}\triangle _I(z,x,y); $$
    (7)
  2. 2.

    tour \(Del(q,\alpha _0)\in M(S{\setminus} \{q\})\) is optimal if

    $$ \triangle _D(q,w,e)={\mathop {\mathop {\min }\limits _{(x,y)\in (S{\setminus} \{q\})^2}}\limits _{x\ne y}}\triangle _D(q,x,y); $$
  3. 3.

    \(Mov(z,q,\alpha _0)\in M((S{\setminus} \{q\})\cup \{z\})\) is optimal if

    $$ \triangle _M(z,q,w,e)={\mathop {\mathop {\min }\limits _{(x,y)\in (S{\setminus} \{q\})^2}} \limits _{x\ne y}}\triangle _M(z,q,x,y).$$

Proposition 2

Asymptotic time complexity of the algorithm that computes the right-hand side of (7) is \(O(n^2)\).

The example of adaptive stability conditions in case of the addition of a new city to TSP is considered carefully in (Ivanko 2014). The more general case of graph placement problem is described in Ivanko (2014).

3.2 TDP

Let \(X\) be a finite set of possible tasks and \(d{:}\,{\mathcal {P}}(X)\rightarrow {\mathbb {R}}^{+}\) is a working time function, where \(d(\varnothing )=0\). Let \(S\subseteq X{:}\,S\ne \varnothing \) be the initial data set and \(N\in {\mathbb {N}}{:}\,1<N\le |S|\) be the number of equal workers (\(d\) does not depend on the worker). For each \(K\subseteq X\) we introduce the set of feasible solutions (distributions)

$$ \begin{aligned} M_N(K)\,\triangleq& \{\{K_1,\ldots ,K_N\}\subseteq {\mathcal {P}}(X)\ |\ \left( \cup _{i=1}^N K_i=K\right) \\ & \& \ (\forall i,j\in \overline{1,N}\ (i\ne j)\Rightarrow (K_i\cap K_j=\varnothing ))\}. \end{aligned}$$

The distribution cost function is defined as follows

$$\begin{aligned}&\forall N\in {\mathbb {N}},\ \forall K\subset X,\ \forall \alpha =\{K_1,\ldots ,K_N\}\in M_N(K) \\&D(\alpha)\,\triangleq\, \max _{i\in \overline{1,N}}d(K_i). \end{aligned}$$

Further we write \(K^x\) to designate a set containing \(x\). For \(x\in S\) and \(\alpha \in M_N(S)\) the adaptations are defined as follows

$$ \begin{aligned}Ins(z,K_i,\alpha )\,\triangleq & {} \{K_1,\ldots ,K_i\cup \{z\},\ldots ,K_N\},\\ Del(x,\alpha )\,\triangleq & {} \{K_1,\ldots ,K^x{\setminus} \{x\},\ldots ,K_N\},\\ Mov(z,x,\alpha )\,\triangleq\, & {} \{K_1,\ldots ,(K^x{\setminus} \{x\})\cup \{z\},\ldots ,K_N\}. \end{aligned}$$

Finally, \(\forall K\subseteq S\) we introduce

$$ {\mathbf {D}}_{N-1}^S(K)\,\triangleq\, \min _{\alpha \in M_{N-1}(S{\setminus} K)}\{D(\alpha )\}. $$

Corollary 3

Let \(\alpha _0=\{K_1,\ldots ,K_N\}\in M_N(S)\) be an optimal distribution, \(z\in X{\setminus} S\) , \(x\in S\) , \(i\in \overline{1,N}\) , then

  1. 1.

    the distribution \(Ins(z,K_i,\alpha _0)\) is optimal over \(M_N(S\cup \{z\})\) if and only if

    $$ D(Ins(z,K_i,\alpha _0))=\min _{K\subseteq S}\left[ \max \{{\mathbf {D}}_{N-1}^S(K),d(K\cup \{z\})\}\right] ; $$
    (8)
  2. 2.

    \(Del(x,\alpha _0)\) is optimal over \(M_N(S{\setminus} \{x\})\) if and only if

    $$ D(Del(x,\alpha _0)) =\min _{K^x\subset S}\left[ \max \{{\mathbf {D}}_{N-1}^S(K^x),d(K^x{\setminus} \{x\})\}\right] ; $$
  3. 3.

    \(Mov(z,x,\alpha _0)\) is optimal over \(M_N((S{\setminus} \{x\})\cup \{z\})\) if and only if

    $$ D(Mov(z,x,\alpha _0))=\min _{K^x\subset S}[\max \{{\mathbf {D}}_{N-1}^S(K^x), d((K^x{\setminus} \{x\})\cup \{z\})\}]. $$

Proposition 3

The asymptotic time complexity of the dynamic programming algorithm that computes the right-hand side of (8) is \(O(\overline{d}2^{2n}+N2^{3n})\) , where \(\overline{d}\) is the upper bound for the number of iterations needed to compute \(d(K)\) over \(K\subseteq S\).

Proof

The computation of \({\mathbf {D}}_{N-1}^S(K)\) is the solution of the corresponding TDP. We will use the following dynamic programming scheme as the solution method

$$\begin{aligned} 1.\quad&\forall K\subseteq S \ \ v_1(K)=d(K);\nonumber \\ 2.\quad &\forall K\subseteq S \ \ v_2(K)=\min _{L\subseteq K}\left( \max \{d(L),v_1(K{\setminus} {L})\}\right) ;\nonumber \\ 3.\quad &\forall K\subseteq S \ \ v_3(K)=\min _{L\subseteq K}\left( \max \{d(L),v_2(K{\setminus} {L})\}\right) ;\nonumber \\ \cdots&\cdots \qquad \cdots \qquad \cdots \qquad \\ N-1)\quad &\forall K\subseteq S \ \ v_{N-1}(K)=\min _{L\subseteq K}\left( \max \{d(L),v_{N-2}(K{\setminus} {L})\}\right) ;\nonumber \\ N)\quad &v_N(S)=\min _{K\subseteq S}\left( \max \{d(K),v_{N-1}(S{\setminus} {K})\}\right) .\nonumber \end{aligned}$$

Time complexity of step 1 is \(O(\overline{d}2^n)\). Every other step implies the computation of \(2^n\) values, each of which in its turn implies the computation of the minimum function over at most \(2^n\) subsets. The resulting complexity of the above algorithm is \(O(\overline{d}2^n)+(N-1)O(2^n) O(2^n)=O(\overline{d}2^n+N2^{2n})\).

The computation of the right-hand side of (8) involves \(2^n\) computations of the three functions: \({\mathbf {D}}_{N-1}^S(K)\) (time complexity \(O(\overline{d}2^n+N2^{2n})\)); \(d(K\cup \{z\})\) (complexity \(O(\overline{d})\)) and \(\max \) function (complexity \(O(1)\)). The final expression is \(2^n(O(\overline{d}2^n+N2^{2n})+O(\overline{d})+O(1))=O(\overline{d}2^{2n}+N2^{3n})\). \(\square \)

The sufficient conditions for adaptive stability in TDP according to the scheme of Theorem 2 have a high computational complexity (comparable to the solution of the original TDP problem) and thus are not given here, but the reader can easily construct them basing on Theorem 2 and example of Corollary 2).

4 Adaptive stability in practice

The stability under the possible future distortions of the initial data set intuitively corresponds to the “generality”, the degree in which the obtained optimal solution reflects the inner nature of the model under investigation. Namely, if our optimal solution does not lose its optimality (needs only minor corrections) in case of the appearance of new data, we may suppose our solution reflects some general law. It seems to be natural to prefer such “general” solutions among the set of optimal solutions with equal cost function.

Another case where the adaptive stability may help to make a decision is the comparison of different mathematical models. Usually, different models possess different structure of feasible solutions with different cost functions. Each model results in at least one optimal solution and there is no direct way to compare the obtained solutions. Comparison of “generality” (expressed as the size or “weight” of adaptive stability area) of the solutions corresponding to different models may be the key to the preference among the models lying behind the solutions.

There are similar statistical approaches to the selection of the solutions in accordance with their stability to the changes of the initial data: jackknife resampling and more progressive bootstrapping (Efron 1979). The main difference between the bootstrapping technique and the proposed adaptive stability approach is the “direction”. While bootstrapping estimates the structural stability of a more narrow, in a sense, problem, adaptive stability on the contrary considers the problem with the extended initial data.

Let us fix a “weight” function

$$ p{:}\, X\rightarrow {\mathbb {R}} $$

to measure the “chance” of each element \(x\in X\) to appear in the initial data set. Function \(p\) may contensively be restricted to probability, but formally we do not assume any restrictions and consider \(p\) as an arbitrary function.

Suppose the problem \(Z(A,D,X)\) has several optimal solutions

$$ \{\alpha _0^1,\ldots ,\alpha _0^m\} = N_A\subseteq M_A. $$

Definition 3

The addition stability area of an optimal solution \(\alpha _0\in M_A\) of the problem \(Z(A,D,X)\) is defined as

$$ O(\alpha _0) \,\triangleq\, \{x\in X{\setminus} A\ |\ a_0\ \text {is}\ {\mathcal {A}}\text {-stable to}\ A\rightarrow A\cup \{x\}\} $$
(9)

Figure 2 gives an example of addition stability area in TSP.

Fig. 2
figure 2

Example of addition stability area for TSP drilling problem (Tsplib 2014) with integer-valued rounded down Euclidean distance function (computed by Concorde TSP Solver Concorde 2014), see (Ivanko 2014)

Definition 4

The weight of an optimal solution is defined as

$$ P(\alpha _0) = \sum _{x\in O(\alpha _0)}p(x) $$
(10)

As we discussed in the beginning of this section, a relatively large adaptive stability area of the solution shows that this solution is not only optimal for the current initial data, but probably will remain optimal in the future when new data will be available. According to this argument, we propose to prefer the “heaviest” optimal solutions (see Fig. 3):

$$ {\mathop {{\mathrm {Argmax}}}\limits _{\alpha _0\in N_A}} \,P(\alpha _0) $$
(11)
Fig. 3
figure 3

The summary "weight" of the stability area “around” the optimal solution \(\alpha _0^1\) exceeds the corresponding “weight“ of \(\alpha _0^2\), thus we have a natural reason to prefer \(\alpha _0^1\)

Let us consider a simple example vaguely reminiscent of the computer processor. Suppose we have a number of operations to proceed: \(A=\{1,\ldots ,n\}\). Each operation \(i\) has its start \(s(i)\) and terminal \(t(i)\) states. There is a known cost \(d{:}\,\overline{1,n}^2\rightarrow {\mathbb {R}}\) for the processor to change its state from \(t(i)\) to \(s(j)\) for each pair \(i,j\in \overline{1,n}\) (to get ready for operation \(j\) after operation \(i\) is finished). The purpose is to assign the operations in a simple cycle \(\gamma _0{:}\,\overline{1,n}\leftrightarrow \overline{1,n}\) minimizing the total processing time:

$$ d(\gamma (n),\gamma (1))+\sum _{i=1}^{n-1} d(\gamma (i),\gamma (i+1))\rightarrow \min _{\gamma {:}\,\overline{1,n}\leftrightarrow \overline{1,n}}. $$

We assume that time is important as the resulting sequence will be repeated constantly during for a considerable time. It is a typical TSP problem; let \(N_A=\{\alpha _0^1,\ldots ,\alpha _0^k\}\) be the set of its known optimal solutions.

Let us suppose the processor may be distracted from its optimal cycle and may respond to a single urgent operation \(z\in Z\,\triangleq\, \overline{n+1,n+m}\) (caused, for example, by hardware or software interrupt), embedding it between two consequent operations of the optimal cycle (not permanently, just for the current loop). Let \(p(i)\) be the probability of appearance of operation \(i\in Z\). The stability area of each optimal cycle here consists of the operations from \(Z\) that may be inserted into the cycle

$$ O(\alpha _0^j)=\{z\in Z\ |\ \exists i\in \overline{1,n}{:}\,Ins(z,i,\alpha _0^j)\ {\text {is}}\, {\text {optimal}}\}. $$

The “weight” of each solution \(\alpha _0^j\) is the “weight” of its stability area \(P(\alpha _0^j)\) [see (10)].

In this situation we may be interested in the selection of the optimal cycles from \(N_A\) posessing the largest “weight” [constructuion of (11)], because they will most likely remain optimal in the case of insertion of a new unexpected operation. The construction of the stability area for each \(\alpha _0\in N_A\) is the most computationally difficult step in the construction of the set of preferred solutions (11). Let us show how Theorem 1 may help to decrease the complexity. The simple direct algorithm for adaptive stability area construction for one known solution may be written as follows.

Algorithm 1

Let \(\alpha _0\in M(\overline{1,n})\) be a known optimal solution. For each \(z\in Z\)

  • solve TSP with initial data \(\overline{1,n}\cup \{z\}\) to find its optimal cost \({\mathbf {D}}_0\);

  • \(z\in O(\alpha _0)\) iff \(\exists i\in \overline{1,n}{:}\,D(Ins(z,i,\alpha _0))={\mathbf {D}}_0\).

This algorithm implies the solution of \(|Z|\) TSP problems. Corollary 1 gives another way to construct the adaptive stability area of a solution.

Algorithm 2

Let \(\alpha _0\in M(\overline{1,n})\) be a known optimal solution. For each \((x,y)\in \overline{1,n}^2{:}\,x\ne y\)

  • solve TSP to find \({\mathbf {D}}_{(x,y)}(\overline{1,n})\).

For each \(z\in Z\)

  • \(z\in O(\alpha _0)\) iff \(\exists i\in \overline{1,n}:\)

    $$ D(Ins(z,i,\alpha _0))={\mathop {\mathop {\min }\limits _{(x,y)\in \overline{1,n}^2}}\limits _{x\ne y}}({\mathbf {D}}_{(x,y)}(\overline{1,n})+\triangle _I(z,x,y)). $$

There are \(n^2\) TSP problems to solve in the first part of Algorithm 2. After that the second part becomes computationally easy (\(n^2\) summations and comparisons). Thereby if \(|Z| \gg n^2 \), Algorithm 2 is preferable.

5 Conclusion

The notion of adaptive stability, as it was given in Definitions 1,2, is fully dependent on the notion of structural part. If the optimization problem is NP-hard, but the power of \(G_A\) polynomially depends on the power of \(A\) and \(loc\) function is polynomial-time computable function, the Theorem 1 gives a polynomial instrument for post-optimal analysis (and for the construction of the corresponding stability areas). Indeed, if \(\forall s\in G_A \) values \(Glob(s)\) are given by oracle for free, then the conditions of Theorem 1 may be checked polynomially. Such situation is typical for TSP and for almost every COP on a graph, where structural parts are naturally associated with the graph edges [see, e.g. (Ivanko 2014)]. It is interesting to note that for TSP knowledge of all optimal solutions does not make reoptimization analysis easier (Böckenhauer et al. 2011), however knowledge of some (not necessarily optimal, but in a manner ”good“) solutions in form of \({\mathbf {D}}_{(x,y)}(S)\) may help.

Among the particular applications of the described technique there are many real problems, where more than one mathematical model and more than one optimal solution is probable to appear: taxonomy trees reconstruction, communication networks building (roads, pipes, wire nets), tasks distribution and instruction pipelines optimization.

There are quite many approximation problems connected with the notion of adaptive stability. This area will be the subject of future research.