Advances in robotic technology are enabling the introduction of mobile robots into manufacturing environments alongside human workers. By removing the cage around traditional robot platforms and integrating dynamic, final assembly operations with human-robot teams, manufacturers can see improvements in reducing a factory’s footprint and environmental costs, as well as increased productivity [heyer2010human]. For human workspaces associated with final assembly, tasks need to be quickly allocated and sequenced (i.e., scheduled) among a set of robotic agents to achieve a high-quality schedule with respect to the application-specific objective function while satisfying the temporal constraints (i.e., upper and lower bound deadline, wait, and task duration constraints), as well as spatial constraints on agent proximity for safe and efficient collaboration with human workers. The problem of resource optimization is made difficult by the inter-coupled constraints requiring a joint schedule rather than allowing each agent to compute their work plans independently.
Conventional approaches to scheduling typically involve formulating the problem as a mathematical program and leveraging commercial solvers or developing custom-made approximate and meta-heuristic techniques. Exact algorithms aim to find the optimal schedule based on enumeration or branch-and-bound, making them computationally expensive and unable to scale to large, real-time scheduling. Exact methods often rely on hand-crafted, “warm-start” heuristics unique to each application. Alternatively, heuristic approaches are lightweight and often effective; however, designing application-specific heuristics requires extracting and encoding domain-expert knowledge through interviews and trial-and-error-based research, a process which leaves much to be desired. Furthermore, accurately and efficiently extracting this knowledge remains an open problem [raghavan2006active].
To overcome the limitations of prior work, we build on promising developments in deep-learning-based architectures (i.e., graph neural networks) to learn heuristics for combinatorial problems. Analogous to the convolutional neural networks for feature-learning in images, graph neural networks are able to hierarchically learn high-level representations of graph structures through convolutions and backpropagation. Yet, these approaches have only been developed for simpler scheduling problems, such as the traveling salesman problem[khalil2017learning, kool2018attention], in which the graph is fully apparent and and the graph’s edges are undirected. Conversely, multi-robot scheduling is a fundamentally different problem in which the graphical structure is a directed, acyclic graph with latent, disjointed temporal and spatial constraints that must be inferred.
In this paper, we develop a novel graph attention network (GAT) [velickovic2018graph] model to learn scheduling policies that reason about the underlying simple temporal network (STN) structure [dechter1991temporal]
and auxiliary constraints for multi-robot allocation and sequencing. Our GAT method is non-parametric in the number of tasks, meaning that the model can learn a policy from problem formulations of one size while still being able to construct schedules for task sets much larger than seen during training. This non-parametricity is relatively unique in machine learning but is fundamental to scheduling problems as the needs of the manufacturer evolve minute by minute. An added benefit is that our approach can leverage imitation learning from smaller problems in which supervised examples can be generated with exact solution methods, without the need for application-specific warm-start specifics, and still be fine-tuned with reinforcement learning on large-scale problems that are computationally intractable for exact approaches. We combine imitation learning with deep Q-learning to learn a heuristic policy for scheduling, allowing for fast, near-optimal scheduling of robot teams. The combined framework is illustrated in Fig.1. We demonstrate that our approach is able to find solutions for >90% of problems for two robots scheduling up to 50 tasks with proximity constraints versus only 20% by prior state-of-the-art methods.
Ii Related Work
Task assignment and scheduling for multi-robot teams is an important class of problems with applications to manufacturing, warehouse automation, and pickup-and-delivery [nunes2017taxonomy]. Our focus is on the single-task robots (ST), single-robot tasks (SR), time-extended assignment (TA) category with cross-schedule dependencies [XD] under the iTax taxonomy proposed by [korsah2013comprehensive]
. Formulating the problem into a mixed-integer linear program (MILP) yields MILP-based solution techniques with exponential complexity, leading to intractability for factory operations[brucker1999resource]. One popular way to accelerate the computation is to combine MILP and constraint programming (CP) methods into a hybrid algorithm using decomposition [benders1962partitioning, ren2009improved, jain2001algorithms], but the performance may be limited by the decomposition quality. These approaches do not scale beyond a few agents and dozens of tasks.
Other hybrid approaches integrate heuristic schedulers within the MILP solver to achieve better scalability characteristics. [chen2009project] incorporated depth-first search (DFS) with heuristic scheduling. Additional approaches perform cooperative scheduling by incorporating Tabu search within an MILP solver [tan2004linearized] or by applying heuristics to abstract the problem to groupings of agents [kushleyev2013towards]. Researchers have also sought to apply metaheuristic techniques, including simulated annealing (SA) [mousavi2013hybrid]
and genetic algorithms (GAs)[zhang2015object] to specific scheduling problems. [dai2013energy] combined GAs and SA to further improve upon solution quality.
Some have pursued heuristic-learning for solving scheduling problems with approaches using policy [zhang1995reinforcement] and Q-learning [wang2005application, wu2011novel]. Yet, the common limiting factor of these methods is that they are either not multi-agent or they do not handle the robust set of temporal and spatial constraints that we consider (i.e., cross-schedule dependences [XD]). Moreover, these methods depend on customized features to achieve satisfying results.
To address these limitations, we consider recent advances in graph neural networks (GNN) that extend deep neural networks to handle arbitrarily-structured data [zhou2018graph]. Recently, GNNs have been used to solve combinatorial optimization problems, including the traveling salesman problem (TSP) [khalil2017learning, kool2018attention]. In these prior works, the node embeddings obtained from GNNs are combined with reinforcement learning algorithms to construct solutions. However, their models use undirected, unweighted graphs, and thus, are not suitable for multi-robot task allocation and scheduling problems, which use inherently directed, acyclic graphs often modeled as simple temporal networks (STNs) [barbulescu2010distributed, coltin2013online, nunes2015multi, gombolay2018fast]. To the best of our knowledge, we are the first to leverage GNNs in solving STN-based scheduling problems.
Iii Problem Statement
We consider the problem of coordinating a multi-robot team in the same space, both with and without resource/location constraints. We describe its components, under the XD (ST-SR-TA) category of the widely accepted taxonomy proposed in [korsah2013comprehensive], as a six-tuple . are the robot agents that we assume are homogeneous in task completion. are the tasks to be performed. Each task is associated with a start time and a finish time and takes a certain amount of time for each robot to complete. We introduce as the time origin and as the time point when all tasks are completed, so that the schedule has a common start and end point. is the deadline constraint that specifies a task has been completed before a certain time point. is the wait constraint that specifies the relative relationship between two tasks (e.g., “task should wait at least 25 minutes after task finishes” means ). is the list of all task locations. At most, one task can be performed at each location at the same time. Finally, is an objective function to minimize that includes the makespan and possibly other application-specific terms.
A solution to the problem consists of an assignment of tasks to agents and a schedule for each agent’s tasks such that all constraints are satisfied, and the objective function is minimized. We also include the mathematical program formation of our problem in Eq. 1-9. We consider a generic objective function (Eq. 1), as application-specific goals vary. In Section VI, we consider minimizing the makespan (i.e., overall process duration), which would be .
Here we introduce two types of binary decision variables: 1) = 1 for the assignment of robot to task and 2) = 1 denotes task finishes before task starts. is the set of task pairs that use the same location and is derived from . Eq. 2 ensures that each task is assigned to only one agent. Eq. 3-5 ensure that all the temporal constraints are met. Eq. 6-7 ensure that robots can only perform one task at a time. Finally, Eq. 8-9 account for task locations that can only be occupied by one robot at a time. In Section VI, we employ an exact benchmark (i.e., a mathematical program solver) to solve a linearized, mixed-integer form of these equations to improve computation time.
Iv Representation: Graph Networks
Multi-robot task allocation and scheduling problems have been commonly modeled as STNs, because the consistency of the upper and lower bound temporal constraints can be efficiently verified in polynomial time. However, as we develop multiple agents, physical constraints, etc., we also have latent disjunctive variables that augment the graph to account for each agent being able to perform only one task at a time and for only one robot to occupy a work location at a time. This scheduling scenario is known as the Disjunctive Temporal Problem [tsamardinos2003efficient]. GNNs are an ideal choice for reasoning about STNs given their graphical nature. However we must expand on prior work to handle both the directed nature of these graphs, as well as the disjunctive component from multi-robot coordination in time and space. These extensions are a key contribution of this paper.
Modern GNNs capture the dependence of graphs via message-passing between the nodes, in which each node aggregates feature vectors of its neighbors from previous layers to compute its new feature vector. Afterlayers of aggregation, a node ’s representation captures the structural information within the nodes that are reachable from in hops or fewer. Systems based on GNNs have demonstrated ground-breaking performance on tasks such as node classification, link prediction, and clustering [zhou2018graph]. Here, we make use of the graph attention layer (GAT) proposed in [velickovic2018graph], which is a variant of a graph convolutional layer that introduces an attention mechanism to improve generalizability and modify its structure to make it suitable for representing a STN.
Initial Node Features–In a STN, each task is represented by two event nodes: its start time node and finish time node . An example of a STN consisting of 3 tasks is shown in Fig. 2
. Given the partial schedule at the current step, we generate the initial input features of each node. The first N+1 dimensions are the one-hot encoding denoting the robot to which this task has been assigned, where N is the number of robots. For example, [0 1 0 … 0] indicates the task is assigned to robot # 2, and [0 … 0 1] means that the task has not been assigned to any robot. We use [1 1 … 1 0] to denote the placeholder start and finish nodes of the entire schedule,and , respectively. The next two dimensions demonstrate whether this node represents the event start time [1 0] or finish time [0 1]. The next M dimensions are a one hot encoding of the location number the task uses, in which M is the number of total locations. In total, the input feature describing each node is an (M+N+3)-dimension binary vector, based on the current partial schedules of all robots. This set of input features is more expressive than that of prior approaches addressing the simpler TSP [khalil2017learning, kool2018attention] that only considered the (x,y) position of each node.
Structure Adaptation: The original graph attention network developed by [velickovic2018graph] is only able to incorporate undirected, unweighted graphs, yielding that model insufficient for scheduling problems in which temporal constraints are represented by the direction and weight of the edge between the two corresponding event nodes. As such, we make two improvements for the message passing and feature update phases as shown in Fig. 2: 1) The message passing follows the same direction of the edge (i.e., only the incoming neighbors of a node are considered); 2) Edge information is also aggregated when updating the node feature, which is done by adding a fully-connected layer inside each GAT layer that transforms the edge weight into the same dimension as the node feature using . As a result, the output node feature is updated by Eq. 10, where is the set of neighbors of node i, is the weight matrix applied to every node, is the node feature from the previous layer, and are the attention coefficients. To stabilize the learning process, we also utilize the multi-head attention extension, as described in [velickovic2018graph]. A multi-headed layer consists of independent GAT layers computing nodes features in parallel and concatenating those features as the output.
Attention Coefficients–The GAT layer computes the feature embedding for each node by weighting neighbor features from the previous layer with feature-dependent and structure-free normalization, which makes the network non-parametric in the number of tasks. The pair-wise normalized attention coefficients are computed as shown in Fig. 2 using Eq. 11, where is the attention weight to be learned, and edge features are also being utilized. LeakyReLU nonlinearity (with negative input slope = 0.2) is used and followed by a softmax normalization.
V Learning Scheduling Policy
We first formulate scheduling as a sequential decision-making problem, in which individual robots’ schedule are collectively, sequentially constructed from empty in a rollout fashion. At each decision step, the policy picks a robot-unscheduled task pair and assigns that unscheduled task to the end of that robot’s schedule. This step repeats until all tasks are scheduled. We further impose the requirement that a robot which is assigned a task at a later step in the process cannot begin that task until all previously scheduled tasks have been started by their respective robots. Next, we formalize the problem of constructing the schedule as a Markov decision process (MDP) using a four-tuplethat includes:
States: State at step indicates the graph updated with partial schedules of robots. As we encode each robot’s partial schedule into the input feature of GNN, can be expressed as the graph embedding
of all the partial schedules and is obtained by averaging over all node features extracted by the GNN.
Actions: Action = , corresponds to appending an unscheduled task into the partial schedule of robot . Task embedding is the average of the extracted features of start and end nodes, and .
Transitions : Transitions correspond to adding the edges associated with the action into the STN and updating the partial schedule of the selected robot.
Rewards : The immediate reward of a state-action pair is defined as the change in makespan of all the scheduled tasks after taking the action. We divide the change by a discount factor if the next state is not a termination state. The reward is multiplied by -1.0, as we are minimizing the total makespan. A large negative reward is returned if the action results in an infeasible schedule in the next state.
We aim to learn a policy that schedules tasks and agents following the decision-making process. To enable combining imitation learning with deep Q-learning, we define an evaluation function, , that calculates the total reward of taking action at step . Then, our goal is to approximate the evaluation function with a neural network parameterized by weights . takes as input the concatenation of graph embedding and task embedding and outputs
scores estimating the total rewards of appending taskto each of the robots’ partial schedule. As a result, we obtain a greedy policy that selects a task and a robot at each step to maximize the Q value with corresponding action. Fig. 1 illustrates the overall training architecture.
Opportunistic Variant–We also introduce a variant of the policy, which uses time-based rollout to generate the schedule. Starting from (here refers to time points instead of decision steps), at each time step, the policy first collects all the available robots not working on a task into a set . Then, , the policy tries to assign using where only Q values from are used. To make this variant more robust, the schedule action is discarded if the lower bound of the picked task’s start time is greater than current time. We compare both the baseline and opportunistic variant of our algorithm in Section VI.
V-a Imitation Learning
Although obtaining optimal solutions of large-scale scheduling problems is computationally intractable, it is practical to optimally solve smaller-scale problems with exact methods. Furthermore, we can use these exact methods to automatically generate application-specific examples for training an imitation learning algorithm without the need for the tedious, non-trival task of developing application-specific heuristics to warm-start the solver. Finally, we typically have access to high-quality, manually-generated schedules from human experts that currently manage the logistics in manufacturing environments. We believe that exploiting such expert data to train the scheduling policy can greatly accelerate the learning process [piot2014boosted].
We aim to leverage such data by initially training the network on expert dataset that contains all the state-action pairs of schedules either from exact solution methods or the domain experts. For each transition, we directly calculate the total reward from current step until termination step using and regress towards this value as shown in Eq. 12
, where the supervised learning loss,, is defined as the Euclidean distance between the and our current estimate based on graph embedding and embedding of the task selected by the expert .
To fully exploit the expert data, we ground the Q values of actions that are not selected by the expert to a value below using the loss shown in Eq. 13, where is the task embedding associated with alternate actions not chosen by the expert, is a positive constant used as an offset, and is the number of alternate actions at step .
Consequently, the gradient propagates through all the unselected actions that have Q values higher than . We select empirically during training. Note the difference from [piot2014boosted] in that they only train on the unselected action with the max Q value. The total supervised loss is shown in Eq. 14, where is the L2 regularization term on the network weights, and are weighting parameters assigned to different loss terms empirically.
V-B Deep Q-learning
This approach to imitation learning with expert data helps the policy to encapsulate the decision-making characteristics of exact algorithms on a smaller scale (or domain experts with high-quality, but suboptimal schedules on a larger scale) in a data-efficient manner. However, in practice, we find that the performance of a trained policy often decreases after a certain amount of training steps, not only on the testing data but also on the training data. We argue that having is beneficial in the short-run, but relying on ultimately introduces too much “bias” in a way that prohibits finding the desired, latent Q-function.
To address this issue, after initial pre-training solely via imitation learning, we transition to training the model with self-play data generated by running an -greedy version of the trained policy on the training problems. This training process falls into the classic deep Q-learning framework [hessel2018rainbow]. The loss for self-play data uses a 1-step reward with double Q-learning [van2016deep] and is calculated as shown in Eq. 15, where is the target network, and .
For small-scale problems, we combine with the supervised loss to further train the network, which yields better performance. In this case, we assign a weighting parameter to before adding it into Eq. 14. For larger-scale problems, where expert data is not available, we use to fine-tune the network after initializing with weights trained on smaller-scale problems.
Vi Results and Discussion
We evaluate the performance of our model on randomly-generated problems simulating multi-agent construction of a large workpiece, e.g. an airplane fuselage. We generate problems involving a team of two robots in different scales: small (16–20 tasks) and large (40–50 tasks), both without and with proximity/location constraints (i.e., no two robots can be in the same location at the same time). We also generate problems involving a team of five robots with location constraints. Task duration is generated from a uniform distribution in the interval. In keeping with distributions typically found in manufacturing environments, approximately 25% of the tasks have absolute deadlines drawn from a uniform distribution in the interval [1, * 5], where is the number of total tasks. Approximately 25% of the tasks have wait constraints; the duration of non-zero wait constraints is drawn from a uniform distribution in the interval . We set the number of locations to be the same as the number of robots, and each task’s location is picked randomly. For small and large problems of each robot setting, we generate 1,000 training and 1,000 testing problems. For supervised learning on small problems, Gurobi provides expert schedules, with a cutoff time of two minutes for two-robot problems and 15 minutes for five-robot problems.
–Our code implementation uses pyTorch[paszke2017automatic], and the graph neural networks are built upon Deep Graph Library (https://www.dgl.ai). We apply a three-layer GAT to learn node features. Each layer uses 8 attention heads computing 64 features. The last GAT layer uses averaging while the first two use concatenation to aggregate the features from each head. The Q network uses two fully-connected layers with a hidden dimension of 64. We preprocess the STN using Floyd Warshall’s algorithm to find its minimum distance graph as the input graph [dechter1991temporal]. We set = 0.95 and use Adam optimizer [kingma2014adam] through training. Imitation learning uses a learning rate of , = 0.8, and = 0.1. Deep Q-learning uses a learning rate of , = 0.8, = 0.1, = 2, and = 0.05. The target Q network is updated every 5,000 steps.
Benchmarks–We benchmark our model against a ubiquitous heuristic algorithm, earliest deadline first (EDF), as well as the state-of-the-art scheduling algorithm for this problem domain, Tercio [gombolay2018fast]
. EDF works by selecting from a list of available tasks the one with the earliest deadline and assigns it to the first available worker. Tercio is a hybrid algorithm combining mathematical optimization for task allocation and analytical sequencing test to ensure temporal and spatial feasibility. Results are normalized to the exact solution.
We evaluate our model on two metrics: 1) Proportion of problems solved and 2) Adjusted makespan. To calculate the adjusted makespan, we assign a value, , as the makespan of problems not solved by the algorithm, which was the reward signal we employed to train our algorithm. We employ a model ensemble (size = 3) during testing, in which we run 3 models picked from different training steps on the same problem and use the schedule with the minimum makespan as the final output. Fig. 3 shows the proportion of problems solved of our approach and for the baseline methods for problems with two robots without (Fig. 3) and with (Fig. 3) location constraints and for five robots with location constraints (Fig. 3). Fig. 4 shows the adjusted makespan score, normalized to the value found by the exact method, of our approach and for the baseline methods for problems with two robots without (Fig. 4) and with (Fig. 4) location constraints and for five robots with location constraints (Fig. 4).
For scheduling two robots without location constraints, the opportunisitic variant achieved the best results (99.8% of problems solved with 16–20 tasks and 99.8% for problems with 40–50 tasks). While this variant also achieved the best results for small problems involving two robots with locations constraints, the decision step-based counterpart achieved slightly higher performance on large problems for two robots with location constraints (86.4% vs. 84.5%). However, the opportunistic variant still performed the best in terms of adjusted makespan. Our trained policy showed consistent, high-performance among different problem sizes, while the performance of EDF and Tercio decreased precipitously when the number of tasks increased (e.g., in Fig. 3, proportion of problems solved dropped from 54.1% on small problems to 17.2% on large problems for Tercio). It should be noted that we only used expert data on small problems during training and relied on Q-learning for fine-tuning on the larger problem sizes. This positive result provides promising evidence that our framework is able to transfer knowledge learned on small problems to help solve large problems. We further evaluated the capability of the opportunistic variant on more difficult problems with five robots and locations constraints in which our algorithm was able to outperform Tercio and EDF (Fig. 3 and 4).
Finally, to show the necessity and benefit of incorporating edge information into the GAT layer, we also trained and evaluated a policy based on the original GAT models, using small problems containing two robots. As expected, the trained policy performed only solved 12.8% and 5.7% of the problems without and with location constraints, respectively. These results further show the power of our approach leveraging graph attention networks to automatically learn to coordinate robot teams in complex scheduling environments.
We presented a graph-attention-network-based framework that can automatically learn a scalable scheduling policy to coordinate multi-robot teams. By combining imitation learning on small problems with deep Q-learning on larger problems in a non-parametric framework, we were able to obtain a deterministic, greedy policy that generated fast, near-optimal scheduling of robot teams. We demonstrated that our network-based policy found at least twice as many solutions over prior state-of-the-art methods in all testing scenarios.