## 4 Centralized optimization approach for the system reconfiguration  
This algorithm requires a dedicated decision making body in the system, the _Reconfiguration_ denoted as \(R\). This _Reconfiguration_ will collect information about the current state of the system - \(X\), current requirements - \(Y\), and generate a reconfiguration request to the system - \(U\). Thus, discrepancy between the desired and actual state of the system is acceptable (Figure 4). Figure 3: Possible states of a system of three components \(A\), \(B\), \(C\); \"–” stands for empty set with no active components. \(Q\) is the quality criterion that will be minimized by \(R\) during the search for an optimal configuration of system \(S\). \(Q=\mid\) _( \(F-\Phi\) ) + \(P\mid\)_, where \(\Phi\) is a vector of functions provided by \(S\) in state \(X\). \(F\) is a vector of functional requirements at moment \(t_{j}\); it is derived from \(Y\). \(P\) is the cost for the system to be in the current state \(X\)(\(t\)). The detailed description of the criterion and its properties is provided in [3]. For estimation the \(P\), part of \(Q\), the _Reconfiguration_ needs to have an access to the components' profile. The profile includes parameters such as provided functionality by the component, the required resources, and the operational requirements. The _Reconfiguration_ searches the configuration of system \(S\) that will provide a minimal value of the criterion \(Q\). The search of the optimal configuration can be based on a number of search algorithms, for instance on the A* algorithm [24] with the optimality criterion \(Q\) as the heuristic function. For illustrative purposes, we provide the algorithm description (Figure 5):  
_Step 1._ Take the current node of the configuration search graph, calculate \(Q\) and move the node to the list \"Open\". _Step 2._ If \"Open\" is empty, then the algorithm ends and generates an exception of no solution having been found, otherwise to Step 3. Figure 4: Feedback controlled system. \(R\) (_Reconfiguration_) is a decision making body or controller. \(U\) is a control signal generated by \(R\). Figure 5: Search of the optimal configuration. \(S\)=_(C)_ is the initial configuration with quality criterion \(Q\)=15 and \(S\)=_(ABC)_ is the goal state with \(Q\)=4. Bold circles stand for current (C) and future (ABC) configurations. _Step 3._ Select a node with the smallest value of \(Q\) from the list \"Open\" and move node \"Current\" to the list \"Closed\". _Step 4._ If the \"Current\" node is good enough, then the algorithm ends (\"End\"), providing the solution as a set of pointers from \"Current\" node to \"Initial\" node, otherwise go to Step 5. _Step 5._ Take the node \"Current\" and build all child nodes. If no child nodes can be built, then go to Step 2. otherwise go to Step 6 (the reconfiguration graph is building dynamically). _Step 6._ Estimate \(Q\) for all of child nodes of \"Current\", move them to the list \"Open\", and build the pointers from them to the parent node \"Current\". Go to Step 2. As a result of the algorithm execution at the time \(t_{j}\), we acquire:  
* optimal (with minimal \(Q\)) configuration of S at the moment \(t_{j}\)
* set of reconfiguration steps that will be taken for reaching optimal configuration. The described approach employs system adaptation with architectural support [25]. The key idea is to have a dedicated decision making unit that manages the system configuration, which consists of a few fairly simple components. However, the solution based on this idea lacks scalability. The _Reconfiguration_ becomes a performance bottleneck when there is a large number of system components and high level of system dynamics. In the worst case scenario, the computational complexity of the presented search algorithm increases exponentially [24].