# Tropical Lexicographic Optimization: Synchronizing Timed Event Graphs

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Tropical Algebra

**Remark 1.**

**Definition 1.**

## 3. Tropical Lexicographic Synchronization Programming

#### 3.1. Motivation

#### 3.2. Formulation of the Tropical Lexicographical Synchronization Problem

- Let P be the number of pairs of transitions of the TEG that we want to synchronize.
- Let $\mathcal{L}$ be the list of P pairs of indexes $\left(i\right(p),j(p\left)\right)$ of entries of $x\left[k\right]$ that we want to synchronize, ordered according to a decreasing defined priority. So, for instance, the pair of indexes $\left(i\right(1),j(1\left)\right)$ is more important to be synchronized than the pair of indexes $\left(i\right(2),j(2\left)\right)$. Furthermore, we assume that in a pair $\left(i\right(p),j(p\left)\right)$, ${x}_{i\left(p\right)}\left(k\right)\ge {x}_{j\left(p\right)}\left(k\right)$, i.e., we pre-specify a temporal order on the state in those indexes (the firing time ${x}_{i\left(p\right)}$ comes after the firing time ${x}_{j\left(p\right)}$, or, in the best case, at the same time).
- Let ${\delta}_{p}={x}_{i\left(p\right)}\left(k\right)-{x}_{j\left(p\right)}\left(k\right)$. This is the synchronization index for the ${p}^{th}$ pair, which we want to minimize. Since the ${x}_{n}\left(k\right)$ represent the firing times of the transitions for the ${k}^{th}$ time, ${\delta}_{p}$ represents the delay between the ${k}^{th}$ firing time of transition ${x}_{j\left(p\right)}\left(k\right)$ and the ${k}^{th}$ firing time of transition ${x}_{i\left(p\right)}\left(k\right)$. (So, if ${\delta}_{p}$ equals to 0, the transitions happen simultaneously).

#### 3.3. Lexicographic Optimization Problem

#### 3.4. Tropical Fractional Linear Programming

Algorithm 1: Tropical Dual Function: TDual Algorithm |

Algorithm 2: Tropical Fractional Linear Programming: TFLP |

#### 3.5. Tropical Lexicographic Synchronization Programming

`TLSO(A,B,L,lambda)`in Algorithm 3. The program’s code in the Scicoslab language is listed in Appendix A.3, in which the parameters A and B are Max-Plus matrices. In ScicosLab the Max-Plus denomination is used instead of Tropical. L is the priority pairs list $\mathcal{L}$ represented by a matrix with P rows and two columns, and $\lambda $ is a scalar that is related to the period. The function

`TSLP`returns the optimal ${\mu}^{*}$.

Algorithm 3: Tropical Lexicographic Synchronization Optimization: TLSO |

## 4. Numerical Example

`TLSO`(Algorithm 3, listed code Appendix A.3).

**Obtaining matrix M:**The TLSO algorithm uses the parameters $\lambda $, A, and B to calculate the matrix ${M=\left((-\lambda )A\right)}^{*}B$, as

**Step one:**The algorithm

`TLSO`starts the search by finding an optimal synchronized vector $\mu $ by solving the first optimization problem for the first pair of indexes from the list $\mathcal{L}$.

`TFLP`(Algorithm 2) for these defined variables (w, $\alpha $, f, $\beta $, R, r, S, s). The function returns the variables ${\mu}_{1}^{*}$:

**Second step:**At the second iteration ($p=2$) the pair $(3,8)$ is used, we have $i\left(2\right)=3$ and $j\left(2\right)=8$, being ${I}_{2}$ and ${J}_{2}$:

`TFLP`the result of ${\mu}_{2}^{*T}$:

**Third step:**At the third iteration ($p=3$), we have the pair $(4,7)$, in which we compute ${I}_{3}$ and ${J}_{3}$ correspondent to stages $i\left(3\right)=4$ and $j\left(3\right)=7$:

## 5. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## Abbreviations

DES | Discrete-Event Systems |

TDES | Timed Discrete-Event Systems |

TEG | Timed Event Graph |

TFLP | Tropical Fractional Linear Programming |

TLSO | Tropical Lexicographic Synchronization Optimization |

## Appendix A. Codes of Algorithms

#### Appendix A.1. Code of Algorithm Tropical Dual

`// Implementation of Algorithm1:TDual`

`// Tropical Dual Function`

`function [vnew]=TDual( E, D, e, d )`

`big=1000;`

`itmax=10000;`

`tol=#(0.0001);`

`// initialize upperbound`

`vprev=#(ones(size(E,2), 1)*big);`

`k=0;`

`// stop flags`

`converge=%F;`

`itok=%T;`

`condi=%T;`

`while(~converge & itok & condi)`

`// Recursive Equation (14)`

`vnew=(E∖(D*vprev+d)) &`

`(D∖(E*vprev+e))&vprev;`

`k=k+1;`

`// test conditions (15)`

`condi = and(e <= (D*vnew+d)) &`

`and(d <= (E*vnew+e));`

`converge=sum(vprev-vnew)<tol;`

`itok = (k < itmax);`

`vprev=vnew;`

`end;`

`if ~condi | ~itok`

`vnew=[];`

`end`

`return [vnew];`

`endfunction`

#### Appendix A.2. Code of Algorithm TFLP

`// Implementation of Algorithm2:TFLP`

`// Tropical Fractional Linear Programming`

`function [u,delta]=TFLP(w,alfa,f,Beta,R,r,S,s)`

`n = size(R,1);`

`m = size(R,2);`

`epsn = full(%zeros(n,1));`

`epsm = full(%zeros(1,m));`

`// create the matrices according to (19)`

`E = [ R r ; f Beta ];`

`e = [ epsn ; %0 ];`

`D = [ S s ; epsm %0];`

`d = [ epsn; 0 ];`

`// calls the Dual Method to solve Max TLP in (19)`

`[v] = TDual( E, D, e, d );`

`// verify if the solution is found`

`ifisempty(v)`

`u =[];`

`delta = [];`

`else`

`// convert back to the original variable according to (20)`

`y = v(1:$-1);`

`z = v($);`

`u = y*z;`

`delta= (w*u+alfa)-(f*u+Beta);`

`end`

`return [u,delta];`

`endfunction`

#### Appendix A.3. Code of Algorithm TLSO

`// Implementation of Algorithm3:TLSO`

`// Tropical Lexicographic Synchronization Optimization`

`function [u]=TLSO(A,B,L,lambda)`

`M=star(A-lambda)*B;`

`// maximum possible iterations`

`P=size(L,1);`

`p=1; // first iteration`

`while(p<P)`

`i(p) = L(p,1);`

`j(p) = L(p,2);`

`I(p,:) = M(i,:(p,:),:);`

`J(p,:) = M(j(p,:),:);`

`// iteration constraint Equation (30)`

`w = I(p,:);`

`f = J(p,:);`

`R = I(p,:)+J(p,:);`

`S = I(p,:);`

`// prior constraints (31)`

`n = p-1;`

`while(n>0)`

`R = [ R; J(n,:); I(n,:)+J(n,:)];`

`S = [ S; delta(n)*J(n,:);I(n,:)];`

`n=n-1;`

`end;`

`r = full(%zeros((p-1)*2+1,1));`

`s = full(%zeros((p-1)*2+1,1));`

`[u,delta(p)]=`

`TFLP(w,alpha,f,Beta,R,r,S,s);`

`ifisempty(u)`

`L(p,:) = [];`

`P = size(L,1);`

`else`

`ustar=u;`

`p=p+1;`

`end;`

`end;`

`return [ustar];`

`endfunction`

## References

- Baccelli, F.; Cohen, G.; Olsder, G.J.; Quadrat, J.P. Synchronization and Linearity an Algebra for Discrete Event Systems; John Wiley and Sons: New York, NY, USA, 1992. [Google Scholar]
- Hardouin, L.; Cottenceau, B.; Shang, Y.; Raisch, J. Control and State Estimation for Max-Plus Linear Systems. Found. Trends® Syst. Control
**2018**, 6, 1–116. [Google Scholar] [CrossRef] - Pin, J.E. The influence of Imre Simon’s work in the theory of automata, languages and semigroups. Semigroup Forum
**2019**, 98, 1–8. [Google Scholar] [CrossRef] [Green Version] - Amari, S.; Demongodin, I.; Loiseau, J. Control of linear min-plus systems under temporal constraints. In Proceedings of the 44th IEEE Conference on Decision and Control, Seville, Spain, 12–15 December 2005; pp. 7738–7743. [Google Scholar] [CrossRef] [Green Version]
- Amari, S.; Demongodin, I.; Loiseau, J.; Jacques, J.J.; Martinez, C. Max-plus control design for temporal constraints meeting in timed event graphs. IEEE Trans. Autom. Control.
**2012**, 57, 462–467. [Google Scholar] [CrossRef] [Green Version] - Atto, A.M.; Martinez, C.; Amari, S. Control of discrete event systems with respect to strict duration: Supervision of an industrial manufacturing plant. Comput. Ind. Eng.
**2011**, 61, 1149–1159. [Google Scholar] [CrossRef] [Green Version] - Kim, C.; Lee, T.E. Feedback control of cluster tools for regulating wafer delays. IEEE Trans. Autom. Sci. Eng.
**2016**, 13, 1189–1199. [Google Scholar] [CrossRef] - Gonçalves, V.M.; Maia, C.A.; Hardouin, L. On the Steady-State Control of Timed Event Graphs With Firing Date Constraints. IEEE Trans. Autom. Control
**2016**, 61, 2187–2202. [Google Scholar] [CrossRef] - Majdzik, P.; Seybold, L.; Witczak, M. A max-plus algebra predictive approach to a battery assembly system control. In Proceedings of the 2014 IEEE International Symposium on Intelligent Control (ISIC), Juan Les Pins, France, 8–10 October 2014; pp. 2202–2207. [Google Scholar] [CrossRef]
- Gaubert, S.; Katz, R.; Sergeev, S. Tropical Linear-fractional programming and parametric mean payoff games. J. Symb. Comp.
**2012**, 47, 1447–1478. [Google Scholar] [CrossRef] [Green Version] - Gonçalves, V.M.; Maia, C.A.; Hardouin, L. On tropical fractional linear programming. Linear Alg. App.
**2014**, 459, 384–396. [Google Scholar] [CrossRef] [Green Version] - Zykina, A.V. A Lexicographic Optimization Algorithm. Autom. Remote Control
**2004**, 65, 363–368. [Google Scholar] [CrossRef] - Egmund, R.J.; Olsder, G.J. The (max,+) algebra applied to synchronization of traffic light processes. WODES
**1998**, 26, 451–456. [Google Scholar] - Dias, J.R.S.; Maia, C.A.; Lucena, V.F. A Computationally Efficient Method for Optimal Input-Flow Control of Timed-Event Graphs Ensuring a Given Production Rate. J. Control Autom. Electr. Syst.
**2015**, 26, 348–360. [Google Scholar] [CrossRef] - Butkovic, P.; Aminu, A. Introduction to max-linear programming. IMA J. Manag. Math.
**2008**, 20, 233–249. [Google Scholar] [CrossRef] - Butkovic, P.; MacCaig, M. On the integer max-linear programming problem. Discret. Appl. Math.
**2014**, 162, 128–141. [Google Scholar] [CrossRef] [Green Version] - De Schutter, B.; van den Boom, T.; Xu, J.; Farahani, S.S. Analysis and control of max-plus linear discrete-event systems: An introduction. Discret. Event Dyn. Syst.
**2020**, 30, 25–54. [Google Scholar] [CrossRef] [Green Version] - Komenda, J.; Lahaye, S.; Boimondb, J.L.; Boom, T. Max-plus algebra in the history of discrete event systems. Annu. Rev. Control
**2018**, 45, 240–249. [Google Scholar] [CrossRef] - Umer, M.; Hayat, U.; Abbas, F. An Efficient Algorithm for Nontrivial Eigenvectors in Max-Plus Algebra. Symmetry
**2019**, 11, 738. [Google Scholar] [CrossRef] [Green Version] - Umer, M.; Hayat, U.; Abbas, F.; Agarwal, A.; Kitanov, P. An Efficient Algorithm for Eigenvalue Problem of Latin Squares in a Bipartite Min-Max-Plus System. Symmetry
**2020**, 12, 311. [Google Scholar] [CrossRef] [Green Version] - Cassandras, C.G.; Lafourtune, S. Introduction to Discrete Event Systems, 2nd ed.; Springer: New York, NY, USA, 2008; pp. 53–57. [Google Scholar]
- Blyth, T.; Janowitz, M. Residuation Theory; Pergamon Press: Oxford, UK, 2008; ISBN 9781483157146. [Google Scholar]
- Gonçalves, V.M.; Maia, C.A.; Hardouin, L. On max-plus linear dynamical system theory: The regulation problem. Elsevier Autom.
**2017**, 75, 202–209. [Google Scholar] [CrossRef] - Gonçalves, V.M.; Maia, C.A.; Hardouin, L. Weak dual residuations applied to tropical linear equations. Linear Alg. Its App.
**2014**, 445, 69–84. [Google Scholar] [CrossRef] [Green Version] - Charnes, A.; Cooper, W.W. Programing with linear fractional functionals. Nav. Res. Logist. Q.
**1962**, 9, 181–186. [Google Scholar] [CrossRef] - Marotta, A.M.; Maia, C.A. Modeling and Optimization of Semaphore Networks Via Linear Max-Plus Model: Application to Synchronism and Flow Control in Crossings. In Proceedings of the 47th International Conference on Computer and Industrial Engineering, Lisboa, Portugal, 11–13 October 2017; Available online: https://www.dropbox.com/sh/98wen5smashdq4m/AACHGFgY7Tcj6LzObobWWeJca/CIE47_paper_300.pdf (accessed on 27 August 2020).

**Figure 2.**Using Max-Type Tropical Linear Problem (Max TLP) to solve Tropical Fractional Linear Programming (TFLP) problems (adapted from [11]).

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Mendes Marotta, A.; Mariano Gonçalves, V.; Andrey Maia, C.
Tropical Lexicographic Optimization: Synchronizing Timed Event Graphs. *Symmetry* **2020**, *12*, 1597.
https://doi.org/10.3390/sym12101597

**AMA Style**

Mendes Marotta A, Mariano Gonçalves V, Andrey Maia C.
Tropical Lexicographic Optimization: Synchronizing Timed Event Graphs. *Symmetry*. 2020; 12(10):1597.
https://doi.org/10.3390/sym12101597

**Chicago/Turabian Style**

Mendes Marotta, Alan, Vinicius Mariano Gonçalves, and Carlos Andrey Maia.
2020. "Tropical Lexicographic Optimization: Synchronizing Timed Event Graphs" *Symmetry* 12, no. 10: 1597.
https://doi.org/10.3390/sym12101597