## 3 Task Scheduling with Mixed-Integer Programming
### Task Scheduling with the Kinematic Constraints
Then, we can define two binary vectors to assign tasks to the left and right arms, \(L(\mathcal{T})\) and \(R(\mathcal{T})\), and their size is \(N\). If \(L(\mathcal{T}_{j}^{i})=1\), the left arm is performing \(\mathcal{T}_{j}^{i}\), and 0 means that \(\mathcal{T}_{j}^{i}\) is not processed by the left arm. This definition gives the condition \(L(\mathcal{T}_{j}^{i})+R(\mathcal{T}_{j}^{i})=\mathcal{A}_{j}^{i}\) for \(j=1,\cdots,N\). When \(\mathcal{A}_{j}^{i}=2\) or \(0\), \(L(\mathcal{T}_{j}^{i})\) and \(R(\mathcal{T}_{j}^{i})\) are determined to be (1,1) and (0,0), respectively. However, in the case where \(\mathcal{A}_{j}^{i}=1\), additional constraints are needed. From the result in Section 3.1, the task pairs in that process can be concurrently seen. Assuming that \(\mathcal{T}_{k}^{a}\) and \(\mathcal{T}_{l}^{b}\) need to be processed at the same time and \(\mathcal{A}_{k}^{a}=1\) and \(\mathcal{A}_{l}^{b}=1\), it must be checked whether \(M_{R}(\mathcal{T}_{k}^{a},\mathcal{T}_{l}^{b})=1\) or \(M_{R}(\mathcal{T}_{l}^{a},\mathcal{T}_{l}^{b})=1\). If the former case, the result becomes \(L(\mathcal{T}_{l}^{b})=1,R(\mathcal{T}_{l}^{b})=0,L(\mathcal{T}_{k}^{a})=0,R( \mathcal{T}_{k}^{a})=1\), and if the latter, it becomes 0, 1, 1, and 0, respectively. From \(\mathcal{A}\), most of constraints are decided. However, in the case of \(\mathcal{T}_{j}^{i}\) having no pairs of tasks performed concurrently and \(\mathcal{A}_{j}^{i}=1\), additional constraints are needed. For additional constraints, when \(\mathcal{T}_{j+1}\) is the next sequence of \(\mathcal{T}_{j}\), the distance between \(\mathcal{L}_{e,j}\) and \(\mathcal{L}_{s,j+1}\) is considered. Let us define \(p(\mathcal{L}_{s,j})\), \(p(\mathcal{L}_{e,j})\) as the Cartesian coordinates of \(\mathcal{L}_{s,j}\) and \(\mathcal{L}_{e,j}\). Additionally, we define \(\mathbb{D}\) as the set of distances between the locations. If we define \(d=\|p(\mathcal{L}_{s,j+1})-p(\mathcal{L}_{e,j})\|\), then we can add \(d\) to \(\mathbb{D}\). Because the sizes of \(L(\mathcal{T})\) and \(R(\mathcal{T})\) are \(N\), the number of \(d\) can be obtained \(N-1\). To make the dimensions of \(\mathbb{D}\) the same as \(L(\mathcal{T})\) and \(R(\mathcal{T})\), we add an initial location. Then, the distance between the initial position and first task can be added into \(\mathbb{D}\), making the size of \(\mathbb{D}\)\(N\). The moving distance does not need to be considered when the robot arm will not perform \(\mathcal{T}_{j}^{i}\); when \(\mathcal{A}_{j}^{i}=0\), it has to be zero. Reflecting this condition, the moving distance of the left arm is \(L(\mathcal{T})\cdot\mathbb{D}\) and that of the right arm is \(R(\mathcal{T})\cdot\mathbb{D}\). One condition for these equations to be established is that the left or right arms should not be moved when \(L(\mathcal{T}_{j}^{i})=0\), \(R(\mathcal{T}_{j}^{i})=0\), respectively. From the result of the cross product, the constraints \(D_{t}\geq L(\mathcal{T})\cdot\mathbb{D}\), \(D_{t}\geq R(\mathcal{T})\cdot\mathbb{D}\) when \(D_{t}\) is to be minimized. The formulation that considers every constraint is as follows:

\[ \begin{split}\underset{L(\mathcal{T}),R(\mathcal{T})}{\text{ minimize}}& D_{t}\\ \text{subject to}& D_{t}\geq L(\mathcal{T})\cdot \mathbb{D}\\ & D_{t}\geq R(\mathcal{T})\cdot\mathbb{D}\\ & L(\mathcal{T}_{j})+R(\mathcal{T}_{j})=\mathcal{A}_{j}\qquad \text{for}\;\;j=1,...,N\\ & L(\mathcal{T}_{l})=1,R(\mathcal{T}_{l})=0,L(\mathcal{T}_{k})=0, R(\mathcal{T}_{k})=1\qquad\text{for}\;\;\forall(k,l)\in\mathcal{C}\\ &\qquad\text{when}\;M_{R}(k,l)=1\;\text{and}\;L(\mathcal{T}_{j}) +R(\mathcal{T}_{j})=1.\end{split}  \tag{4}\]

The whole optimization process is shown in Algorithm 2. Line 5 \(\sim\) 8 shows the collision check process of the task in Section 3.1 before optimization. Through this process, the list of conflicting tasks \(\mathcal{C}\) can be obtained. After that, the sequence of time \(t\) can be obtained through the solving stage 1 in Section 3.1 and is shown in lines 9 \(\sim\) 16.