Model predictive scheduling of semi-cyclic discrete-event systems using switching max-plus linear models and dynamic graphs

In this paper we discuss scheduling of semi-cyclic discrete-event systems, for which the set of operations may vary over a limited set of possible sequences of operations. We introduce a unified modeling framework in which different types of semi-cyclic discrete-event systems can be described by switching max-plus linear (SMPL) models. We use a dynamic graph to visualize the evolution of an SMPL system over a certain period in a graphical way and to describe the order relations of the system events. We show that the dynamic graph can be used to analyse the structural properties of the system. In general the model predictive scheduling design problem for SMPL systems can be recast as a mixed integer linear programming (MILP) problem. In order to reduce the number of optimization parameters we introduce a novel reparametrization of the MILP problem. This may lead to a decrease in computational complexity.


Introduction
Scheduling is the process of deciding how to allocate a set of jobs to limited resources over time in such a way that one or more objectives are optimized (Leung 2004;Pinedo 2001). Here, a job is a sequence of operations according to a recipe that specifies a partial ordering among these operations, and resources are the equipment units where operations can take place. In a typical scheduling problem, resources are scarce and constrained in various ways (e.g., in the capacity of resources or the order of activities that can be performed on them), and one is looking for a schedule of the activities that both satisfies the constraints and is optimal according to some criterion (e.g., the length of the schedule) (Fromherz 2001 of research on scheduling has been done since the original work of Johnson (1954). Several books already presented general surveys for these problems such as Blazewicz et al. (2001), Brucker (2001), and Pinedo (2001) for some recent ones.
In scheduling three basic types of control decisions play a major role, namely routing, ordering, and synchronization. Routing decides how a job follows a sequence of resources. Usually a job follows a predetermined route through the system (Johnson 1954). Sometimes there are alternative routes and the routing for each job has to be determined. Once the routes of the jobs have been fixed, conflicts may occur when multiple jobs need to be operated at the same resource. This means we have determine the ordering of concurring jobs in resources. Often job synchronization takes place, i.e. an operation of a job can only start when a specific operation of another job on another resource has finished.
A special type of scheduling problem is the flow shop scheduling problem, in which the routes of the jobs and the order of operations are fixed. All of the resources and jobs contribute to the achievement of some common goal, such as a minimal idle time and a minimal total waiting time. After all jobs in a system have been completed, the cycle is complete and a new cycle begins. An overview of the cyclic scheduling problem is available in Brucker and Kampmeyer (2008) and Hanen and Munier (1995). Many flow shop scheduling problems can be solved very well by considering a class of cyclic discrete event systems (DES), namely the class of max-plus linear systems (Baccelli et al. 1992;Heidergott et al. 2006), which is capable of representing job and resource unavailability. The main reason to use these models is that the max-plus algebra is better adapted for solving sequencing problems than the classical algebra. Flow-shop scheduling problems using max-plus linear models have already been studied in Bouquard et al. (2006), Doustmohammadi and Kamen (1995), Indriyani (2016), Nambiar and Judd (2011), and Yurdakul and Odrey (2004). Model predictive control of a flow shop scheduling problem with a just-in-time cost function and no constraint next to the non-decreasing input constraint can be solved using a semimodule approach (with a lower computational cost) (Gomes da Silva and Maia 2016). More publications on control of max-plus linear system can be found in Boimond and Ferrier (1996), Hardouin et al. (2009), Houssin et al. (2013), Lahaye et al. (2008), Libeaut and Loiseau (1995), Maia et al. (2003), and Menguy et al. (2000).
An example of scheduling a cyclic DES is the synchronization of the legs in a sixlegged mobile robot (Lopes et al. 2014). The legs will move in a coordinated pattern, called a gait. For a fixed gait the system will show a cyclic behavior, which can be described by a max-plus linear model. Alirezaei et al. (2012) design an optimal schedule of multiple sheets in a printer using a max-plus framework. The design variables are the feeding time and the handling time of the sheet in the duplex loop. It is shown that the resulting optimization problem can be solved using linear programming optimization methods. The scheduling of energy flows between the parallel processes in the production of calcium silicate stones is discussed in Mutsaers et al. (2012), where the authors use a max-plus linear model in the formulation of the scheduling problem. A railway traffic system with a cyclic timetable can described by a max-plus-linear model (Braker 1993;Heidergott et al. 2006). The use of max-plus algebra allows fast computation of performance indicators and delay propagation in short time even on large networks. Modeling a cyclic DES using max-plus algebra has as advantage that the resulting max-plus-linear (MPL) system can be considered as a linear system that has a strong analogy to conventional linear system theory.
A disadvantage of MPL systems is that the model structure is fixed, whereby changes in the structure of the system (change of route, different order of operations) cannot be modeled.
In the case of semi-cyclic processes the set of operations may vary over a limited set of possible sequences of operations. Every possible set of operations defines a mode of operation. By switching between different modes of operation (in each mode the system is described by an MPL model), we obtain a switching max-plus linear (SMPL) system (van den Boom and De Schutter 2006).
An example of scheduling a semi-cyclic DES is the synchronization of the legs in a six-legged mobile robot with gait changes. The legs can change gait, which means that the legs will move in different coordinated patterns. If gait switching is possible, the system's behavior is semi-cyclic and can be described by an SMPL model (Kersbergen et al. 2011). Also paper handling in printers with different paper sizes and/or both simplex and duplex printing, can be modeled as an SMPL system (see Section 3). Other examples of scheduling semi-cyclic DESs are operational traffic management of railway systems with changing train orders in case of disturbances (Kersbergen et al. 2016), and the scheduling of automated guided vehicles for unloading ships in seaport container terminals, in which the vehicles transport the containers from the quay cranes to the stack cranes (van Boetzelaer et al. 2014).
Graph-based methods can be used in the scheduling procedure (see Mascis and Pacciarelli 2002). There is a close relation between max-plus linear models and the graph representation of the system (Baccelli et al. 1992). From the precedence graph of the system we can compute the eigenvalue and eigenvector of the system matrix, which play a crucial role in the analysis of the system. For SMPL systems we cannot use the precedence graph because the system matrix may change every event step. In this paper we therefore use the dynamic graph (Murota 2009(Murota , 2012. From the dynamic graph we can compute the spectral radius of the system (equivalent to the max-plus eigenvalue for max-plus linear systems). Also controllability of the SMPL system can be studied using the dynamic graph (See Section 6).
Many scheduling problems lead to integer optimization problems, or in many cases, to mixed integer linear programming (MILP) problems (Floudas and Lin 2005;Ku and Karimi 1988;Leung 2004;Pinedo 2001). Also in this paper the final optimization problem will be an MILP problem. This final optimization problem will often be identical to the one we obtain using the MILP optimization problem that arises in conventional scheduling techniques. The contribution this paper is that by considering SMPL systems the performance of the scheduling procedure can be improved by using the properties of SMPL models and dynamic graphs, such as detecting bottlenecks and using reparametrization of the MILP problem based on max-plus expressions to reduce the number of optimization parameters.

Motivation and contribution
There are advantages in using SMPL systems as a basic model for scheduling. First of all there are many system-theoretical results for (S)MPL systems in literature (Baccelli et al. 1992;van den Boom et al. 2013). We can use them for finding bottlenecks in the scheduling process as well as good initial scheduling values by using system properties, based on the max-plus eigenvalue and eigenvectors (Kersbergen et al. 2011). In this paper we discuss model predictive scheduling of semi-cyclic DESs. By using an SMPL model of the system we can make a prediction of its future behavior while searching for an optimal schedule for the future. If the model is perfect, the optimal schedule can be executed without feedback and the system will behave as predicted. However, in general the system is affected by disturbances and/or the model is not perfect, so we deal with model uncertainty. Therefore, the schedule has to be adapted on-line in response to the unexpected events. This is called operational scheduling or rescheduling.
The goal of this paper is to show how SMPL systems and their corresponding dynamic graphs can be used for the scheduling of semi-cyclic systems. We will introduce a unifying modeling approach and use it to analyze the properties of the SMPL systems. The use of a dynamic graphs eases the modeling and gives insight in the routing and order relations of the system events.
This paper extends the results of van den Boom et al. (2013): We introduce the dynamic graph for representing the switching behavior of an SMPL system. We highlight the importance of the dynamic graph concept by discussing controllability and maximum average path weight in terms of dynamic graphs and elaborate on the relation between the makespan of a schedule and the maximum average path weight of the SMPL system. Furthermore, we have added a section on classification of SMPL scheduling problems and a section with two illustrative examples of SMPL systems (with their corresponding dynamic graphs). We prove that under mild conditions the relaxed model predictive scheduling problem will give the same result as the original model predictive scheduling problem. Finally we give a generalized framework for reparametrization of the mixed integer linear programming problem and apply this to reparametrization of the ordering and routing variables.
The paper is organized as follows: In Section 2 we review SMPL systems and introduce the concept of dynamic graphs. Section 3 gives some illustrative examples of semi-cyclic systems that can be modeled as SMPL systems with their corresponding dynamics graphs. Section 4 discusses the classification of SMPL models. Section 5 analyzes the relation between the routing, ordering, and job synchronization of the scheduling operations in the context of SMPL systems. Section 6 presents some tools for the analysis of SMPL systems using dynamic graphs. Section 7 formulates the model predictive scheduling problem and shows how the related optimization problem can be solved. Section 8 concentrates on the case where the problem can be written as a mixed integer optimization problem and shows that by reparametrization the number of optimization variables can be reduced. Finally, in Section 9 some conclusions are drawn.

Max-plus algebra
Define ε = −∞ and R ε = R ∪{ε}. The max-plus-algebraic addition (⊕) and multiplication (⊗) are defined as follows Baccelli et al. (1992) and Cuninghame-Green (1979): for any x, y ∈ R ε , and The last operation ( ) is the max-plus Schur product. The matrix ε is the max-plus-algebraic zero matrix: [ε] i,j = ε for all i, j . Define Discrete Event Dynamic Systems for n ∈ Z + the set n = {1, 2, . . . , n}. The matrix E n ∈ R n×n ε is the max-plus identity matrix with [E n ] i,i = 0, i ∈ n and [E n ] i,j = ε, i ∈ n, j ∈ n, i = j . The max-plus-algebraic matrix power of A ∈ R n×n ε is defined as follows: The max-plus Kleene-star of a matrix A ∈ R n×n ε is defined as Note that A * exists for any square matrix A with a precedence graph G(A) having only nonpositive circuit weights (Baccelli et al. 1992). Let u ∈ B ε = {0, ε} be a max-plus binary variable; then the adjoint variableū ∈ B ε is defined as follows:ū

Max-plus linear systems
A max-plus linear system is defined as follows Baccelli et al. (1992): where A ∈ R n×n ε and B ∈ R n×n u ε are the system matrices, x(k) ∈ R n ε is the state, u(k) ∈ R n u ε is the input of the system, and k is the event counter of the system. In this paper k will also be called cycle counter, because in every cycle k a number of jobs are completed using a fixed route and in a specific order.
Remark 1 Note that in this paper we use the dater description of the max-plus linear system, which means that the matrices A and B are constant matrices in R n×n ε and R n×n u ε , respectively.

Switching max-plus linear systems
In van den Boom and De Schutter (2006) the class of switching max-plus linear (SMPL) systems was introduced, described by in which the matrices A( (k)) ∈ R n×n ε , B ( (k)) ∈ R n×n u ε are the system matrices for mode (k) ∈ n for cycle k. The moments of switching between modes are determined by a switching mechanism. In general, the mode (k) will depend on the previous state x(k − 1), the previous mode (k − 1), the input variable u(k), and an additional control variable v(k). For this purpose we define the switching function φ s as: Model (2) is often referred to as an explicit SMPL model. In this paper, we will also consider the implicit SMPL model, given by: The max-plus Kleene star of A 0 ( (k)) for mode (k) at cycle k is given by Note that for a fixed (k) the matrix A 0 ( (k)) is a constant matrix and so [A 0 ( (k))] * can easily be computed. We can use the max-plus Kleene star of A 0 ( (k)) to rewrite the implicit SMPL model into an explicit one. Consider an implicit SMPL system (3) for which a finite solution of [A 0 ( (k))] * exists. Using Theorem 2.66 of Baccelli et al. (1992) the implicit SMPL system can be written in the explicit form of Eq. 2, where A( (k)) = [A 0 ( (k))] * ⊗ A 1 ( (k)) and B ( (k)) = [A 0 ( (k))] * ⊗ B ( (k)). In the current paper we consider the scheduling of semi-cyclic DES. We study different types of semicyclic DES and model them with an SMPL model. In some applications the mode (k) only depends on the additional integer-valued control vector v(k), so (k) = φ s (v(k)). Therefore, we will also use the notation A 0 (v(k)), A 1 (v(k)), and B(v(k)).
If we rewrite the implicit SMPL model into an explicit SMPL model the system matrices of the explicit model become A(v(k)) and B (v(k)). These matrices A(v(k)) and B (v(k)) may become very complex functions of v(k). For example, in Kersbergen et al. (2016) a railway traffic management problem was considered with the optimization of the scheduling parameters. A comparison was done using an explicit SMPL model and an implicit SMPL model. The explicit model became very complex and introduced many additional constraints in the final MILP problem. This made the optimization with the explicit model much slower than the optimization with the implicit model. This motivates the use of implicit models in model predictive scheduling.

Dynamic graphs
There exists a close relation between max-plus algebra and graphs (Baccelli et al. 1992;Minoux 1976, 1984). Important properties such as irreducibility, eigenvalues, and structural controllability can be determined from the precedence graph of a max-plus system. If we want to study the switching behavior in the system the precedence graph cannot be used any more because the mode (k) and thus also the A-matrix of the system may change for every cycle k. Only if the system remains a longer time in one mode (so if (k) is constant in some event interval {k start , k start + 1, . . . , k end }), we can study the behavior of the system in that specific mode by considering the precedence graph. Examples of systems that often remain a longer time in one mode for some event interval are printers, where the paper type may be constant for some time (Alirezaei et al. 2012), and legged robots that move in a specific gait for some time (Lopes et al. 2014). For a better understanding of the switching behavior we consider the dynamic graph concept, introduced by Murota (2009Murota ( , 2012. For the analysis of the dynamic graphs we can compute the maximum average path weight, related to the maximum growth rate of the system (van den Boom and De Schutter 2012), and we can check the controllability of the system. This will be discussed in Section 6. Consider an SMPL system of the form (3) where n is the number of modes. For a given positive integer N , let the set L N = { [ (1) · · · (N ) ] T | (m) ∈ n , m ∈ N} denote the set of all possible consecutive mode switching vectors within N cycles.
The main advantage of the dynamic graph is that it can handle the switching nature of SMPL systems. In the context of implicit SMPL systems the dynamic graph for a given mode sequence˜ = [ (1) · · · (N ) ] T ∈ L N , is defined as follows: Definition 1 Consider an implicit SMPL system for a given mode sequence˜ ∈ L N . The dynamic graph G = (G 1 0 , G 1 1 , G 2 0 , G 2 1 , . . . , G m 0 , G m 1 , H 1 , . . . , H m ) is a sequence of graphs, where G k 0 = (X k , E k 0 ) is a directed graph with only nonpositive circuit weights, G k 1 = (X k , X k−1 , E k 1 ), is a directed bipartite graph with E k 1 being the set of edges from X k−1 to Discrete Event Dynamic Systems X k , and H k (X k , U k , E k (u) ) is a directed bipartite graph with E k (u) being the set of edges from U k to X k . The nodes X k represent the state of a system at cycle k and the nodes U k correspond to the input of the system at cycle k. The weight of the edge of G k 0 from node In the following section we will show that SMPL models and the corresponding dynamic graphs will help in the modeling of semi-cyclic DESs. System analysis with the dynamic graph will be discussed in Section 6.
Example 1 For the implicit SMPL system the dynamic graph for mode-sequence {1, 2, 1} is given in Fig. 1.
For a periodic mode sequence with (k + c) = (k) the dynamic graphs can be obtained from traditional precedence graphs by using a classical state-space expanding technique.

Examples of switching max-plus-linear systems
In this section we discuss two applications in which the DES can be modeled as an SMPL system, namely a pro duction system and the paper flow in a simplex/duplex printer. More examples can be found in literature (e.g. a railway network (Kersbergen et al. 2016), a legged robot (Lopes et al. 2014), and a container terminal (van Boetzelaer et al. 2014)). For the mathematical modeling it is convenient if there is a general modeling methodology that one can follow. Moreover, when an adjustment must be made in the obtained model, such as adding a resource, it is desirable that not the whole system needs to be remodeled. It would be time saving if then only that specific part can be added whereby automatically a new model is obtained. Finally, a systematic way of modeling will result in a structured control problem to obtain the optimal schedule.
Due to the switching nature of SMPL systems, the Petri net representation is not useful for SMPL systems because of the changing structure. To study the mode changes in SMPL systems we consider the dynamic graph, which can represent the switching behavior of SMPL systems. In addition the dynamic graph can be used to derive the SMPL model of the system.

Production system
Consider the production system of Fig. 2. This system consists of five machines M 1 , . . . , M 5 and operates in batches. The raw material is fed to machines M 1 and M 2 where preprocessing is done. Afterwards the intermediate product is fed to machine M 3 or machine M 4 for further processing. Finally, the two parts are assembled in machine M 5 and the end product leaves the system. We assume that each machine starts working as soon as possible on each batch, i.e., as soon as the raw material or the required intermediate product is available, and as soon as the machine is idle (i.e., the previous batch of products has been processed and has left the machine). Define u i (k), i = 1, 2 as the time instant at which machine M i is fed for the kth time, y(k) as the time instant at which the kth end product leaves the system, and x i , i = 1, . . . , 5 as the time instant at which machine i starts for the kth time. We define d i , i = 1, . . . 5 as the processing time on machine i for the kth batch, and we assume the transportation times between the machines can be neglected. Assume that the system can run in two modes. In the first mode the product from machine M 1 will proceed to machine M 3 , and the product from machine M 2 will proceed to machine M 4 , while in the second mode the product from machine M 1 will proceed to machine M 4 , and the product from machine M 2 will proceed to machine M 3 . In the first mode the system equations are given by

Fig. 2 Production system with five machines
Discrete Event Dynamic Systems leading to the following matrices for the first mode: In the second mode the system equations are given by leading to the following matrices for the second mode: In Fig. 3 the dynamic graph of the production system is given for the case where we have mode 1 in cycle k and mode 2 in cycle k + 1.

Paper flow in a simplex/duplex printer
In Fig. 4 a schematic representation is given of the paper path in a simplex/duplex printer (see Alirezaei et al. 2012). In mode 1 (duplex mode) the paper runs from the paper input module via the image transfer station, where the image is printed onto the sheet, via the invert module and the re-entry module again to the image transfer station for back side printing. Finally, the sheet leaves the system via the paper output module. If the printer runs in mode 2 (simplex mode), the paper runs via the paper input module and image transfer station directly to the paper output module. The collision avoidance of the sheets in the printer is the main constraint in the paper path. We will first derive the model and then give the dynamic graph.
Let u(k) be the time instant that the kth sheet enters the PIM, y 1 (k) the time instant that the kth sheet enters the ITS, y 2 (k) the time instant that the kth sheet enters the RM, y 3 (k) the time instant that the kth sheet enters the ITS for the second time, y 4 (k) the time instant that the kth sheet leaves the printer.
The evolution of the paper path are defined as follows for the duplex mode: Discrete Event Dynamic Systems where τ 1 , τ 2 , τ 3 , τ 4 , and τ 5 are the process time for feeding, printing, handling in the first part of the loop, inverting, handling in the second part of the loop and stacking, respectively. Note that when paper sheet k is in the IM/RM, sheet k + 1 also enters the IM/RM. This means that the second time that paper k enters the ITS (x 3 (k)) is scheduled after the first time that paper k + 1 leaves the ITS (x 1 (k + 1) + τ 2 ). Therefore, the state x 3 (k) depends Fig. 4 Paper flow in a simplex/duplex printer on the future event x 1 (k + 1). In the same way, the first time paper k enters the ITS (x 1 (k)) will be scheduled after the second time paper k − 2 leaves the ITS (x 3 (k − 2) + τ 2 ). To rewrite the model in the form of Eq. 3 we introduce the state x and a new inputū as follows: The new set of state equations become For the model description given in Eq. 3 we obtain the system matrices for the first mode: Now let us consider the case of mode 2 (simplex mode), where paper sheet k only needs to be printed on one side. In that case we skip the states x 1 (k) and x 2 (k) in the paper path and immediately go from the input to state x 3 (k). The evolution of the paper path are defined as follows for the simplex mode: With the new set x(k) the state equations become The dynamic graph in Fig. 5 shows the paper flow for the case were sheets k − 2, k − 1, k + 1, and k + 2 are printed in duplex mode (mode 1) and sheet k is printed in simplex mode (mode 2). Note that paper sheet k will enter the system after paper sheet k + 1. Furthermore the states x 1 (k) and x 2 (k) are actully redundant but remain in the dynamic graph to facilitate the representation of the synchronization.

Fig. 5
Dynamic graph of the printer paper flow system of Section 3.2 in duplex mode in the cycles k − 2, k − 1, k + 1, and k + 2, but in simplex mode in cycle k 2. Simultaneous or sequential processing. 3. Fixed or variable route. 4. Input type. 5. Due date or time table. 6. Re-entry.
These features give us information about the types of synchronization that appear in the SMPL model. We will refer to the two applications of Section 3 (production system, printer) and some SMPL systems discussed in the literature (a railway network (Kersbergen et al. 2016), a legged robot (Lopes et al. 2014), and a container terminal (van Boetzelaer et al. 2014)) to illustrate these concepts.

Natural cycle
A natural cycle can be seen as a sequence of events whereafter the behavior of the system repeats itself. This means that after one natural cycle, all jobs enter the system again. In a railway network with a cyclic timetable, the cycle period of the timetable can be regarded as a natural cycle. For a printer the processing of one sheet of paper from the input module to the output module can be seen as a natural cycle. Similarly in a container terminal the processing of one container from quay crane to stack crane is a natural cycle. For a legged robot the natural cycle is defined as the timespan between the moment when all legs have lifted off and the moment they have all touched down again.
It is important to notice that if we choose a natural cycle it is not said that all events in a new cycle appear in the same order or appear at all: some jobs may follow another route, or the order of processing operations at the resources may be different, but the (semi-)cyclic behavior is still recognizable.
We can distinguish two cycle types for an SMPL model: -Batch cycle or multi-job cycle: Every cycle consists of a batch of jobs. Sometimes the system works according to a specific periodic timetable with a fixed cycle period (railway network); sometimes multiple jobs are clearly linked by synchronization (legged robot). -Product cycle or single-job cycle: The system is based on handling products in a (semi-)cyclic way (paper flow in printer, container terminal, production system). The cycle time may be different for each product. The cycle counter can be regarded as a 'product'-counter.
2. Simultaneous or sequential processing The processing on the resources can take place in two different ways: sequentially or simultaneously. In the sequential case there is only one operation possible on a resource at the same time. The next operation on the resource has to wait until the present operation has completely finished (e.g. the printing of paper in the image transfer station has to be done sheet by sheet). In the simultaneous case, multiple operations can take place at the same resource simultaneously (e.g. multiple trains may run on the same track between stations, given a separation by the headway time). Simultaneous processing is usually due to an aggregation of smaller segments. For example most railway systems have block sections with signals to separate the trains. To analyze and control a railway network the overall model will then become too complex. In that case we aggregate a number of blocks to one block and separate trains by headway constraints.

Fixed or variable route
In some applications there are multiple possible routes for the jobs. However there are also applications where the routes of the jobs are fixed and only the order of the events may change (this happens in railway systems (Kersbergen et al. 2016)). If both the routes and the order of the jobs are fixed, e.g. because operations from future cycles always come after operations from the current cycle, the SMPL system will only have one mode and we obtain an MPL system.

Input type
As mentioned before, u(k) can take different forms. It can represent a reference under which the system needs to be operated: this is the case in a railway network where trains can never leave earlier than indicated by the reference (time table). In a printer the time instant at which paper is fed to the system can be chosen by the user and also in the case of a production system the input can be controlled. Later on in Section 7 we use the input to control the SMPL system. 5. Due date or time table The due date is defined as the time instant at which a job should be finished. A time table gives the desired time instant at which a job should start. Due dates and time tables are both a kind of reference signal, but they act in a different way on the SMPL system.
The entries of a time table can be seen as a lower bound on the states (e.g. in a railway system). If we consider the time table as a fixed input, the time table constraint becomes a max-plus equation on the state and this fixed input.
For some systems (e.g. the production system) there may be due dates that define when a job should be finished. The due date is a desired upper bound on the state and may be so strict that it cannot be satisfied. The violation of the due date can then be minimized using model predictive scheduling. This will be discussed in Section 7. 6. Re-entry A job consists of a number of operations on a sequence of resources. Usually each resource in this sequence is only visited once during the job. However, for some applications the job visits the same resource twice or more. We then talk about re-entry. In the printer example we already saw that in the duplex case the paper runs through the image transfer station twice. In the re-entry case we will then assign two states for this operation, to distinguish between the time that the first operation on that particular resource and the second operation.
Overview In Table 1

Scheduling and SMPL models
In Section 3 we have reviewed some examples of applications from scheduling in which the system was described by SMPL models. In this section we will discuss how to derive an SMPL model description for scheduling in a structured and generic way.
In the previous sections we have seen that an SMPL model can switch between different modes. In some applications the number of possible mode can be very large. In that case it is often better to parameterize the modes. There are three ways to do this parametrization: Mode parametrization: We consider the set of all possible modes and enumerate the set so that the specific mode number is the parameter. Integer parametrization: If the set of all possible modes is large it is sometimes easier to describe the mode by a tuple of integers. The integers may describe features like the ordering of the operations for a specific resource, or determine the route for a specific job. For example in the container terminal case the mode is described by which combination quay crane, automated guided vehicle, and stack crane is used for unloading a specific container. Binary parametrization: Binary variables can describe which of two operations go first for a resource, or can decide whether a synchronization is made or not. Each parametrization has it advantages and disadvantages. Mode parametrization can be used if we have a small scheduling problem with a limited number of modes. For mediumsize problems integer or binary parametrization will be better. If the number of possible modes is small, we can precompute the system matrices for all modes and scheduling can be done by evaluating all possible modes. When the number of modes gets large integer or binary parametrization will lead to more tractable problems. In this section we will consider binary parametrization and study the three basic types of control decisions, namely routing, synchronization, and ordering.

Routing in MPL systems
Consider a system that has to operate M jobs. For each job a specific route through the system has to be scheduled and resources have to be ordered accordingly. Let job j ∈ M consist of p j operations on the resources R j = (r j,1 , . . . , r j,p j ) in processing order, and let T j (k) = (τ j,1 (k), . . . , τ j,p j (k)) be the corresponding processing times in cycle k with τ j,i (k) ≥ 0 for all i, j . Each operation is assigned to a unique machine and is not interruptible. Finally, letx j (k) = x j,1 (k) . . . x j,p j (k) T be the vector with all starting times of the operations of job j . This will give us the following inequalities for all j ∈ M: In max-plus matrix notation this can be written as ⎡ ⎢ ⎢ ⎢ ⎣ x j,1 (k) x j,2 (k) . . .
If we have M jobs, we can collect all starting times in one state vector x(k) and we obtain: In many applications jobs are not finished within one cycle, but need another cycle to complete. This can happen for example in a railway network with a cyclic timetable, in which a train that leaves a station in cycle k − 1 will arrive at the next station in cycle k. The state equation is then given by Note that in (9) we use an inequality sign instead of an equality sign. This is because the starting times may also depend on ordering and synchronization, which can delay the starting times.
Often there are alternative routes available for the jobs. Alternative routes may result in the same 'product' (e.g. various machines in production line may execute the same operation) and sometimes the route may be changed to make another 'product'.
Let there be L alternative sets of routes for this system; then for each set of routes we can define the matrices A job μ, (k) for μ = 0, 1, = 1, . . . , n . Let us now define a set of max-plus binary variables (w 1 (k), . . . , w n (k)) such that if we have the th set of alternative routes for the system in cycle k, we find w (k) = 0 and w j (k) = ε for all j = . Now the job system matrices can be written for μ = 0, 1 as

Ordering operations on resources in MPL systems
Consider a system with n operations, divided over N resources. Following the results of the previous paragraph, let the system allow L sets of alternative routes, parameterized by the max-plus binary variables w(k). Furthermore, let P ∈ B ε n×n , ∈ {1, . . . , L}, be a matrix with max-plus binary entries, where [P ] i,j = 0 if operation i and operation j are executed on the same resource, and [P ] i,j = ε if operation i and operation j are executed on different resources. The matrix P (w(k)) for assignment of the resources can now be expressed as follows: Let H (k) be a separation time matrix, where H i,j (k) = ε is the separation time between operations i and j if they may be scheduled on the same resource and H i,j (k) = ε if operations i and j can never be scheduled on the same resource. Finally, let Z μ (k), μ = 0, 1 be order decision matrices with max-plus binary entries, where [Z μ (k)] i,j = 0 if operation i in cycle k is scheduled after operation j in cycle k + μ, and [Z μ (k)] i,j = ε if operation i in cycle k is scheduled before operation j in cycle k + μ. Define z μ (k) as the vector with the stacked column vectors of matrix Z μ (k), so z μ (k) = vec(Z μ (k)). Then we can use the notation Z μ (k) = Z(z μ (k)).
Finally define the ordering matrices A ord μ (w(k), z μ (k)) = P (w(k)) Z(z μ (k)) H (k) Now the operation ordering constraints in the system can be formulated as follows: Note that certain values of z μ (k) may lead to an infeasible schedule because of cycles in the ordering. An infeasible ordering occurs e.g. when in the case of three starting times of operations x 1 , x 2 , x 3 , we choose an ordering x 1 > x 2 , x 2 > x 3 , and x 3 > x 1 .

Synchronization of operations in MPL systems
Synchronization occurs when a specific operation can only start when a specific operation of another job has finished. In general we can define a number of synchronization modes = 1, . . . , L syn , where for every mode we obtain a system matrix for μ = 0, 1: Now the operation synchronization constraints in the system can be formulated as follows: where for μ = 0, 1: where s μ (k) ∈ B L syn ε are max-plus binary variables for scheduling the synchronizations, where [s μ (k)] = 0 means that synchronization is made and [s μ (k)] = 0 means that synchronization is cancelled. Synchronizations may be coupled and appear in groups (e.g. the synchronization of legs in a legged robot (Kersbergen et al. 2011)), but can also be an isolated phenomenon (e.g. the synchronization of two trains on a platform to give passengers the chance to change trains (Braker 1991)).

Combined A matrix
We have derived four conditions (9), (12), (13), and (16) for x(k). We also have a set of scheduling decision variables from -Routing: w(k).

If we now stack all decision variables into one vector
where L tot is the total number of scheduling variables, then we can write our scheduling model as follows where for μ = 0, 1: Note that by choosing a specific control vector v(k) the system switches between different modes of operation (van den Boom and De Schutter 2006).

Reference and input signal
Some DESs work with a predefined schedule that gives a lower bound for the starting time of the operations in the system (e.g. in a railway system we have a timetable with the departure times of the trains). Let r i (k) be the starting time for operation i according to the given time schedule. To guarantees a lower bound r i (k) on operation i we introduce the constraint For operations without a lower bound on the starting time we choose r i (k) = ε. Some DESs have a input signal that gives the starting time of ta job (e.g. in a production system the input is the time instant at which the raw material is fed into the system). To guarantees a lower bound we introduce the constraint where [B ] ij is the minimum time between the input event u j (k) and state event x i (k) if max-plus binary decision variable v equals 0. Now Eq. 15 can be replaced by For systems without an input signal we can discard the second term.

Final SMPL model
We now have taken into account all the constraints (9), (12), (13), (16), and (17) that determine the starting times x(k). We assume that an event will take place as soon as all constraints are satisfied, which means that we now have an equality in Eq. 18 instead of an inequality: Example 2 Consider the production system from Section 3. In this system there are two routes, so we introduce the max-plus variables w 1 (k) and w 2 (k). Note that because of the fact that the system can only be in one mode at the time, we have w 2 (k) =w 1 (k). Now by choosing the scheduling variable v(k) = w 1 (k) we obtain the system matrices:

Analysis of SMPL systems using dynamic graphs
For max-plus linear system (1) we can determine the precedence graph G(A). The maximum average circuit weight in the precedence graph G(A) is then equal to the largest max-plus eigenvalue λ of the system matrix A (Heidergott et al. 2006). For SMPL systems we use neither the concept of eigenvalue nor the precedence graph because the system matrix A( (k)) may change in every cycle k. We therefore use the concept of maximum growth rate or spectral radius. This section we start with the relation of the maximum average path weight in the dynamic graph and the maximum autonomous growth rate of the SMPL system (van den Boom and De Schutter 2012). Subsequently, we will discuss the controllability of an SMPL system in terms of the dynamic graph. This controllability is of importance when we want to perform scheduling and control of an SMPL system.
In van den Boom and De Schutter (2012) we introduced the maximum autonomous growth rate σ magr : Definition 2 van den Boom and De Schutter (2012) Consider an SMPL system of the form (2) with system matrices A( ), ∈ n . For a given α ∈ R, define the matrices Define the set S fin,n of all n×n max-plus diagonal matrices with finite diagonal entries, so S fin,n = { S | S = diag ⊕ (s 1 , . . . , s n ), s i is finite }. The maximum autonomous growth rate λ of the SMPL system is defined by Now consider the dynamic graph G of an SMPL system with mode switching vector If the number of cycles N runs to infinity we obtain the maximum average path weight. The maximum average path weight σ mapw can be computed as follows: We find the bound We can now summarize this in the following corollary: Corollary 1 Consider an SMPL system of the form (2) with system matrices A( ), ∈ n , and let λ , ∈ n be the maximum eigenvalue for matrix A( ). Then Note the maximum average path weight is the worst case average cycle duration over the set of all possible consecutive mode switching vectors for N → ∞. In optimal scheduling we optimize over all possible consecutive mode switching vectors. This means that in scheduling the maximum average path weight is an upper bound for the makespan divided by the length of the schedule.

Remark 2
The asymptotic growth rate and maximum average path weight is related to the spectral radius (Peperko 2011) and the Lyapunov exponent. For a max-plus-linear system (so n = 1), the maximum autonomous growth rate λ is equivalent to the largest max-plus-algebraic eigenvalue of the matrix A(1).

The next system property we discuss is structural controllability
Definition 3 Baccelli et al. (1992)  are row-finite, i.e. in each row there is at least one entry different from ε.
Strong structural controllability means that all system states can be reached from the inputs for all possible mode sequences. If it is possible to choose the mode (like in case of scheduling) this concept of strong structural controllability is not always useful. We therefore also introduce the concept of weak structural controllability.
Weak structural controllability in the context of dynamic graphs is defined as follows: Definition 4 Kalamboukis (2018) An SMPL system of the form (2) is said to be weakly structurally controllable if there exist a finite positive integer N and a mode sequence˜ = 1 . . . N T ∈ L N such that for any initial state x(k), all state vertices at t = k + N in the dynamic graph can be reached by a path originating at an input node.
Strong structural controllability (or just structural controllability) in the context of dynamic graphs is defined as follows: Definition 5 Kalamboukis (2018) An SMPL system of the form (2) is said to be strongly structurally controllable if if there exists a finite positive integer N such that the system is weakly structurally controllable for all feasible mode sequences.
This last definition corresponds to the definition of structural controllability in van den Boom and De Schutter (2012).

Model predictive scheduling
Model predictive control (De Schutter and van den Boom 2001;Maciejowski 2002) is a one of the most popular advanced control strategies in industry. In this paper we will extend this methodology to scheduling and will therefore refer to it as model predictive scheduling (MPS). One of the main advantages of MPS is that we use the receding horizon principle, which means that we do not optimize the whole schedule at once, but we do this at regular time instants, where in each iteration we optimize only the jobs in the nearest future (over a certain horizon), taking into account the available information of past jobs. By using the receding horizon principle we use this available information past and only consider a limited number of future tasks. This reduces the number of scheduling variables to be optimized, which implies a lower computational burden. A too long computation time can cancel out the time gained by optimizing the schedule, or even deteriorate the total solution.
Apart from the MPC methodology to control SMPL system (van den Boom and De Schutter 2006 one can also using residuation to obtain an appropriate schedule (Alsaba et al. 2006).
In this paper we aim for predictive operational scheduling, which means that based on observations of the system events we can reschedule (reroute, resynchronize, and reorder) the jobs of the system to optimize the performance. This means that in every iteration the optimization has to be done in real time using the available information of the past jobs (accumulated in the state of the SMPL system).
Consider the SMPL system of Eq. 19 and let t be the present time instant. Now we like to compute the optimal future control actions. Define the actual current cycle k as follows: This means that x(κ) ≤ t for κ ≤ k − 1, so these states are all known at time t. Note that parts of the states x(κ) ≤ t for κ ≥ k may also be known. Define the set X t such that for all pairs (i, j ) ∈ X t we have x i (k + j) = x past i (k + j) ≤ t. Apart from the known states also specific scheduling variables and input variables are fixed at time t. Therefore, define the set V t such that for all pairs (i, j ) ∈ V t , v i (k + j) = v past i (k + j) is fixed at time t, and likewise define the set U t such that for all pairs (i, j ) ∈ U t , u i (k + j) = u past i (k + j) ≤ t is fixed at time t.

The optimization problem
The MPS problem can now be formulated as finding the optimal future signal (v(k; t), u(k; t)), j = 0, . . . , N p − 1 that solves the following optimization problem for cycle k and time instant t: subject to where N p is the prediction horizon, and J (k; t) is the performance index for cycle k at time t.
Remark 3 Note that we write x(k; t) rather than x(k), and A(v(k); t) rather than A(v(k)). This is due to the fact that the available information depends on time instant t, leading to a new estimate of the parameters in the system matrices, and therefore a new optimal input sequence (u, v).
The prediction horizon N p determines how far (i.e. how many cycles) we look into the future to optimize the schedule. The choice of N p can be seen as a compromise between global optimality and computation time. Decreasing (increasing) the prediction horizon will result in a shorter (longer) computation time and a worse (better) closed-loop performance.
The performance index J (k; t) expresses a measurement of the efficiency of the chosen control vectors v(k +j ; t), j = 0, . . . , N p −1. In some problems the makespan (i.e. the time difference between the beginning and the end of a sequence of jobs or tasks) will be the most important measure of performance (i.e. for a printer or a container terminal). The smaller the makespan, the higher the performance. For other applications (e.g. for a production system) there is a (known) due date for the finished products and the performance index will be equal to the penalty we have to pay for all delays. Also for a railway system the performance index will be equal to the penalty we have to pay for all delays with respect to a given time table (note that early departures of trains are usually not allowed). Finally, the performance index for a legged robot may vary from following a reference trajectory (with discrete targets at specific time instants) to reaching a final goal as soon as possible.
The performance index J (k; t) can usually be written as where is a conventional binary variable. Further δ, κ j,i , λ i , ρ j,m , and σ j,l are weighting scalars, and n u is the number of inputs of the system. The first term of Eq. 27 is related to the makespan over the prediction horizon (i.e. the total production length over the next N p jobs), the second term is related to the weighted sum of all predicted starting times, the third term is related to the delay of the state events with respect to a specific due date signal x d (k), the fourth term maximizes the inputs u m (k+j ; t) (in manufacturing systems this corresponds to minimizing the number of parts in the input buffers), and the final term denotes the penalty for all changes in routing, ordering, or synchronization during cycle k + j .
Often we like to minimize the global makespan, i.e. the total length of the schedule. Let N tot be the number of job cycles to be scheduled. Then the aim will be to minimize max i x i (k + N tot ; t). If N tot is very big, it is usually better to choose a prediction horizon N p N tot , and the criterion will be to minimize (27) where δ = 1, 0 ≤ κ j,i 1, λ i = 0 and 0 ≤ ρ j,m 1, and 0 ≤ σ j,l 1. A major advantage of a small prediction horizon N p is that the computational complexity of the optimization problem is drastically reduced.
In other cases we like to minimize the sum of delays with respect to a due date signal x d,i (k) i.e. max x i (k + j ; t) − x d,i (k + j) , 0 . We then have δ = 0, 0 ≤ κ j,i 1, 0 ≤ λ i ≤ 1 and 0 ≤ ρ j,m 1, and 0 ≤ σ j,l 1. The relaxed MPS problem is defined as solving (21) subject to Eqs. 23-26, and the inequality constraints Theorem 1 Let (x # , v # , u # ) be an optimal solution of the relaxed model predictive scheduling problem with J # as the optimum. If we define x + (k + j ; t) as follows: and is a solution of the original model predictive scheduling problem.
Proof Recal from Eq. 20 that x(k − 1; t) < t is completely known at time instant t. From (30) we can derive for optimal solution (x # , v # , u # ): Then we compute The term on the right-hand side of the last inequality is equal to x + (k + j ; t), and so we find that if and so x + (k; t) ≤ x # (k; t). This means that x + (k + j ; t) ≤ x # (k + j ; t) for all j = 0, . . . , N p − 1. Associate J # with the value of the cost function for the optimal solution (x # , v # , u # ) and J + with the value of the cost function for the solution (x + , v # , u # ). Note that J is a nondecreasing function in the state x. With x + (k+j ; t) ≤ x # (k+j ; t) we find J + ≤ J # . On the other hand, note that x + is a feasible solution for the relaxed model predictive scheduling problem while x * is an optimal solution. This means that J + ≥ J # . Therefore, J + = J # and (x + , v # , u # ) is a solution of the original model predictive scheduling problem.
Example 3 Consider the production system from Section 3 and Example 2, and let us introduce a signal y d (k) which is a due date for the time instant at which output event y(k) takes place. The cost criterion measures the tracking error or tardiness of the system, which is equal to the delay between the output y(k) and due date (27) with δ = 0, κ i = 0, λ p = 0, p = 1, . . . , 4, λ 5 = 1, 0 ≤ ρ j,l 1, and σ j,m = 0, results in Note that in this example we do not have a reference signal (i.e. r(k) = ε), so constraints (22)-(23) boil down to the set of constraints for j = 1, . . . N p − 1. Together with constraints (23)-(26) this gives us the MPS problem for the production system.

The mixed-integer programming problem
The MPS problem (21), (23)-(30) can be recast into a mixed-integer linear programming (MILP) problem as follows. The scheduling parameters in the MPS problem are either zero or minus infinity. For the actual numerical implementation the infinite value ε cannot be used. The first step will therefore be to replace the max-plus binary variables by conventional binary variables. We use the following approximation where β 0 is a very large (in absolute value) negative number and v (k; t) ∈ {0, 1} L tot is a conventional binary vector. The adjoint of v i (k; t) can be approximated bȳ v i (k; t) = β v i (k; t) Let x max ≥ max i,j x i (k + j), then for β ≤ −x max the solution using the approximation and the original optimization variables will lead to the same optimal solution. Now consider constraint (30). This can be written as a set of constraints: for i ∈ n, l ∈ n, j = 0, . . . , N p − 1. In the absence of a reference signal, we can drop constraint (34). Consider cost criterion (27). Note that the first term and the second term are linear iñ x(k; t), the fourth term is linear inũ(k; t), and the fifth term is linear inṽ (k; t). For the third term we introduce an auxiliary variable e(k; t) = max(x(k; t) − x d (k), 0); then minimizing the third term is equal to minimizing j i e i (k + j ; t), subject to for i ∈ n, j = 0, . . . , N p − 1.
Define the vectors Now cost criterion (21) can be rewritten as a linear cost criterion and the MPS problem can be recast as the following MILP problem: subject toĀ whereb In general, MILP problems are NP-hard (Schrijver 1986). In practice, this means that the worst case computational complexity of a mixed integer linear programming problem grows exponentially with the number of integer values in the problem. Nevertheless, there exist fast and reliable solvers (e.g. CPLEX, Gurobi, XPRESS (Atamtürk and Savelsbergh 2005)) for these problems. Furthermore, the underlying scheduling problem may be not be NP-hard, and may be polynomially solvable (See also Section 9).
Example 4 Consider the production system from Section 3 and Examples 2 and 3. The cost criterion measures the tracking error or tardiness of the system, which is equal to the delay between the output y(k) and due date y d (k) if y(k) − y d (k) > 0, and zero otherwise.

Reparameterizing the MILP
In this section we will discuss the reparametrization of the binary optimization variables of the MILP. The goal is to reduce the number of binary variables in the MILP. The complexity in MILP depends on, among other things, the number of binary variables and the number of constraints. Based on this exponential behavior, the number of binary variables in a MILP is often used as an indicator of the computational difficulty. If we can reduce the number of binary parameters without adding too many constraints, the computation of the MILP may well be reduced. However, the final computational benefits depends on how the MILP optimization problem (21)-(21) is solved, and may depend on the choice of branch and bound algorithm (Bemporad and Morari 1999; Williams 1993). We start with the general idea of reparametrization and then look at two specific cases, namely routing and ordering.

Reparametrization with max-plus functions
We start with the definition of a max-plus function: Definition 6 A scalar max-plus function f : R n ε → R ε is defined by the recursive grammar with i ∈ {1, . . . , n}, α ∈ R ε , and where f k : R n ε → R ε , f l : R n ε → R ε are again scalar max-plus functions; the symbol | stands for "or", and max is performed entrywise.
A vector function f : R n ε → R m ε is an max-plus function if all entries are scalar maxplus functions. A max-plus linear function is an max-plus function. Furthermore from the above definition it is immediately clear that the max-plus product of two max-plus functions is again an max-plus function.
To give an idea how to find an appropriate mapping v(k + j ; t) = f (θ(k + j ; t)) we will discuss reparametrization of the route scheduling variables and the order scheduling variables.

Reparametrization of the routing variables
We start by looking at the routing of the jobs. From Eqs. 9 and 10 we know the routing constraints can be written as In general we can define a max-plus function f such that w i (k) = f i (η(k)). By substitution of w(k) = f (η(k)) in Eq. 10 the number of variables can be reduced. Instead of A job μ (w(k)) we will use the notation A job μ (η(k)).
Note that by the reparametrization the number of scheduling variables is reduced from L to m 0 = log 2 L . The difference between L and m 0 will grow rapidly with increasing L, as can be seen in Table 2.
Remark 4 If L is not an exact power of 2, there will be more permutations of η i (k) andη i (k) than necessary. In that case we can introduce a constraint on η i (k) andη i (k) to describe the allowed set. Let η i (k) be the conventional binary variable associated with the max-plus binary variable η i (k). Then this constraint can be defined as For example, for L = 10, and so m 0 = 4, we add the constraint: 8 η 1 + 4η 2 + 2η 3 + η 4 ≤ 9

Reparametrization of the ordering variables
Next we consider the operation ordering of the p jobs on a resource. From Eq. 12 we know that the ordering constraints can be written as x(k) ≥ A ord 0 (η(k), z 0 (k)) ⊗ x(k) ⊕ A ord 1 (η(k), z 1 (k)) ⊗ x(k − 1) Remark 5 Note that for the case in Example 5 there is no reduction because for p = 3 we find m 1 = 3 and m 2 = 3. For higher values of p however the difference between m 1 and m 2 grows very rapidly, as can be seen in Table 4 8

.4 Parameter reduction
We may conclude that for every job the reduction of the number of routing variables is log 2 L where L is the number of routes for that particular job and that for every resource the reduction of routing variables is ( log 2 p! )/p(p − 1) where p is the number of jobs for that particular resource. Note that in both cases the number of binary variables decreases in a logarithmic way. This is often beneficial for the optimization.

Conclusions
In this paper we have shown that various semi-cyclic discrete-event systems can be modeled as switching max-plus linear (SMPL) systems and that dynamic graphs are a useful tool in the modeling and analysis process. The SMPL model can be applied in the context of scheduling. This can be done by formulating the model predictive scheduling problem, which can be recast as a mixed-integer linear program. We have shown how the number of optimization parameters can be reduced in a logarithmic way, which is often beneficial for the optimization.
As was already stated in Section 7, MILP problems are NP-hard (Schrijver 1986). However the underlying scheduling problem is not always NP-hard, and may be polynomially solvable. In future research we will continue our study on the computational complexity of the scheduling problem defined in this paper. Further we will do an in-depth investigation on how to accurately charaterize the effect of the reparametrization of Section 8 on the computation time.
Bart De Schutter received the PhD degree in Applied Sciences (summa cum laude) in 1996, at K.U.Leuven, Belgium. Currently,he is a full professor at the Delft Center for Systems and Control of Delft University of Technology in Delft, The Netherlands. Bart De Schutter is senior editor of the IEEE Transactions on Intelligent Transportation Systems and associate editor for IEEE Transactions on Automatic Control. His current research interests include control of discrete-event and hybrid systems, multi-level and distributed control, and intelligent transportation and infrastructure systems.