Timeoptimal control of largescale systems of systems using compositional optimization
 251 Downloads
Abstract
Optimization of industrial processes such as manufacturing cells can have great impact on their performance. Finding optimal solutions to these largescale systems is, however, a complex problem. They typically include multiple subsystems, and the search space generally grows exponentially with each subsystem. In previous work we proposed Compositional Optimization as a method to solve these type of problems. This integrates optimization with techniques from compositional supervisory control, dividing the optimization into separate subproblems. The main purpose is to mitigate the state explosion problem, but a bonus is that the individual subproblems can be solved using parallel computation, making the method even more scalable. This paper further improves on compositional optimization with a novel synchronization method, called partial timeweighted synchronization (PTWS), that is specifically designed for timeoptimal control of asynchronous systems. The benefit is its ability to combine the behaviour of asynchronous subsystems without introducing additional states or transitions. The method also reduces the search space further by integrating an optimization heuristic that removes many nonoptimal or redundant solutions already during synchronization. Results in this paper show that compositional optimization efficiently generates global optimal solutions to largescale realistic optimization problems, too big to solve when based on traditional monolithic models. It is also shown that the introduction of PTWS drastically decreases the total search space of the optimization compared to previous work.
Keywords
Largescale optimization Discrete event systems State explosion problem Timeoptimal control Compositional optimization1 Introduction
Autonomous systems are becoming more and more important in society and especially in industry. This applies also to manufacturing industry, where the level of automation is continuously increasing. The goal is to enable systems, also referred to as plants, to take independent decisions within an often unstructured and complex environment, in order to reduce the need of human intervention. To reach this goal, new and fast methods for largescale optimization that can incorporate all available information must be developed.
Modelling manufacturing systems as discrete event systems (DES) (Cassandras and Lafortune 2008) allows for verification and synthesis using formal methods, such as supervisory control theory (SCT), first defined by Ramadge and Wonham (1987) and Ramadge and Wonham (1989). However, verification and control of discrete systems are related to combinatorial optimization, and the algorithms suffer from the wellknown state explosion problem, also called the curse of dimensionality (Gass and Fu 2013; Valmari 1998). Wong and Wonham (1998) showed that this can be mitigated to some extent by modular or compositional algorithms when the system is separable into subsystems (system of systems). It has been shown in later work by Flordal and Malik (2009) and Mohajerani et al. (2014) among others that compositional supervisory control can efficiently synthesize controllers for largescale systems.
The downside of SCT for autonomous systems is that most work focuses on maximally permissive control synthesis for a given set of specifications (Cassandras and Lafortune 2008, chap. 3). The controller should ensure that something bad never happens. This is useful when the plant is operated by an external controller or human operator. An autonomous system needs a controller that can take good decisions, in order to eventually let the system reach a predefined goal state. This requires that the model is extended with a cost function that defines the notion of good. The controller should then reach the goal as cheap as possible, which constitutes an optimization problem.
A wide range of efficient methods for solving these specific type optimization problems have been explored over the years. There are a using a wide range of different optimization techniques. For further references we recommend Passino and Antsaklis (1989), Brandin and Wonham (1994), Huang and Kumar (2008), Kobetski and Fabian (2009) and Hagebring et al. (2016). Many of them have been proven efficient with respect to computational complexity and typically scales polynomially with the size of the system. Moreover, the type of problems that is addressed can typically be perceived to relate directly to other large field of optimization research such as planning and scheduling. For example, MDP theory, which is the most basic modeling tool for stochastic scheduling, is claimed in the textbook by Cassandras and Lafortune (2008) as a formal DES framework. Regardless of the modelling tool or the solution method, all suffer from the state explosion problem. The problem of addressing this problem have of course been investigated in a large number of publications. For further references we recommend Powell (2007), Cao X (2007), Bertsekas and Tsitsiklis (1996) and Bertsekas (2005).
However, to the best of our knowledge, none of these methods offers a generalized compositional optimization approach, which means that they all have to consider the full search space of the monolithic system. It is not enough with methods that scales polynomially with the size of the system if the system itself scales exponentially with the number and size of its subsystems. The problem with modular or compositional methods in optimization is that there is not enough information locally to fully optimize the subsystem and still guarantee a global optimal solution. In recent years, related work has been presented by other groups on modular or compositional methods. Particularly interesting are the works done by Hill and Lafortune (2016, 2017), Su (2012a) and Ware and Su (2017). The latter are closely related to the work presented in this paper, where they propose a compositional method for synthesis of a timeoptimal controller. The techniques are, however, either restrictive in their reduction of the subsystems or offer only approximative solutions. We claim that the work presented in this paper offers a stronger mitigation of the state explosion, while still generating global optimal solutions.
In Hagebring and Lennartson (2018) we presented a general formulation of a compositional optimization method for system of systems, hereinafter called CompOpt. This method integrates techniques from compositional supervisory control with traditional graph based search algorithms. Its strength comes from the ability to reduce the state space of each subsystem individually by exploiting their local behavior, mitigating the state explosion that otherwise would occur during synchronization. It was shown that CompOpt drastically reduced the search space during the optimization of a realistic largescale example and, hence, improved the computational complexity. Dividing the optimization into multiple independent subproblems also allows for a parallel computation of their solutions. The scalability gained by this is considered an important property of CompOpt. Yet, the added benefit of parallelization has not been included in the evaluation of this paper. Instead it is left to be investigated in future research.
There are several industrial applications where an optimization using CompOpt may be beneficial. This paper provides examples both from logistics, in the motivating example of Section 3, and manufacturing industry, in the largescale examples of Section 6. The general formulation of CompOpt does, however, enable it to optimize any system of systems as long as these can be modelled using weighted automata, such as in these examples. These type of systems can be found in a wide range of applications and are in no way restricted to only the traditional areas of industrial automation.
One of the main limitation of the previous implementation of CompOpt was the decrease in computational performance when dealing with timeoptimal control. This was caused by the nontrivial task of modelling the parallel execution of subsystems. Yet, this type of timeweighted systems is one of the most common applications, e.g. minimizing cycle time of a production cell. Optimization of industrial processes usually consider time as the main cost when improving productivity. Similarly to Ware and Su (2017), the previous implementation of CompOpt used tick automata (Gruber et al. 2005) during the synchronization of timeweighted systems. The problem with this is that the technique includes a discretization of the time line, which increases the search space and reduces the overall efficiency. There exists a wide variety of other modelling tools specifically designed for timeweighted systems, the most well known probably being Timed Automata (Alur and Dill 1994). Another modelling technique, called timeweighted automata, proposed by Su et al. (2012b), is quite similar to the weighted automata used in this paper. However, all these modelling techniques add additional information and restrictions to the models. This is required to explicitly represent the full synchronous composition of the timeweighted system. Fortunately, we show in this paper that CompOpt does not require a full synchronous composition.
In this paper we improve on CompOpt by proposing a novel and efficient synchronization method for timeweighted systems, called partial timeweighted synchronization (PTWS). PTWS is able to synchronize the parallel behaviour of timeweighted subsystems without adding any additional states or transitions to their models. The key to this method is the integration of an optimization heuristic that, similarly to the local optimization, reduces the state space of the synchronous composition by removing nonoptimal or redundant solutions, while maintaining the global optimal solution. We show in this paper that this further improves the efficiency of CompOpt by strengthening the mitigation of the state explosion problem. The addition of PTWS does not change the main process of CompOpt, it only extends the method with a more efficient synchronization of the subsystems.
The paper is organized as follows. In Section 2 the basic notation and preliminaries are introduced. A motivating example of a logistics system is presented in Section 3, illustrating the impact of the state explosion problem and the benefit and challenges of using a compositional optimization approach. Section 4 gives an introduction to compositional optimization in general and defines the theory behind CompOpt. Section 5 presents PTWS, the integrated optimization and synchronization method that is the main contribution of this paper. In Section 6 we illustrate the potential of CompOpt and especially highlights the improvements gained by PTWS compared to previous work. Finally, Section 7 concludes the paper.
2 Preliminaries
Discrete event systems are modelled in this paper as nondeterministic finite automata (NFA), defined by a 5tuple \(G = (Q, {\Sigma }, \rightarrow , q_{0}, Q_{m})\), where Q is a set of states, Σ is a finite set of events, \(\rightarrow \subseteq Q \times {\Sigma } \times Q\) is a transition relation, where \(q \xrightarrow []{\sigma } q^{\prime } \in \rightarrow \) denotes the transition from the source state q with the event label σ to the target state \(q^{\prime }\), q_{0} ∈ Q is the initial state and \(Q_{m}\subseteq Q\) is a set of marked states. \({\Sigma }(q)={\{\sigma \in {\Sigma } \mid (\exists q^{\prime }\in Q) q\xrightarrow {\sigma }q^{\prime } \in \rightarrow \}}\) is the active set of events in state q.
A state q is reachable if there exists a path ρ ∈Paths(q_{0}, q) going from the initial state q_{0} to the state q, and q is coreachable if there exists an accepting path ρ ∈Paths(q, Q_{m}) starting in the state q. States that are coreachable are said to be nonblocking, since the system can reach a marked state from these states, the opposite being blocking states. An automaton G is said to be trim if all states are both reachable and coreachable. The notion of subautomaton \(G^{\prime } \subseteq G\) means that \(Q^{\prime } \subseteq Q\), \({\Sigma }^{\prime } \subseteq {\Sigma }\), \(q_{0}^{\prime } = q_{0}\), \(Q_{m}^{\prime } \subseteq Q_{m}\) and \(q_{1} \xrightarrow []{\sigma } q_{2} \in \rightarrow ^{\prime }\) implies \(q_{1} \xrightarrow []{\sigma } q_{2} \in \rightarrow \) for all \({q_{1},q_{2} \in Q^{\prime }, \sigma \in {\Sigma }^{\prime }}\).
When applying compositional synthesis to a system of systems, the events of each subsystem can be divided into local and shared events, where local events appear only in one single subsystem, while shared events appear in at least two subsystems. Given a system of systems \(\textbf {G} = \{G_{1},\dotsc ,G_{n}\}\), the local events of each subsystem G_{i} ∈G is \({{\Sigma }_{i}^{l}} = \{\sigma \in {\Sigma }_{i} \mid \sigma \notin {\Sigma }_{j}, \forall j \in [1,n]\setminus \{i\}\}\). The shared events is the complement of the local events, \({{\Sigma }_{i}^{s}} = {\Sigma }_{i} \setminus {{\Sigma }_{i}^{l}}\). A transition labeled by a shared or a local event is referred to as a shared or a local transition, respectively. A path that only includes local transitions are referred to as a local path.
2.1 Weighted automata
To represent the costs of a system we introduce the notion of weighted automata. In contrast to a standard automaton, a weighted automaton is a 6tuple \(G=(Q,{\Sigma },\rightarrow ,q_{0},Q_{m},c)\) extended with the cost function \(c : (q_{1},\sigma ,q_{2}) \rightarrow \mathbb {R}^{+}\), where q_{1}, q_{2} ∈ Q, σ ∈Σ, \(q_{1} \xrightarrow {\sigma } q_{2} \in \rightarrow \) and \(\mathbb {R}^{+}\) denotes the set of positive reals. The function defines a unique cost associated with traversing each transition in the automata. It is also extended to cover paths such that c(ρ) gives the total cost of all transitions in path ρ. To simplify notation, we write weighted transitions as \(q_{1} \xrightarrow []{\langle \sigma ,w \rangle } q_{2}\) where w = c(q_{1}, σ, q_{2}).
3 Motivating example
The figure shows the two trucks and there respective zone. In the center of the area there is a warehouse, which is where the trucks must start and end each day. The figure also includes an example of a scenario where nine packages should be picked up and delivered during the day. The pick up and delivery location of these packages are marked with dots on the map, where the labels iP and iD represent the pick up and delivery locations of package i respectively. Some packages should be picked up in one zone but delivered in another. In these cases the truck that picks up the package has to bring it back to the central warehouse where it can be moved over to the delivery truck. These type of switches between the trucks are assumed to occur only once a day. The weights to be considered by the cost function should in this case represent the time it takes to perform each task. The tasks include the pick up and delivery of packages, as well as the travel between these locations.
To evaluate the example, the scenario from Fig. 1 is modelled as a system of systems, using plant models for each truck and specifications for each package to represent the subsystems, such as shown in Figs. 2 and 3. Any optimization applied using a monolithic approach would have to consider a search space spanning the complete synchronized behavior of all subsystems. This is true regardless of the optimization paradigm that is used. Advanced paradigms, such as MILP, CP, might be able to perform clever pruning of the search space in an early stage, but initially all possible combinations of states and transitions have to be considered. This is a potential problem since the size of the search space grows exponentially, due to the state explosion problem. The search space of the simple example shown here includes 342,144 states and 6,329,115 transitions, representing the synchronous composition of all subsystems.
When solving the same example using CompOpt, the optimization problem is partitioned into multiple subproblems but the sum of states in the search spaces of all subproblems combined only adds up to 16,396 states. The reason that CompOpt is able to perform so much better than the monolithic approach is the ability to reduce the subsystems even before they are synchronized. The full search space is never computed, no unnecessary states have to be pruned away or evaluated. It is worth noting that CompOpt only represents one specific compositional approach, which most certainly can be further enhanced, but the purpose of this example is just to illustrate that there is much to gain from the ability to optimize systems of systems compositionally.
One could argue that there might exist more efficient models of this system than what is shown here. To a human it is for example obvious that the trucks can be partially optimized individually, since they drive in separate areas, have separate lists of tasks and so on. It is, however, not obvious exactly how this problem can be partitioned since there still exist dependencies between the trucks. Without digging into the details of exactly which tasks that can be considered local, there is no way to partition this problem manually. One benefit of using CompOpt is that it reduces the need of smart manual partitioning of the optimization problem, since it already exploits the local behavior of the subsystems.
4 Compositional optimization
Compositional optimization is in this paper proposed as an appealing approach for the optimization of largescale system of systems. The reason is that it potentially can reduce the state explosion problem, which otherwise occur during the synchronization of these systems of systems. The basic concept behind compositional optimization is to find a global optimal solution to a system of systems by combining the subsystems compositionally into larger and larger models, while performing local (partial) optimization on each model individually. In this case global optimality refers to a global plan or schedule that, when executed, lets the whole system, including all subsystems, transcend from the initial state to a predefined goal state, while minimizing the total cost of performed tasks.
The basic idea in CompOpt is: (i) to use a local optimization algorithm to compute minimal reductions of each subsystem, called locally optimal reductions, (ii) synchronize a subset of those locally optimal reductions incrementally to fewer but larger components that include an increasingly larger part of the full system behaviour, (iii) iterate steps (i)(ii) to further reduce and combine the larger components until only one component remains. The final component will, by construction, be the global optimal solution to the system. In this way the solution is found without considering the full monolithic model at any step.
The key is the local optimization that enables a reduction of each subsystem individually, while still maintaining global optimality. This optimization does, however, suffer from a major limitation that restricts the potential of the approach. In a system of systems, there are typically dependencies between the subsystems. In CompOpt this is caused by shared events between the subsystems. There is no guarantee that the quickest or cheapest sequence of transitions in an individual subsystem is part of the quickest or cheapest sequence of transitions for the whole system. Choosing a specific path in one subsystem can affect other subsystems. In worst case it can block all further actions in another subsystem, making the system unable to reach the goal. In fact, when considering a single subsystem, there is typically not enough information available about these dependencies to prove any unique local path to be optimal for the global system. The local optimization is instead limited to a partial optimization of the subsystems, optimizing only those parts that has no external dependencies. This way it may still reduce the state space of the subsystems and, hence, mitigate the state explosion problem. The main challenge then becomes to identify these independent parts and to reduce these maximally.
The formal definition and properties of local optimization and the implementation of a compositional algorithm is explained in detail in the following sections.
4.1 Local optimization of subsystems
Local optimization defines the process of computing a locally optimal reduction\(G^{\prime }\) of a subsystem G. That is, \(G^{\prime } \subseteq G\) is a reduction of G including only states and transitions that is required in order to guarantee a global optimal solution of the monolithic system. In contrast to the maximally permissive supervisors that is the focus of SCT, a locally optimal reduction can be seen as a minimally permissive or maximally restrictive supervisor that satisfies the specification that all potentially optimal behavior should be maintained. In some cases where it is clear from the context, we use \(G^{\prime }\) also to denote a locally optimal reduction that has been abstracted, such as in the example in Fig. 4.
Since the local optimization considers each subsystem individually, this implicitly requires that the reduction does not modify any of the nonblocking shared behavior of the subsystem. For example no shared transitions from which a marked state can be removed. Doing so might cause a suboptimal solution or even a blocking of another subsystem. What can be reduced using local optimization is redundant local paths. If there exist two local paths ρ_{1}, ρ_{2} ∈Paths(q_{1}, q_{2}) between any pair of states q_{1}, q_{2} ∈ Q, they can be considered redundant and the optimization is free to remove the path with highest cost, or either one if their cost is equal. Additionally, all states that are not reachable or coreachable can also be safely removed since they can not be part of any optimal solution. The reduction can be considered locally optimal when it is trim and a maximum of one such local path remains between any two pair of states.
It is worth mentioning that the locally optimal reduction of a given automaton is not always unique. These may be multiple redundant solution to the local optimization. However, it is proven below that any locally optimal reduction satisfy the required properties of global optimality and minimally permissive.
The aforementioned properties can be summarized in the following definition.
Definition 1
 1.
\(G^{\prime }\) is trim
 2.
For all accepting paths ρ ∈Paths(q_{0}, Q_{m}) in G, there exists an accepting path \(\rho ^{\prime } \in \text {Paths}(q_{0}^{\prime },Q_{m}^{\prime })\) in \(G^{\prime }\) such that: \(P_{{\Sigma } \xrightarrow {} {\Sigma } \setminus {\Sigma }^{l}}(\rho ) = P_{{\Sigma } \xrightarrow {} {\Sigma } \setminus {\Sigma }^{l}}(\rho ^{\prime }) \wedge c^{\prime }(\rho ^{\prime }) \leq c(\rho )\)
 3.
\(\left \{\rho \in \text {Paths}(q_{1},q_{2}) \mid \rho \ \text { is local} \}\right  \leq 1, \quad \forall q_{1}, q_{2} \in Q^{\prime }\)
Note that the first part of the conjunction in point 2 of Def. 1 defines, for all accepting paths ρ ∈Paths(q_{0}, Q_{m}) in G, the existence of an accepting path \(\rho ^{\prime } \in \text {Paths}(q_{0}^{\prime },Q_{m}^{\prime })\) in \(G^{\prime }\), such that a projection of \(\rho ^{\prime }\) that only considers the set of shared events equals corresponding projection of ρ. From this we can infer that the nonblocking shared behavior of \(G^{\prime }\) equals that of G. Point 3 prevents redundant paths in the reduction by allowing a maximum of one local path between any two states q_{1}, q_{2} in the reduction \(G^{\prime }\).
Based on Def. 1 we can formulate two theorems: Theorem 1 stating that any locally optimal reduction maintains the global optimal solution and Theorem 2 stating that the reduction is minimal.
Theorem 1
Given a weighted automaton G = G_{1} ∥ G_{2} representing a system of systems, let \(G^{\prime } = G_{1}^{\prime } \parallel G_{2}\) where \(G_{1}^{\prime }\) is the locally optimal reduction of the subsystem G_{1}. Then, the global optimal solution of G is also available in \(G^{\prime }\), i.e. for all accepting paths ρ ∈Paths(G) there exists an accepting path \(\rho ^{\prime } \in \text {Paths}(G^{\prime })\) such that \(c^{\prime }(\rho ^{\prime }) \leq c(\rho )\).
Proof
Since G_{2} remains untouched we can infer that the specific sequence that corresponds to the global optimal solution has been removed during the reduction of \(G_{1}^{\prime }\), i.e. the shared behaviour of the subsystem has changed. This, in turn, requires that the subsystem \(G_{1}^{\prime }\) fulfills one of two properties: (i) a shared transition has been removed from \(G_{i}^{\prime }\) blocking the global optimal solution in the synchronization, i.e. there exists an accepting path ρ ∈Paths(G_{1}) that has no matching accepting path \(\rho ^{\prime } \in \text {Paths}(G_{1}^{\prime })\) that fulfills \(P_{{\Sigma } \xrightarrow {} {\Sigma } \setminus {\Sigma }^{l}}(\rho ) = P_{{\Sigma } \xrightarrow {} {\Sigma } \setminus {\Sigma }^{l}}(\rho ^{\prime })\), (ii) at least one local path leading between the shared transitions or marked states in \(G_{1}^{\prime }\) are suboptimal. Both of these properties directly violates point 2 of Def. 1, (i) since the definition explicitly requires the existence of an accepting path \(\{\rho ^{\prime } \in \text {Paths}(q_{0}^{\prime },Q_{m}^{\prime }) \mid P_{{\Sigma } \xrightarrow {} {\Sigma } \setminus {\Sigma }^{l}}(\rho ) = P_{{\Sigma } \xrightarrow {} {\Sigma } \setminus {\Sigma }^{l}}(\rho ^{\prime })\}\), for all ρ ∈Paths(q_{0}, Q_{m}), and (ii) since a suboptimal local path would violate part two of the conjunction, \(c(\rho ^{\prime }) \leq c(\rho )\). This proves that Theorem 1 holds by definition for any locally optimal reduction. □
Remark 1
It is important to note that we use natural projection to compare only the shared behavior of the reduction, the theorem full behavior of \(G^{\prime }\) does not have to be a projection of G, i.e. the reduction does not necessarily handle all local transitions equally even if they have the same event, there might exist two local transitions with the same event where one is removed an the other is kept.
Using Theorem 1, we can also induce that the global optimal solution is preserved also when \(G^{\prime \prime } = G_{1}^{\prime } \parallel G_{2}^{\prime }\), where both subsystems has been replaced by their locally optimal reductions. Since the synchronous composition is commutative (Cassandras and Lafortune 2008, chap. 2.3), we know that \(G^{\prime } = G_{1}^{\prime } \parallel G_{2} = G_{2} \parallel G_{1}^{\prime }\). Theorem 1 then states that the global optimal solution of \(G^{\prime } = G_{2} \parallel G_{1}^{\prime }\) is also available in \(G^{\prime \prime } = G_{1}^{\prime } \parallel G_{2}^{\prime }\). This proves that the global optimal solution is unaffected when combining the subsystems compositionally. However, Theorem 1 does not put any requirements on the reduction, e.g. \(G^{\prime } = G\) fulfills the requirements of Theorem 1 since it maintains the global optimal solution. To verify the optimality of the reduction we need to form Theorem 2.
Theorem 2
Given a weighted automaton G, let \(G^{\prime }\) be the locally optimal reduction of G. Then, there exists no smaller reduction \(G^{\prime \prime } \subset G^{\prime }\) such that \(G^{\prime \prime }\) is a locally optimal reduction of \(G^{\prime }\).
Proof
This theorem can be proven by deduction from points 13 of Def. 1. As previously mentioned, point 2 of the definition ensures that any locally optimal reduction maintains all nonblocking shared transitions. These can never be reduced. The remaining transitions can be divided into two groups. Firstly, transitions that ends up in blocking states, these are all removed in accordance to point 1 of the definition and, hence, cannot be further reduced. The final group of transitions are the nonblocking local transitions. We can deduct from Def. 1 point 2 that it exist at least one local path between any sequential pair of shared transitions in all accepting paths, and from point 3 that it will exist at most one such local path (since redundancy is not allowed). Hence, no further reduction is possible without violating the definition, which proves that the theorem holds for any locally optimal reduction. □
To compute an abstracted locally optimal reduction of a system G we propose Algorithm 1. The main idea of this algorithm is to initiate a model based only on the nonblocking shared transitions and then connect these shared transitions with the initial state, with each other, and with the marked states using local paths. Finally the algorithm applies an abstraction of the local paths, replacing each sequence of local events with a single event that includes there combined behavior, as previously shown in Fig. 4.
Example
 1
Initiate:
\(G^{\prime } = (Q^{\prime }, {\Sigma }^{\prime }, \rightarrow ^{\prime }, q_{0}^{\prime }, Q_{m}^{\prime }, c^{\prime } ) := (\{s_{0}\},\{a,b\},\{\},s_{0},\{\}, c^{\prime } )\), τ := {}.
 2
G is already trim.
 3
Add shared transitions to \(G^{\prime }\):
\(\rightarrow ^{\prime } := \{ s_{2} \xrightarrow []{a,1} s_{6}, s_{3} \xrightarrow []{a,2} s_{4}, s_{6} \xrightarrow []{a,1} s_{8}\}\), \(Q^{\prime } := \{s_{0}\} \cup \{s_{2},s_{3},s_{4},s_{6},s_{8}\}\).
 4
Since \(\rightarrow ^{\prime }\) only includes shared transitions, the source states of potential local paths are:
Q_{s} := {s_{0}}∪{s_{4}, s_{6}, s_{8}}.
 5
Similar to step 4, the target states of potential local paths are:
Q_{t} := {s_{2}, s_{3}, s_{6}}.
 6.1
For q_{s} = s_{0}, add to \(\rightarrow ^{\prime }\), the shortest local path from s_{0} to each target state. This adds three paths: \(s_{0} \xrightarrow []{b,2} s_{1} \xrightarrow []{b,1} s_{2}\), \(s_{0} \xrightarrow []{b,3} s_{3}\) and \(s_{0} \xrightarrow []{b,1} s_{4} \xrightarrow []{b,1} s_{9} \xrightarrow []{b,3} s_{6}\). Also add the shortest local path from s_{0} to any marked state, which is \(s_{0} \xrightarrow []{b,1} s_{4} \xrightarrow []{b,2} s_{5}\).
 6.2
For q_{s} = s_{4}, add to \(\rightarrow ^{\prime }\), the shortest local path from s_{4} to each target state. This adds only one paths: \(s_{4} \xrightarrow []{b,1} s_{9} \xrightarrow []{b,3} s_{6}\), since the other target states are unreachable using local paths. The shortest local accepting path from s_{4} is \(s_{4} \xrightarrow []{b,2} s_{5}\).
 6.3
For q_{s} = s_{6}, this state has no local outgoing transitions and can be neglected.
 6.4
For q_{s} = s_{8}, this state has a single outgoing transition, a local transition leading to the initial state, and, hence, the result from the optimization will be similar to step 6.1 with the addition of the new transition. That is, the following paths will be added: \(s_{8} \xrightarrow []{b,1} s_{0} \xrightarrow []{b,2} s_{1} \xrightarrow []{b,1} s_{2}\), \(s_{8} \xrightarrow []{b,1} s_{0} \xrightarrow []{b,3} s_{3}\), \(s_{8} \xrightarrow []{b,1} s_{0} \xrightarrow []{b,1} s_{4} \xrightarrow []{b,1} s_{9} \xrightarrow []{b,3} s_{6}\) and the accepting path \(s_{8} \xrightarrow []{b,1} s_{0} \xrightarrow []{b,1} s_{4} \xrightarrow []{b,2} s_{5}\).
 *
Remark: Step 6 adds many transitions to \(\rightarrow ^{\prime }\) multiple times. This is okay as long as the transition relation is implemented using sets and, hence, only will accept one entry for each unique transition.
 7
\(Q_{m}^{\prime } := \{s_{5},s_{6},s_{7}\} \cap \{s_{0},s_{1},s_{2},s_{3},s_{4},s_{5},s_{6},s_{8},s_{9}\}\)
 8
There are two states in \(Q^{\prime }\) that satisfy the criteria in step 8, s1 and s_{9}. Each of these states are removed. This will add \(\tau [s_{0},s_{2}] := s_{0} \xrightarrow []{b,2} s_{1} \xrightarrow []{b,1} s_{2}\) and \(\tau [s_{4},s_{6}] := s_{4} \xrightarrow []{b,1} s_{9} \xrightarrow []{b,3} s_{6}\) and the paths will be replaced by the abstracted transitions \(s_{0} \xrightarrow []{c,3} s_{2}\) and \(s_{4} \xrightarrow []{d,4} s_{6}\) respectively.
 9
This terminates the algorithm and the completed locally optimal reduction \(G^{\prime }\) and the abstraction lookup table τ are returned.
Computational complexity:
The complexity of the local optimization is dominated by the computation of the shortest paths from each source state to all other states. This search is done using Dijkstra’s algorithm, with a complexity of \(\mathcal {O}(V^{2})\), in each source state, which gives the local optimization a worst case complexity of \(\mathcal {O}(V^{3})\) where V is the number of states in the system. Initially we implemented a more complex search algorithm including caching of the partial search results from Dijkstra’s algorithm such that no path was required to be searched twice. This looked promising when testing on smaller instances but it scaled poorly with larger instances due to significantly higher memory allocation.
4.2 Compositional optimization
The choice of subsystems in each iteration of step 4.i in the algorithm affects the performance, since it determines the amount of reduction that is possible in next step. There are efficient heuristics available to maximize the benefits of the compositional synthesis such as Flordal and Malik (2009). The evaluation of these heuristics has not been included in this work. The systems have instead been synchronized in a predefined sequence in order to isolate the complexity of the method, instead of the efficiency of the heuristics.
Another potential benefit of CompOpt that has not been evaluated in this paper is the inherent ability to compute many of the subproblems in parallel. It is obvious that the local optimization of the individual subsystems in step 2 can be performed in parallel. In addition to this, one can also partially parallelize the computations in step 4 by running multiple loops on separate CPU cores, while coordinating the results in a mutual set G. In this case the separate cores can synchronize and optimize different subsystems simultaneously to reduce the total computation time.
Computational complexity:
The actual complexity of CompOpt is mainly dependent on the complexity of the shared behavior between the subsystems since this cannot be reduced by the local optimization. Following the Algorithm 2, one can see that CompOpt performs local optimization 2n − 1 times and n − 1 synchronizations. Hence, the number of steps in the algorithm grows linearly with the number of subsystems. Sections 4.1 has already shown the local optimization has a complexity that is polynomial in the size of the subsystems and the same is true also for the synchronous composition (Cassandras and Lafortune 2008). However, due to the state explosion problem, the complexity is better described by the growth of the state space during the synchronization of the subsystems. This cannot be guaranteed to always be polynomial. In worst case, when no local behavior exist, the local optimization will be unable to reduce the subsystems at all. This will give an exponential growth of the state space. The complexity can then be simplified to \(\mathcal {O}(V^{n})\), where V is the number of states in the largest subsystem and n is the number of subsystems. The best case is when all subsystems are disjoint, they can then be reduced to a single transition each through local optimization. In this case the complexity becomes \(\mathcal {O}(n V^{3})\).
5 Synchronization of timeweighted systems
This section describes the integrated synchronization and optimization operation, called partial timeweighted synchronization (PTWS) and denoted \(\parallel ^{\prime }\), which we propose as part of CompOpt to synchronize the behaviour of timeweighted systems.
Timeweighted systems can be considered as a specific class of weighted systems, where the weights connected to the transitions represent their execution time or duration. This means that a timeweighted system is no DES, since the transitions have a duration. In practice, this does not affect the optimization except during the synchronization of the subsystem, where the default synchronous composition no longer can be applied.
In SCT, these systems generally require more complex modelling paradigms, such as timed automata (Alur and Dill 1994) or timed Petri net (David and Alla 2010). The main problem with these paradigms is that they can not be used to apply many of the efficient verification and synthesis techniques, which are developed for ordinary automata or Petri net models. An alternative approach, which allows the timeweighted system to be modelled using regular automata, is to apply simplifications to the system, e.g. discretization of the time line such as tick automata (Gruber et al. 2005). However, we proved in Hagebring and Lennartson (2018) that these are very inefficient, since the discretized timeline resulted in a reduced accuracy as well as a drastically increased state space. This makes simplifications such as tick automata unfit for the use in CompOpt, since the main goal is to mitigate the state explosion problem. For this reason we propose PTWS to support CompOpt in the optimization of timeweighted systems. Once again, remember that the addition of PTWS does not change the main process of CompOpt. The theory presented in Section 4 remains valid, except that, when optimizing timeweighted system, the synchronization in Algorithm 2 is performed using PTWS instead of default synchronous composition.
There are two main properties that distinguish PTWS and makes it especially suitable for CompOpt. Firstly, PTWS solves the previously mentioned implications of timeweighted systems by the introduction of a novel modelling technique, where the execution of the individual subsystems are tracked by extending the state names in the synchronous composition. This enables a correct modelling of parallel timeweighted subsystems using only ordinary weighted automata without applying any simplifications. Secondly, the integration of an optimization heuristic into the synchronization reduces the state explosion of the synchronous composition, which aligns with the main goal of CompOpt.
PTWS is implemented using a single forward search, where the optimization heuristic ensures that the synchronization only expands specific parts of the composition. This disregards many states and transitions that are not needed in order to compute a global optimal solution of the monolithic system. The result is a partial synchronous composition, which still maintains the global optimal solution. The most beneficial effect of this integrated optimization is that it directly mitigates the state explosion problem during every synchronization.
Using a single forward search makes PTWS cheap, both with respect to time and memory, but the heuristic is not sufficiently strong for the result to be a locally optimal reduction. However, similarly to Def. 1 of locally optimal reduction, requirements on the heuristics used by PTWS guarantees that that any PTWS \(\parallel ^{\prime }\) maintains the global optimal solution. The locally optimal reduction can then be computed subsequent to PTWS, using Algorithm 1, but with the benefit of a much smaller search space.
These modelling techniques, using extended state names and the specific optimization heuristic that we propose, are thoroughly described in the following sections.
5.1 Synchronization of timeweighted systems using extended state names
The model in Fig. 7 does not represent a full synchronous composition of the two subsystems. Instead, it shows only an example of one possible combination of the two systems, including three accepting paths: (i) ’ba’ where a and b are run in parallel, (ii) where a and b are run in sequence and (iii) ’a, e’ where G_{2} is waiting until event e can be executed both in G_{1} and G_{2} as a shared transition. The specific choice of transitions to include in this example is in fact based on the heuristic presented below in Section 5.2.
The example above shows that the timed automata model requires one additional state and transition each time the clock is used. This is the type of increased complexity that is avoided using extended state names. Each state name q_{i} is then extended to a pair (q_{i}, t_{i}) where q_{i} is the original state name and t_{i} is the time left until all outgoing transitions become activated, i.e. t_{i} = 0 means that the system is ready to perform a new transition while t_{i} > 0 means that it still executes the previous transition. This way of modelling is not meaningful for individual subsystems since the value of t_{i} is zero in all states and, hence, does not affect the model at all. The extended state names should be utilized only in the synchronized system, where the extended state names, on the form 〈(q_{1i}, t_{1i}), (q_{2i}, t_{2i})〉, can be used to indicate that one of the subsystems is still waiting for a previous task to finish. Remember that the transitions of a timeweighted system are typically not instantaneous. Instead, the weights of the transitions represent the time step required to finish the execution and to reach the next state. The benefit of using extended state names is that the time step of a transition in the synchronized system does not have to equal the time step of the corresponding transition in the subsystem. Instead, the status of each subsystem is tracked in the name of the next state. The extended state names do not affect the final result, which still will be an ordinary weighted automaton.
Even in this very small example, one can see that the complexity of this model, in terms of number of states and transitions, is lower than in Fig. 7, which directly affects the resulting computation time in the local optimization.
Just as the timed automata in Fig. 7, the weighted automata in Fig. 8 only represent one possible combination of the two subsystems. This partial synchronization has been applied in these examples since the full synchronous composition requires an infinite number of states when modelled using extended state names. The reason being that the extended state names and the weights of the transitions put strict constraints on the delays between the events.
Consider for example the sequence of event b, a, which in Fig. 8 is represented only by the accepting paths 〈b,0〉,〈a,5〉. This specific path represent the case where event b is executed in the initial state, event a is executed at the same time without delay (since the weight of the first transition is zero) and after 5 time units both subsystems have reached a marked state. However, a full synchronous composition of the two system also have to include all other variations of this event sequence, such as 〈b,1〉,〈a,4〉 where event b still executes from the initial state, but an additional delay of 1 time unit is applied before event a can occur. These infinite variations of the event delays makes it impossible to model a full synchronous composition of the two subsystems using this simple method.
Fortunately, CompOpt does not need a full synchronous composition. From Algorithm 2 we remember that CompOpt applies local optimization on the model directly after the synchronization. This means that a partial synchronization is enough as long as the synchronous composition is guaranteed to include at least locally optimal reduction of the full composition. This makes this modelling technique ideal for PTWS when combined with a heuristic that restricts the expansion of the state space in the synchronization. The specific heuristic that we propose is presented in the next section.
5.2 Heuristic for partial timeweighted synchronization
We can see above that integrating an optimization heuristic into PTWS offers clear benefits to CompOpt. However, any heuristic that is used in PTWS has to fulfill two main requirements, it should: (i) restrict the expansion of the synchronization such that a finite composition can be computed, (ii) maintain the global optimal solution of the full system.
The heuristic that is presented in this paper is static in the sense that it does not require information about the previous or future transitions, instead it works only with the information of the outgoing transitions from the current states in the subsystems. The main benefit of this is that the implementation is very memory efficient. This comes at the expense of a less powerful reduction that is not enough to generate a locally optimal reduction directly during the synchronization. Instead, an additional optimization, using Algorithm 1, is required when the synchronization is finished. Experiments were first conducted using a more advanced heuristic that utilized an extensive search process to compute the locally optimal reduction directly. This proved fast for very small systems but it scaled poorly with the size of the system. The reason was that the advanced heuristic had to search through all potential paths in a much larger part of the search space, which with the current heuristic can be pruned away without any extensive search.
Given two subsystems \(G_{i} = (Q_{i},{\Sigma }_{i},\rightarrow _{i},q_{0i},Q_{mi}, c_{i} )\) for i ∈ [1,2] and a specific synchronized state {〈(q_{1}, t_{1}), (q_{2}, t_{2})〉} in \(G_{1} \parallel ^{\prime } G_{2} = (Q,{\Sigma },\rightarrow ,q_{0},Q_{m},c )\). Let \(\texttt {heuristic}\left (G_{1},G_{2},\langle (q_{1},t_{1}),(q_{2},t_{2})\rangle \right )\) be a function that generates a set of outgoing transitions T from the current state following specific criteria. The generation of these transitions can be separated into three parts: the generation of shared transitions, local parallel transitions and local single transitions. The complete process of computing the heuristic is summarized in Algorithm 3 in the end of this section.
Shared transitions:
The shared transitions are similar to regular synchronization, they requires both systems to execute simultaneously and to wait until the one with longest duration is completed, which creates a single transition where both systems takes a full step. Figure 8 shows an example where a shared transition, triggered by event e, is generated.
Local parallel transitions:
The criteria for generation of parallel transitions is more complex than that of the shared transitions. The upper path of Fig. 8c illustrates how two local parallel transitions are modelled where events a, b are executed immediately after each other (no delay in between). Event b is started at time zero (in the initial state) with zero duration. This allows event a to also start at time zero in the next state. Event a is set to execute for 5 seconds allowing the system to finish event a after 1 second and event b after 4 seconds. The reason that the event with the longest duration is started first is that this gives the algorithm the opportunity to execute multiple short local transitions in one system parallel to a long transition in the other system.
Local single transitions:
 if t_{2}≠ 0 ∧ w_{1} ≥ t_{2}, then:$$ \langle (q_{1},0),(q_{2},t_{2}) \rangle \xrightarrow[]{\langle \sigma_{1},t_{2}\rangle} \langle (q_{1}^{\prime},w_{1}t_{2}),(q_{2},0) \rangle \in T; $$(10)
 if t_{2}≠ 0 ∧ w_{1} < t_{2}, then:$$ \begin{array}{@{}rcl@{}} \begin{array}{ll} \langle (q_{1},0),(q_{2},t_{2})\rangle \xrightarrow[]{\langle \sigma_{1},w_{1}\rangle} \langle (q_{1}^{\prime},0),(q_{2},t_{2}w_{1}) \rangle \in T\\ \qquad\quad\langle (q_{1},0),(q_{2},t_{2}) \xrightarrow[]{\langle \sigma_{1},t_{2}\rangle} \langle (q_{1}^{\prime},0),(q_{2},0) \rangle \in T; \end{array} \end{array} $$(11)
 if \(t_{2} = 0 \wedge \left (q_{2} \in Q_{m2} \vee {\Sigma }_{2}(q_{2}) \cap {\Sigma }_{1} \neq \emptyset \right )\), then:$$ \langle (q_{1},0),(q_{2},0) \rangle \xrightarrow[]{\langle \sigma_{1},w_{1} \rangle} \langle (q_{1}^{\prime},0),(q_{2},0) \rangle \in T. $$(12)
5.3 Implementation of PTWS
As previously mentioned, the implementation of PTWS is based on a simple forward search algorithm that adds new transitions based on the heuristic defined above. Pseudo code of the implementation is presented in Algorithm 4.
The algorithm starts by initiating an empty synchronous composition G, only including the initial state 〈(q_{01}, 0), (q_{02}, 0)〉. It then uses the heuristic defined above to compute the set of outgoing transitions from the initial state and adds these to G. For those transitions that lead to a previously unidentified state, this state is added to an ordered set S that acts as a queue of states to expand next. The state is, of course, also added to the set of states Q in G and to the set of marked state Q_{m} when applicable.
Example

Initiation:G := ({〈(s_{1}, 0), (s_{1}, 0)〉},{a, b, e},{},〈(s_{1}, 0), (s_{1}, 0)〉,{},c), no changes to Q_{m} since s_{1} ∈ Q_{m1} ∧ s_{1} ∈ Q_{m2} ≠ True, S := {〈(s_{1}, 0), (s_{1}, 0)〉}.
 Iteration 1:
 i
The first state to expand is the initial state 〈(s_{1}, 0), (s_{1}, 0)〉.
 ii
T := heuristic(G_{1}, G_{2}, 〈(s_{1}, 0), (s_{1}, 0)〉) will return the following two transitions: (i) no shared transitions, since no pair of transitions exists in the initial state with a shared event, (ii) in accordance with Eq. 8, the pair of local transitions \((s_{1},0) \xrightarrow []{\langle a,1 \rangle } (s_{2},0) \in \rightarrow _{1}\) and \((s_{1},0) \xrightarrow []{\langle b,5 \rangle } (s_{2},0) \in \rightarrow _{2}\) will give one local parallel transition \(\langle (s_{1},0),(s_{1},0)\rangle \xrightarrow []{\langle b,0 \rangle } \langle (s_{1},0),(s_{2},5)\rangle \), and (iii) since t_{2} = 0 ∧Σ_{2}(s_{1}) ∩Σ_{1} = {e}≠∅, the local single transition \(\langle (s_{1},0),(s_{1},0) \rangle \xrightarrow []{\langle a,1 \rangle } \langle (s_{2},0),(s_{1},0) \rangle \) is included, in accordance with Eq. 12.
 iii
The transitions in T are added to →.
 iv
The target states 〈(s_{1}, 0), (s_{2}, 5)〉,〈(s_{2}, 0), (s_{1}, 0)〉 are added to both Q and S since neither of them has been previously explored. None of them are added to Q_{m}.
 i
 Iteration 2:
 i
The second state to expand is 〈(s_{1}, 0), (s_{2}, 5)〉.
 ii
Since G_{2} is busy executing the previous transition (t_{2} = 5), the heuristic will in this case only have to consider local single transitions. This gives two transitions \(\{ \langle (s_{1},0),(s_{2},5)\rangle \xrightarrow []{\langle a,1 \rangle } \langle (s_{2},0),(s_{2},4)\rangle , \langle (s_{1},0),(s_{2},5) \rangle \xrightarrow []{\langle a,5 \rangle } \langle (s_{2},0),(s_{2},0) \rangle \}\), according to the criteria defined in Eq. 11.
 iii
The transitions in T are added to →.
 iv
The target states 〈(s_{2}, 0), (s_{2}, 4)〉,〈(s_{2}, 0), (s_{2}, 0)〉 are added to both Q and S since neither of them has been previously explored. The state 〈(s_{2}, 0), (s_{2}, 0)〉 is added to Q_{m} since \(t_{1}^{\prime } = t_{2}^{\prime } = 0 \wedge s_{2} \in Q_{m1} \wedge s_{2} \in Q_{m2}\).
 i
 Iteration 3:
 i
The third state to expand is 〈(s_{2}, 0), (s_{1}, 0)〉.
 ii
In this case, the heuristic gives a total of two transitions: (i) one shared transition \(\langle (s_{2},0),(s_{1},0)\rangle \xrightarrow []{\langle e,2 \rangle } \langle (s_{2},0),(s_{2},0)\rangle \), (ii) no local parallel transitions, since no local transitions are available in G_{1}, i.e. \({{\Sigma }_{1}^{l}}(s_{2}) = \emptyset \), and finally (iii) one local single transition \(\langle (s_{2},0),(s_{1},0) \rangle \xrightarrow []{\langle b,5 \rangle } \langle (s_{2},0),(s_{2},0) \rangle \), since t_{1} = 0 ∧ s_{2} ∈ Q_{m1}.
 iii
The transitions in T are added to →.
 iv
Both transitions in T have the same target state 〈(s_{2}, 0), (s_{2}, 0)〉. This state has been seen before and is already part of the set S.
 i

Iteration 4 and 5:

There are two remaining states in S: 〈(s_{2}, 0), (s_{2}, 4)〉 and 〈(s_{2}, 0), (s_{2}, 0)〉. Neither of these will have any outgoing transitions since G_{2} does not have any available transitions and the only transition in G_{1} is a shared transition.

Termination:

There are no further states in S to explore. Trimming G will remove transition \(\langle (s_{1},0),(s_{2},5)\rangle \xrightarrow []{\langle a,1 \rangle } \langle (s_{2},0),(s_{2},4)\rangle \) and its target state 〈(s_{2}, 0), (s_{2}, 4)〉, since this state is blocking, i.e. it is impossible to reach a marked state from here.
Computational complexity:
The main benefit with a static heuristic is, as previously explained, its low impact on the computational complexity. This is especially true for the memory complexity, which refers to how the memory allocation of the algorithm scales with the number of states in the system. It is shown later in Section 6 that the computation time of the optimization can be directly correlated to the total memory allocated by the algorithm. The heuristic requires no additional memory allocation, since it only uses information about outgoing transitions of the current states of the subsystems, which can be retrieved directly from the system models.
To calculate the theoretically worst case computational complexity of the synchronization in Algorithm 4, one should look at the expansion of states in the synchronous composition. Following the enumeration of Algorithm 4 one can see that (5) considers each state in S, \(\mathcal {O}(S)\). For each such state the heuristic function is computed in (5.ii), where the heuristic function considers each pair of outgoing transitions from the current states, \({\mathcal {O}(\rightarrow _{1} \times \rightarrow _{2})}\). In (5.iv) the transitions generated by the heuristic is analyzed again to generate new states which only adds a multiplier to the complexity of the heuristic. However, the generation of new states is the key to the total complexity, since this drives the size of the explored state space S. Due to the the properties of the heuristic, the states in S follows one of the following criteria: (i) both of the subsystems is in a state (i.e t_{1} = 0 = t_{2}), (ii) subsystem G_{1} is in a state while G_{2} is currently executing a transition (i.e t_{1} = 0≠t_{2}), (iii) subsystem G_{2} is in a state while G_{1} is currently executing a transition (i.e t_{1}≠ 0 = t_{2}). Hence the total amount of states that can be generated from the heuristic during a full synchronization is \(Q_{1} \times Q_{2} + Q_{1} \times \rightarrow _{2} + Q_{2} \times \rightarrow _{1}\).
6 Application
This section illustrates the actual complexity and potential of the algorithms when optimizing a system of systems that have subsystems with complex local behavior. This is done in a series of experiments using a simplification of a respotting problem in a welding robot cell. Just like the real scenario, the example includes multiple robots that operate in parallel on the same product but from different angles. During a production cycle there are specific disruptive events that affect all robots similarly, such as the assembly of one additional subpart to the product. A few of the welding operations performed by the robots has to be performed while the assembly robot is still gripping the part, but a majority of the operations can or has to be performed once the assembly robot has left the zone.
These disruptive events typically put strict constraints on most tasks in the cell to be performed either before or after the global event. This constitutes the dependencies between the systems and makes it impossible to only optimize each robot individually without risking ending up with a suboptimal solution. This is a common scenario in applications where the subsystems mainly work independently but have to collaborate regarding some global or shared behavior. It is also just the type of structure that can be exploited by the CompOpt method, since most of the behavior in each subsystem is local.
The size of the example can be modified in multiple ways to evaluate how the actual complexity of the algorithms scales with different properties of the problem instance. The results shown in this section focus on how the size of the reduced state space scales when the system grows. This is also compared to time and memory allocation of the computation to verify the complexity of the algorithms used in the optimization.
6.1 Modelling of the example
The example is based on a robot cell that includes a set of robots \(R = \{r_{1},\dotsc ,r_{n}\}\) that represent the subsystems of the plant. Each robot r_{i} ∈ R can operate in an independent area A_{i} of size x_{max} × y_{max}. Recent work by Åblad et al. (2017) shows that it is possible to generate (more complex) zones such that collisions between robots are guaranteed to be avoided. In a single cycle of the cell, each robot r_{i} is required, from a home position or idle state, to go to and perform m tasks of duration d that are located at random locations in A_{i}. The tasks are pairwise independent and can be performed in arbitrary order. When all tasks are finished, each robot should return to its idle state. In addition to the individual tasks there is also one global event s with duration d_{s} that simulates a disruptive change of the product which affects all robots.
Specific problem instances for the example are represented by a set of automata G = {G_{i}},∀r_{i} ∈ R. Each element G_{i} ∈G models the full behavior of a robot including the tasks to be performed. The process of generating these instances are now presented.
Selecting coordinates for each task:
For each robot r_{i} ∈ R, m coordinates (x_{ij}, y_{ij}) should be randomly selected to represent the position within A_{i} of the task t_{ij}, where i, j represent the index of the robot and task respectively. This has been done using a random permutation P_{i} of the integers [1,x_{max}y_{max}] for each robot. The coordinates are then selected as x_{ij} = (p_{ij} − 1) mod x_{max} + 1 and y_{ij} = ⌈p_{ij}/x_{max}⌉, where a mod b is the nonnegative remainder when dividing a by b. This gives x_{max} × y_{max} possible locations for the tasks of each robot and ensures that no two tasks are in the same position. The random permutation is generated using Mersenne Twister as random number generator, accepting a specific seed to be used to create an unlimited number of reproducible instances (Matsumoto and Nishimura 1998).
Modelling of the individual robots:
Ensure that each task is performed exactly once:
This is done by including one individual automata for each task that requires the task to be performed before entering a terminating marked state, see Fig. 10b.
Construct specifications with regards to the global event:
To simulate the desired global behavior, specific precedence constraints are added between the global event and most individual tasks. These specify whether the task should precede or be preceded by the global event. This is modelled by automata such as Fig. 10c.
The example could in principle be varied with all possible combination of precedence constraints but some simplifications has been made when generating problem instances to make the evaluation of the complexity more accurate. For this reason, each robot has been constrained in the same way to better isolate the different behaviors. However, since the tasks themselves are randomly generated the behavior still differs between similar instances. The m tasks in each robot have been divided as follows: the first k tasks are considered independent of the global event, the following ⌈(m − k)/2⌉ tasks have to precede the global event and the rest have to be preceded by the global event. For example, if m = 4 and k = 1 then t_{i1} will be independent, t_{i2}, t_{i3} will precede and t_{i4} will be preceded by the global event for each robot r_{i} ∈ R.
Combining the parts into separate subsystems:
The last step when generating a problem instance is to synchronize all models described above into one subsystem Gr_{i} that represents the complete behavior of each robot. Synchronization of these components does not require PTWS, since each robot only can perform one task at a time.
6.2 Evaluation of actual complexity
The evaluation has been done by solving multiple problem instances with different properties. The properties that has been varied are mainly the number of robots in the cell and the number of tasks performed by each robot, to test how the complexity scales with the amount of subsystems and complexity of their local behavior respectively. The results focus on the total number of states in the optimization of the system, i.e. the sum of the number of states in all subproblems solved.
How the complexity scales with the number of subsystems is, as mentioned in Section 4.2, strongly connected with the complexity of the shared behavior. To show the potential of the method, the evaluation focus mainly on problem instances with a single independent task in each robot. In the end of this section we show how the method scales when the complexity of the global behavior increases to give an indication of the limitations of the method.
Scaling of state space size
The system scales very differently for the two parameters. When only scaling the complexity of the local behavior the number of states scales almost linearly, the reason is that it only adds to the complexity of the initial optimization of the subsystems, which have a very limited effect on the total complexity since they are solved independently before synchronization. This is the main reason why CompOpt can be so efficient.
On the other hand, the number of states scales exponentially when increasing the number of robots in the system. The reason is that, even if the CompOpt decreases the size of each subsystem, there will still remain some shared behavior that cannot be solved until all subsystems have been synchronized. This will cause the state space to grow exponentially with the size of the shared behavior until the final optimization. However, this still scales very efficiently compared to a monolithic model.
Comparison with a monolithic method:
Table 1 shows how the state space of a trim monolithic model grows with an increased number of subsystems and/or an increased number of tasks per robot. This gives a hint on the size of the problem instances used and the efficiency of the CompOpt.
The extent of the table is limited by to the fact that the computation either timed out or ran out of memory when solving for any larger instances (apart from instances with only one robot which was considered irrelevant for the application). This is in contrast to the results below where systems with 10 robots and 10 tasks per robot were solved.
Average number of states in the monolithic model for an instance with n robots with m tasks each, calculated using instances with ten different random seeds
m  n = 1  n = 2  n = 3  n = 4 

2  117.0  8,140.0  657,440.0  35,961,344.0 
3  188.6  15,392.0  1,379,880.8   
4  420.6  96,030.8  27,150,565.3   
5  627.6  180,032.0     
6  1,263.6  912,585.6     
7  1,882.4  1,638,088.0     
8  3,503.2  6,986,696.0     
9  5,098.4  11,981,064.0     
10  9,237.6  42,450,952.0     
Comparing with theoretical results:
The plots in Fig. 12 also include a curve fit, where a second order polynomial has been fitted to the data. One can see that the quadratic curve follows the average growth of the data quite well both for time and space complexity, even if the quadratic function does not represent the data exactly. This indicates that the complexity is approximately \(\mathcal {O}(n^{2})\) for this specific example where n is the sum of the number of states in all subproblems. However, as described in Section 4.2, this will generally not be true for a system with more extensive shared behavior between the subsystems.
Increasing the complexity of the global behavior:
This section shows results that can give an indication of the dependencies between the efficiency of CompOpt and the complexity of the shared behavior in the subsystems. It is illustrated by a set of experiments using the same example as previously but increasing the number of independent tasks in each robot, that is how many tasks that are independent of the global event. These tasks can be performed either before or after the global event, which constitutes an alternative in the global behaviour of the subsystem and increases the global complexity of the system.
6.3 Comparison with previous work
All results presented in Section 6.2 have been calculated using the exact same instances of the example that were used in previous work. This allows for a comparison between the new synchronization method proposed in this paper with the old method, which used tick automata to model timeweighted systems. We can conclude that the results presented in this paper is approximately a magnitude of ten better than with the previous method, i.e. fewer states in the evaluations. This shows that CompOpt manages to optimize systems of larger scale when using PTWS due to the reduction in memory allocation.
However, the major improvement of PTWS becomes clear first when we generate instances where the duration or precision of the weights are increased. This will have a big negative effect to the state space when using the old method with tick automata, due to the discretization of the state space. So far the examples have used only small weights on the transitions and the tick automata has been allowed to round this up to nearest integer. This is not realistic in industrial applications where the scheduling usually requires high precision. This can be achieved by letting a tickevent in the automata represent a shorter time unit, e.g. milliseconds, but this would drastically increase the number of states added to the model.
In Fig. 14 we see that the complexity of the old method increases rapidly when increasing the size of the area of operation while the complexity of the new method is mostly indifferent to changes to the size. The variance that still exists in the results using the new method is assumed to be caused by the variance in the individual problem instances, caused by the randomized generation of tasks, rather than a growth in complexity.
7 Conclusion
This paper continues the development of compositional optimization, an optimization method which previously has been proposed for largescale systems of systems. The key to this method is a local optimization technique that reduces the size of each subsystem individually to mitigate the state explosion problem. It is proven that this local optimization maintains the global optimal solution of the system while removing all nonoptimal or redundant paths. The method offers further reduction of the search space using a compositional algorithm that performs local optimization iteratively while synchronizing the subsystems. Moreover, dividing the problem into multiple subproblems makes parallelization of the computation possible. This improves the applicability of the method significantly, since additional computation power can be purchased ondemand through cloud services. Results in this paper show that the method has the potential to scale very well with the number of subsystems. This is especially true with subsystems that have complex local behavior, something that in a monolithic optimization would cause an exponential growth of the search space. This makes it possible to calculate global optimal solutions for largescale industrial applications.
A novel contribution in this paper is the introduction of a new synchronization method, called partial timeweighted synchronization (PTWS), that is specifically designed for a class of systems called timeweighted systems. The method further mitigates the state explosion problem by integrating an optimization heuristic into the synchronization that generates a reduced synchronous composition where many nonoptimal or redundant solutions already have been removed. The synchronization of timeweighted systems were in previous work identified as one of the main limitations to compositional optimization and, yet, a majority of the current industrial applications are of this class. In this paper we show that the addition of PTWS greatly improves on this limitation. For these reasons, PTWS is considered to be a major improvement to compositional optimization.
In future work it would be of interest to implement parallel computation of compositional optimization as a cloud service to evaluate the potential of having scalable computation power. Additionally, it would be interesting to apply this method as an online optimization method in real industrial applications.
Notes
Funding Information
Open access funding provided by Chalmers University of Technology.
References
 Åblad E, Spensieri D, Bohlin R, Carlson JS (2017) Intersectionfree geometrical partitioning of multirobot stations for cycle time optimization. IEEE Trans Autom Sci Eng PP(99):1–10Google Scholar
 Alur R, Dill DL (1994) A theory of timed automata. Theor Comput Sci 126 (2):183–235. https://doi.org/10.1016/03043975(94)900108 MathSciNetCrossRefGoogle Scholar
 Bertsekas DP, Tsitsiklis JN (1996) Neurodynamic programming. Athena Scientific, BelmontzbMATHGoogle Scholar
 Bertsekas DP (2005) Dynamic Programming and Optimal Control, vol I, 3rd edn. Athena Scientific, BelmontGoogle Scholar
 Brandin BA, Wonham WM (1994) Supervisory control of timed discreteevent systems. IEEE Trans Autom Control 39(2):329–342MathSciNetCrossRefGoogle Scholar
 Cao X (2007) Stochastic Learning and Optimization: A SensitivityBased Approach. Springer, BerlinCrossRefGoogle Scholar
 Cassandras CG, Lafortune S (2008) Introduction to Discrete Event Systems, 2nd edn. Springer Science & Business Media, BerlinCrossRefGoogle Scholar
 David R, Alla H (2010) Discrete, Continuous, and Hybrid Petri Nets. Springer, Berlin. https://doi.org/10.1007/9783642106699 CrossRefGoogle Scholar
 Dijkstra EW (1959) A note on two problems in connexion with graphs. Numer Math 1(1):269–271. https://doi.org/10.1007/BF01386390 MathSciNetCrossRefGoogle Scholar
 Flordal H, Malik R (2009) Compositional verification in supervisory control. SIAM J Control Optim 48(3):1914–1938MathSciNetCrossRefGoogle Scholar
 Gass SI, Fu MC (2013) Encyclopedia of Operations Research and Management Science, 2013rd edn. Springer, BerlinCrossRefGoogle Scholar
 Gruber H, Holzer M, Kiehn A, König B (2005) On timed automata with discrete time – structural and language theoretical characterization. In: De felice C, Restivo A (eds) Developments in Language Theory. Springer, Berlin, pp 272–283Google Scholar
 Hagebring F, Wigström O, Lennartson B, Ware SI, Su R (2016) Comparing MILP, CP, and A* for multiple stacker crane scheduling. In: 13th International Workshop on Discrete Event Systems (WODES), pp 63–70Google Scholar
 Hagebring F, Lennartson B (2018) Compositional optimization of discrete event systems. In: 14th IEEE International Conference on Automation Science and EngineeringGoogle Scholar
 Hill R, Lafortune S (2016) Planning under abstraction within a supervisory control context. In: 2016 IEEE 55th Conference on Decision and Control (CDC)Google Scholar
 Hill R, Lafortune s (2017) Scaling the formal synthesis of supervisory control software for multiple robot systems. In: 2017 American Control Conference (ACC)Google Scholar
 Hoare C (1978) Communicating Sequential Processes, vol 21. ACM, New York. https://doi.org/10.1145/359576.359585 zbMATHGoogle Scholar
 Huang J, Kumar R (2008) Optimal nonblocking directed control of discrete event systems. IEEE Trans Autom Control 53(7):1592–1603MathSciNetCrossRefGoogle Scholar
 Kobetski A, Fabian M (2009) Timeoptimal coordination of flexible manufacturing systems using deterministic finite automata and mixed integer linear programming. Discret Event Dyn Syst 19(3):287–315MathSciNetCrossRefGoogle Scholar
 Matsumoto M, Nishimura T (1998) Mersenne twister: a 623dimensionally equidistributed uniform pseudorandom number generator. ACM Trans Model Comput Simul 8(1):3–30CrossRefGoogle Scholar
 Mohajerani S, Malik R, Fabian M (2014) A framework for compositional synthesis of modular nonblocking supervisors. IEEE Trans Autom Control 59(1):150–162MathSciNetCrossRefGoogle Scholar
 Passino KM, Antsaklis PJ (1989) On the optimal control of discrete event systems. In: Proceedings of the 28th IEEE Conference on Decision and ControlGoogle Scholar
 Powell WB (2007) Approximate dynamic programming: Solving the curses of dimensionality. WileyInterscience, New YorkCrossRefGoogle Scholar
 Ramadge PJ, Wonham WM (1987) Supervisory control of a class of discrete event processes. SIAM J Control Optim 25(1):206–230MathSciNetCrossRefGoogle Scholar
 Ramadge PJ, Wonham WM (1989) The control of discrete event systems. Proc IEEE 77(1):81–98CrossRefGoogle Scholar
 Su R (2012a) Abstractionbased synthesis of timed supervisors for timeweighted systems. IFAC Proc Vol 45(29):128–134. https://doi.org/10.3182/201210033MX4033.00024 CrossRefGoogle Scholar
 Su R, van Schuppen JH, Rooda JE (2012b) The synthesis of time optimal supervisors by using heapsofpieces. IEEE Trans Autom Control 57(1):105–118. https://doi.org/10.1109/TAC.2011.2157391 MathSciNetCrossRefGoogle Scholar
 Valmari A (1998) The state explosion problem. In: Lectures on petri nets I: Basic Models, Advances in Petri Nets, the Volumes Are Based on the Advanced Course on Petri NetsGoogle Scholar
 Ware S, Su R (2017) Time optimal synthesis based upon sequential abstraction and its application to cluster tools. IEEE Trans Autom Sci Eng 14(2):772–784CrossRefGoogle Scholar
 Wong KC, Wonham WM (1998) Modular control and coordination of discreteevent systems. Discret Event Dyn Syst 8(3):247–297MathSciNetCrossRefGoogle Scholar
Copyright information
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.