1. Introduction
Production systems have undergone drastic changes in recent years and more radical transformations can be expected. The resulting outcome of this process has been called
Industry 4.0 [
1]. It amounts to replacing traditional 20th century production systems by smart versions, in which almost all features are fully autonomous [
2]. The main components of this new industrial revolution are cyber-physical systems (CPSs) that provide a direct connection between the real and the virtual world [
3]. CPSs allow the real-time integration of decision-making processes with data drawn from the physical shop floor, improving the ability to respond to varying conditions [
4,
5,
6]. In turn, the Internet of Things (IoT) provides the means to interconnect different CPSs yielding a single production system, able to solve decision problems, coordinate tasks, address conflicts, and plan future activities [
7,
8].
Achieving an efficient and coordinated integration of CPSs is not a straightforward enterprise. There are problems both at the interface layers of CPSs and at their inner workings (involving the functionalities of CPS). At the former level, problems usually arise when trying to ensure the interoperability of these systems due to compatibility failures of the communication interfaces [
9]. The goal here is to ensure that information is consistently shared and communicated among all the interconnected CPSs [
10]. In turn, the problems associated with the inner layers of CPS involve the emergence of unforeseen phenomena [
11]. This happens when the behavior of the integrated system cannot be described in terms of the behaviors of its component CPSs, that is, when the whole is greater than the sum of its parts. While emergence has its benefits, it can also lead to unintended consequences.
Thus, integrating independent CPSs poses two major challenges:
Interoperability at the interface level, where incompatibilities in communication protocols and data formats can obstruct the flow of information.
Emergence at the behavioral level, where the global system exhibits new dynamics that cannot be immediately inferred from its components.
In this paper, we address these issues with a formal treatment of the compositional integration of CPSs. Strict control procedures may hamper one of the main advantages of Industry 4.0 systems, namely their flexibility [
1]. This implies that a careful design is needed to provide control and flexibility to systems of interconnected CPSs.
The main questions to be answered in this paper involve the assurances of compatibility of independent CPSs that can be plugged in and out of global systems. Furthermore, there is the question of the scalability of Industry 4.0 systems composed of CPSs. That is, whether plugging in a new CPS can change how a production environment works, and if so, in which way.
We consider how simple I/O systems with internal decision-making capabilities (an abstraction of the concept of cyber-physical systems) can be composed. The ensuing behavior of the larger system can be understood as the composition of the behavior of its component systems. A basic category of CPS-like units allows the definition of a symmetric monoidal structure capturing the characterization of the behavior of their composition. (a related categorical treatment of CPSs can be found in [
12,
13,
14]). A
Hypergraph Category based on this structure includes a fundamental component, namely a
lax monoidal functor, defining an algebra of
behaviors that parallels the composition of CPS-like systems.
One of the main applications of networks of cyber-physical systems is as platforms for Cloud Manufacturing [
15,
16,
17,
18]. This has led to the wider concept of Cyber-Physical Production Systems (CPPSs) [
4,
7], representing the ensemble of sub-systems connected to the environment and among them enhanced Industry 4.0 settings. One of the benefits of CPPS is the possibility of linking directly the shop floor with a higher-level Decision Support System (DSS) [
8,
19], providing real-time data to the DSS as well as offering the shop floor the ability to rapidly adapt to the output of the DSS.
In the case of CPPS, the intrinsic criticality of scheduling production processes becomes even more salient. As pointed out in [
4], scheduling processes constitute one of the main challenges in the design of these systems. In this paper, we address this issue by showing how the lax monoidal functor of behaviors provides a way of formalizing processes of Smart Scheduling [
5].
The following diagram depicts the current issues in the field, our own contribution, and what we intend to achieve.
In
Section 3, we present the mathematical background of Category Theory used in the rest of the paper.
Section 4 discusses the abstraction of CPS, which we call CPS-like. In
Section 5, we show that networks of CPS-like components behave as a CPS-like unit itself by using the properties of a lax monoidal functor in this category.
Section 6 presents the main description of scheduling in CPPS.
Section 7 uses the lax monoidal functor to characterize the solution to scheduling problems.
Section 8 generalizes the framework to ensure the distributed solution of scheduling problems.
Section 9 presents the conclusions.
2. Cyber-Physical Systems and Smart Manufacturing
Cyber-physical systems constitute a cornerstone in the development of Smart Manufacturing environments. They provide a means for integrating new digital capabilities into the physical processes that carry out production activities. In this section, we first show how general manufacturing and decision-making processes leverage cyber-physical technology, and second we present a detailed discussion of how scheduling decision-making processes are affected and redefined under the Industry 4.0 paradigm. After reviewing these two aspects, a final subsection summarizes the motivation of this work.
2.1. Cyber-Physical Production Systems
The Industry 4.0 paradigm focuses on the advantages of digitizing production processes to enhance the automation capabilities of the entire production environment. The key concepts that underpin the Industry 4.0 paradigm are
interconnection,
information transparency/availability,
technical assistance, and
decentralized decision-making. These four concepts enable the implementation of distributed control and the automatization of systems, enhancing the possibility of building more agile and flexible production systems [
20]. The Internet of Things provides the means to interconnect the components and processes of the system, access the collected data in real time, and make them available to a decentralized architecture that benefits from them [
21,
22]. This data flow can be analytically processed by Big Data and Machine Learning tools, as well as with Artificial Intelligence systems, yielding meaningful descriptions of the state of the system. This, in turn, benefits from the technical assistance that Industry 4.0 systems can provide to decision-making processes. The input of the decision-making process is the information processed by these systems [
23,
24]. Finally, since the information is completely digitized, it can be replicated and shared by the sub-processes and sub-systems that need these data to evolve in the production process. Closing the loop, cyber-physical systems convert the output of decision-making processes into concrete actions to apply in the physical world [
1,
25].
This paradigm has led to the description of Industry 4.0 production systems as Cyber-physical Production Systems (CPPSs) [
4]. A CPPS transforms the traditional shop floor, where the information generated by production processes is confined to its machines/assets, into a new shop floor where production machines/assets are interconnected and can be monitored and controlled remotely [
26,
27]. Each machine/asset has a digital representation and a Digital Twin can represent the entire shop floor. The Digital Twin can gather all the information from the shop floor and add it to the information generated by the business functions, facilitating the development of holistic decision-making processes. The information integration into Digital Twins enables the coordination and synchronization of the production process with the logistics processes and other functions [
28,
29]. This flow of information and the associated decision-making processes are represented in
Figure 1. It depicts how the shop floor and the Digital Twin are connected and how the Digital Twin allows the autonomous configuration. Physical processes take place on the shop floor. It is where real-world data are collected (at the lowest level in
Figure 1). Then, these data are transmitted in real time to the Digital Twin. This information is processed at the intermediate level of
Figure 1 and fed into the decision level. The output of the decision level is a production schedule processed by the Digital Twin and enacted by the shop floor.
2.2. Scheduling Decision-Making in Cyber-Physical Production Systems
In industrial settings, the solution of scheduling decision-making problems represents the last process before starting production. Scheduling assigns different production orders to the production resources, respecting the technological restrictions and yielding a timetable of activities. Scheduling problems are solved considering the restrictions proper of the production processes (e.g., operations precedence), and also considering other features proper of industrial companies (e.g., achieving the quality specifications agreed with customers, which demand different types of setups on the machines), all this trying to optimize the performance criteria specified by the firms [
30]. As expected, scheduling is carried out dynamically (i.e., the shop floor fulfills the orders as they arrive). Thus, the status of the shop floor becomes a critical input to the scheduling decision-making process. The functions of production control are closely related to this scheduling process, since any deviation from the production schedule affects the performance of the production system [
31]. This shows why the topic of scheduling has been intensively studied in the context of Industry 4.0 systems in recent years [
32,
33,
34,
35].
According to this, an issue that has gained renewed interest with the emergence of Industry 4.0 is the problem of rescheduling, that is, the selection of corrective actions after disruptive (non-planned) events to diminish their impact [
36]. These disruptions must be detected and analyzed in real time to take corrective actions. Naturally, since these events occur while production is being executed, the nature of the events is dynamic. The sooner these disruptions are detected and the corresponding data are collected, the better the possibility that the corrective actions may be effective. Therefore, information technologies play a central role in detecting and reacting to disruptive events. That is why CPSs leverage the capabilities of Manufacturing Execution Systems to address rescheduling problems. CPSs enable the interconnection of the entire shop floor. Every event on the floor is detected by the CPS sensors. This is translated into meaningful information, allowing the CPSs to analyze potential corrective actions in real time [
1,
37]. While the study of rescheduling processes has attracted the general interest of the research community [
34,
38,
39], most of these approaches have assumed traditional scheduling processes, where the optimal solution is calculated in a centralized manner, i.e., gathering all the relevant information from all the assets/machines [
40]. While these approaches take advantage of certain features of the new information technologies, they do not use the full potential of decentralization processes [
41].
2.3. Motivation
As said, rescheduling processes seek to solve those problems by gathering all the necessary data and re-optimizing decisions in a centralized way. The main argument supporting this approach is based on an integral solution to the problem, applied on the entire system and each of its sub-systems. This way of approaching the problem may not be agile enough to restrict the ability of the system to adapt to new scenarios [
42]. These limitations undermine the capacities of production systems based on CPSs, which incorporate machinery according to the “plug-and-produce” logic. This article addresses this issue, providing the foundations for a possible solution of rescheduling processes in a decentralized and autonomous manner, delegating the task to each sub-system (other approaches to decentralized rescheduling are, for instance, [
43,
44,
45]). To achieve this, it is vital to ensure that the decisions are made by each subsystem or element of the system (in this case CPSs), generating solutions that do not conflict with the decisions of the rest of the elements or subsystems. The decisions made by the individual components are compatible with the rest of the components and the entire system. Consequently, the
emergence of unintended behaviors in decentralized autonomous systems must be avoided, that is, the spontaneous apparition of behaviors that were not planned. This paper proposes an approach based on Category Theory to model each of these subsystems so that decentralized decision processes do not generate the emergence of conflicting situations. Naturally, this line of study contributes to improving the decentralization and scalability of production processes, ensuring the correct interoperability of production processes based on CPS.
Consequently, his article makes the following primary contributions:
The formulation of a Category Theory-based model for cyber-physical systems, enabling a scalable description of their interconnection.
A theoretical framework of decision-making for rescheduling within these systems.
Our approach is purely formal, abstracting away from specific details of CPSs as in [
12]. Even so, the results are intended to contribute a better understanding of these systems. The formal nature of this description may provide a schematics for possible implementations, which are not the object of the present paper.
3. Mathematical Preliminaries
Various mathematical notions are relevant to our treatment. They provide a framework for the connection of generic entities. We assume a basic knowledge of Category Theory [
46].
We start with the concept of a cospan. Consider, in a given category , a central object N with input and output ports, X and Y respectively. N is called the apex of the cospan, while X and Y are its feet. The cospan can be written as , where f and g are morphisms between X and N and Y and N, respectively. Suppose now that another cospan shares Y with the previous one: . These cospans can be composed by connecting the two apexes to obtain a new one, with input X and output Z.
In this way, a cospan can be seen as a morphism between X and Y. To be such, the apex and the feet must be objects in . Furthermore, we need (as the identity morphism) to define a cospan for each object A. This is ensured since is a category.
This definition of a cospan as a morphism allows us to define a category in which the objects are the same as in , while the morphisms are cospans among objects in . We can ensure their compositionality if pushouts are defined in the basis category .
Since we also want compositions in parallel, we need to be able to define a monoidal operation + between cospans. This is enough to have both an initial object and pushouts between any pair of objects in .
If these conditions are fulfilled, is a monoidal symmetric category, i.e., it has the following components:
An initial object I, such that for each object A in there exists a unique morphism .
The coproduct ⊔ in , provides the definition of the functor (monoidal product) .
For each pair of objects A and B, is isomorphic to .
This is ensured if pushouts and an initial object exist in
. This is the case if it is a category with
finite colimits. An important case arises when
is
, whose objects are finite sets. We can restrict our attention to
typed finite sets (
). We define a set
of types and each object in
is
such that
. Each
X can be interpreted as a set of
ports and
indicates the type of each port. It is known that
has finite colimits [
46].
We use to represent . Its objects are called interfaces. The morphisms (cospans) are called wiring diagrams and the apex N is the family of connections. We can thus connect three objects and to obtain a new object Y as a cospan , representing the larger object defined as the network consisting of the objects and .
A
Hypergraph category [
47] is a monoidal symmetric category in which the wiring diagrams constitute
networks (that is, cables can be joined and can bifurcate). Technically, each object is equipped with a
special commutative Frobenius monoid. In the instances to be considered here, this condition is automatically satisfied. It can be described as
where
is a class of types and
is a
lax functor such that, given an operation ⊗ in
, there exists a morphism
f such that
and, given the unit object
I, there exists a morphism
g such that
.
The importance of the existence of a lax functor on is that in we can represent behaviors associated to the structures represented as wiring diagrams. This is particularly true in the case of .
An important result in this paper ensues from considering diagrams of the following form:
where , and are categories and , and L are functors. If for every , there exists a unique morphism
we say that the diagram
t-
commutes.
4. A Representation of CPS
Cyber-physical systems are hard to define with precision. In particular, a definition in terms of their structure is elusive. It seems easier to provide a presentation based on their functionalities:
Cyber-physical systems combine cyber capabilities with physical capabilities to solve problems that neither part could solve alone [
48].
Examples of these range from cars to robots. They act physically on the world as determined by discrete algorithms that adjust their actuators based on sensor readings of the physical state. An abstract representation of a CPS, would thus involve the following elements:
A set of inputs , each of them consisting of a sensor. Each has a type (for instance, a camera has a type representing the fact that takes two-dimensional pictures in time (recorded in discrete periods, i.e., represented by natural numbers)).
A set of outputs , each of them corresponding to an actuator. Again, each of them has a type, identified with its possible action (a robotic arm could make a series of movements, described by , indicating a discrete number of positions in three-dimensional space until reaching the final position).
A set of internal states, , summarizing the entire information processed by the CPS.
A function and another . represents the modification of the internal state upon the reception of new inputs, while sends the adjustments to the actuators, generating new outputs.
One of the main goals in the design of CPS is to ensure their compositional integration ([
48], p. 9). In terms of
Section 3, this would mean ensuring that the cyber-physical systems defined above constitute objects in a hypergraph category.
5. The Hypergraph Category of CPS
Consider a category of CPS, sharing a common set of types of all its inputs and outputs, denoted . Each object X in the category corresponds to a cyber-physical system .
Given two objects,
and
a morphism CPS
is such that
, i.e., the sensors of read at least the same data as those of X.
, meaning that contains the same actuators as .
, that is, the internal states of X constitute a subset of those of .
is the restriction of over , while is the constraint of on .
Then, a morphism indicates that X is a subsystem of .
To complete the characterization of , we define pushouts and an initial object in this category:
Pushouts: Consider three objects X, and and morphisms and . Then, take the pushout of and , denoted , obtained as the largest subsystem common to and such that X is one of its subsystems.
Initial object: Consider the empty system , without inputs, outputs and states. It follows trivially that for every X in .
Then we have the following (the proofs of all the claims can be found in
Appendix A):
Proposition 1. is a category with colimits.
Since is, according to Proposition 1, a category with colimits, we can define cospans in it. Consider again three objects X, and and two morphisms . This is called a cospan from X to .
We can thus define the category of cospans in , denoted which has a symmetric monoidal structure. Its objects are the same as those of and a morphism is a cospan from X to .
Given two morphisms in , and , there exists a morphism that obtains as a composition of the corresponding cospans.
The monoidal structure of is given by
The unit is , the initial object in .
The monoidal product of X and , , is defined as the coproduct .
We now present a diagrammatic language for the composition of CPS. We start by considering a symmetric monoidal category
. By definition, we have
Each object, i.e., a cyber-physical system X, is seen as a -labeled interface. Morphisms yield a wiring diagram. The interpretation is that C is a CPS that “connects” X and (notice that C as an object has inputs and outputs, and , respectively, but to make sense, its states must be “transparent”, i.e., ).
We write
to denote the wiring diagram
. We can, in turn, see this as
The following figure illustrates the wiring diagram where :
We define a hypergraph category with , where the range represents the set of internal states in the whole family of CPS. For every object X in , is understood as the behavior of X, encoded in its internal states.
Let us define an operation such that given two internal states and it yields a unique internal state in , combining s and .
Then, we have
Proposition 2. For any pair of CPS, X and , .
Furthermore, we also have , where is the initial object in and thus in .
We have the following:
Proposition 3. Bhv is a lax monoidal functor.
6. Case Study: Scheduling Problems
Formally, a scheduling problem is the allocation of a family J of jobs, on a set of machines. Each job j consists of a class of operations, such that represents an operation of job j that must be carried out on machine i.
Each operation has an associated pair of starting and stopping times such that its processing time is . Each job j has an associated linear ordering defined on , reflecting the precedence relation between operations. A schedule is an assignment of jobs to machines in the following cases:
Given and , i.e., two operations on the same machine by any two different jobs j and on any given machine i, either or . This means that the operations of two jobs cannot overlap on any machine.
Given and , i.e., two operations of any job j on any two different machines i and , either or . This means that different operations of a single job cannot be carried out simultaneously on different machines.
Denoting by F an objective function of the space of schedules, the scheduling problem is to find yielding the optimal value of .
Scheduling problems are highly dependent on the actual details of the production setting (Job Shop, Flow Shop, etc.). The inclusion of different parameters (delivery dates, preparation times, waiting times, etc.). and the adoption of different objective functions (makespan, total tardiness, maximal tardiness, etc.) leads to alternative statements of the general problem.
The emergence of Industry 4.0 has given rise to new capabilities that must be taken into account in the formulation of scheduling problems, particularly in rescheduling where the availability of information is a key factor. In this sense, the
Tolerance Scheduling Problem that underpins
Smart Scheduling becomes of special interest [
5]. Tolerance Scheduling requires the analysis of the non-planned events, in such a manner that can be easily translated into scheduling parameters and variables, and to define direct rules for triggering decisions.
To address this issue, let us introduce an extra item in the description of a job
j, namely its
delivery date , i.e., the time at which it should be finished. Then, given a schedule
, we can define the
tardiness of job
j as the extra time required to finish it with respect to its delivery date:
where
is the time needed to finish job
j under schedule
while
is the vector of delivery dates of all the jobs. Then, the maximum tardiness of the schedule is given by
In the classical version of this scheduling problem, the goal is to find the schedule that minimizes . In the case of Industry 4.0 processes carried out by a network of CPS, a perhaps more relevant goal is that of generating a range of tolerances for the parameters of the model. Like in the specification of tolerances for manufactured goods allowing a range within which a good can still be considered appropriate, here, we allow for a certain degree of imperfection in the plan carried out.
Formally, given an optimal schedule that minimizes , and the families of parameters and , we seek a maximal interval of variations for them, incorporating an inertia term, , expressing the weight given to the stability of the system. A high indicates that the design favors high stability (high inertia): only a few events may trigger reschedules. That is, given an optimal schedule and a class of intervals such that for each , :
for any schedule . That is, the goal is to maximize the distance between the parameters while ensuring that schedule improves the original objective function up to an inertial factor . If no solution exists, a new schedule must be found under a different vector of delivery dates.
This whole process is described in
Figure 2. It can be seen that the
Tolerance Scheduling problem requires the explicit incorporation of the tolerance that planners would admit. This strategy can be used in autonomous systems.
7. Categorical Scheduling
To translate Smart Scheduling to a categorical language, we start by identifying each machine in M with an object . That is,
For each , there exists .
A wiring diagram , represents the network of machines on which the production plan is carried out.
On the other hand, given the natural ordering of , ⪯, we define a trivial category such that
Then, can be defined as a category in which an object can be interpreted as a job and a machine (or more in general, a network of CPS) on which an operation is carried out.
A morphism
indicates that
precedes
.
Given a CPS , its set of internal states is such that any is a vector , where is a linear ordering of . A further condition is that has to satisfy the consistency conditions on the operations, avoiding overlaps and violations of precedence relations.
We can denote by the set of jobs to be carried out on a CPS . Then, is the direct sum of the sets of jobs corresponding to the m machines. Without loss of generality, we can assume that for each .
A schedule is represented by a functor
under the condition that, given
,
We denote with the functor yielding the optimal value of the original objective function, is the projection on the first component of a cartesian product, and is the category in which its objects are closed real intervals and the morphisms are inclusions among them.
The functoriality of all the aforementioned mappings is predicated on the assumption that, given any morphism
, any such map (say
H) is such that
since flow shop scheduling problems, which underlie Smart Scheduling problems are known to be
-hard in the strong sense [
49]. Then, on jobs, the maps preserve their natural ordering while on machines, if the complexity increases, so does the description of behaviors while tardiness does not decrease. Then, we have the following (an alternative categorical formulation of the solution of scheduling problems presents a similar condition [
50]):
Theorem 1. A schedule π is a smart schedule if the following diagram t-commutes:
In particular, given a wiring diagram , a smart schedule assigns jobs in to the CPS in such a way that the corresponding yields a vector of tardiness that ensures that the actual optimal global tardiness belongs to an interval that is at a distance of the “acceptable” value of tardiness.
8. A Generalization
The implementation of smart schedules in the category is based on distributing the information among the objects , allowing each to solve its part of the problem, yielding . This, of course, is a consequence of the abstract nature of the s.
We omitted the specific details that make the objects in different and how these distinctions induce different responses. But even taking into account those, the question remains on how the CPSs may generate .
A quick initial reading may lead the reader to think that the generation of schedules must the result of a centralized process. The fact is that our formalism can be generalized to ensure the full decentralization of the decision-making procedure.
The key of this is assuming that morphisms among the
s are now endowed with a structure given in [
51] (interesting alternatives to achieve consistent decision-making procedures in distributed systems can be obtained applying
Sheaf Theory [
52] or
forcing in the Zermelo–Fraenkel Set Theory with the Axiom of Choice [
53]):
, the internal hom among and . It can be seen as an object in that summarizes the set of morphisms between and .
Given , a is a category in which each object is triple :
- -
, where is a space of states, capturing the dynamics of the interaction between and .
- -
, assigning to the current state one of the input/output operations of .
- -
updates the state in response to that pattern, i.e., .
Consider as an example a system in which two subsystems and yield a full system. has input port C and output port B, while has input ports A and B and output port C.
For any state of a -coalgebra , we have that gives a morphism in that can be depicted as
Given , is the updated state in , which in turn may yield a new connection among and .
In this generalized framework, Theorem 1 still applies, but now , arising from the distributed computation.
9. Conclusions
In this work, we presented a Category Theory-based framework for modeling cyber-physical systems (CPSs) in Industry 4.0 environments, with particular emphasis on scheduling. We addressed the problem of ensuring consistency in the composition of CPSs while providing a mathematical foundation for decentralized decision-making processes in the resulting interconnection of cyber-physical components.
We developed an abstraction of CPSs and constructed a mathematical framework that precisely captures their behavior and interactions. This offers a foundation that can address the inherent complexity of Industry 4.0 environments. The formalization includes a symmetric monoidal structure within a basic category of CPS-like units, allowing for a precise characterization of compositional behavior. This mathematical structure enables formal reasoning about how systems behave when interconnected, providing assurances about the predictability of combined behaviors.
The categorical framework directly addresses two critical challenges identified in CPS integration:
Interoperability at the interface level: the framework provides formal guarantees about the compatibility of communication interfaces when distinct CPS are connected, addressing the frequent issue of incompatible communication protocols and data formats.
Emergence at the behavioral level: by formalizing the compositional integration of CPS, the framework supports emergent behaviors that arise when independent systems are combined. This is particularly relevant as emergence can lead to unintended consequences in Industry 4.0 systems.
This theoretical foundation for decentralized and autonomous decision-making is particularly suited for analyzing scheduling and rescheduling in Industry 4.0 environments. They often fail to mantain global consistency, but in our approach, production systems respond to disruptions without requiring complete system reconfiguration. More precisely, a contribution of our framework is in its capacity to prevent conflicts between decisions made by individual system components. By formalizing the relationships between component behaviors, we ensure that local optimizations do not produce globally suboptimal or conflicting outcomes. Smart Scheduling, characterized by the application of the lax monoidal functor in the category of CPSs, formalizes the design of rescheduling processes in those cases.
Future work involves a more detailed analysis of this framework, particularly in the light of real-world instances. This will contribute to the development of automated Smart Schedulers. The categorical language used here facilitates their implementation in typed languages and even in LLMs.