## 2 Materials and Methods
### Basic Traceability Model  
A basic traceability system should offer the following features [3]:  
* Provide access to the properties of all relevant items along the supply chain (i.e, raw materials, components, subassemblies, intermediate goods, final products), in all the links in the supply chain, not only on final product level. * It should facilitate traceability both backwards (i.e., where did the final products come from?) and forwards (i.e., what were raw materials eventually transformed into?). * Traceability must be based on systematic recordings and their exchange. * A unit-identification system or numbering scheme must be implemented, guaranteeing that items along the supply chain are uniquely identified. Intermediate products are key elements in the supply chain as they represent the various stages that raw materials go through before becoming final products. Trackingthese intermediate products is required for ensuring traceability, quality control, and efficient supply chain management. By accurately monitoring intermediate products, organisations can oversee production progress and quality at each stage, allowing them to identify and resolve issues promptly. This tracking also helps ensure compliance with regulations and standards, while guaranteeing transparency and accountability. According to these key characteristics of a traceability system and the discussion in Section 1, we selected the directed acyclic graph (DAG) as the most suitable data structure for representing a traceability solution due to its ability to model complex dependencies, prevent cycles, and efficiently support the tracing of materials and products through a multi-stage supply chain. In a traceability DAG, each node will represent an entity (i.e., item or process) in the supply chain. Batches of raw materials are modelled by the initial nodes (i.e., leaf nodes) in the graph. Each of these nodes may store detailed information, such as geographical location and the specific supplier. Note that DAGs naturally allow for the representation of inputs, outputs and (single or multiple) dependencies. In addition, tracing back from any node (i.e., product or intermediate) to its source nodes is straightforward, which helps in identifying the origins of each material. Each edge in a DAG represents a step in the supply chain, such as transformations, manipulations, transportation, and storage. Intermediate nodes depict intermediate products or stages in the supply chain. DAGs are inherently designed to track dependencies and processes: by following the edges, it is possible to trace the path of materials and products through each stage of the supply chain, ensuring that each step is recorded and can be audited. To sum up, DAG nodes represent batches of materials or products in specific locations or transformation stages, and DAG edges represent the transformations or movements of these batches (i.e., inputs and outputs). Each node may carry metadata about the batch, such as unique batch identifiers, quantities, and timestamps. Similarly, each edge may also carry metadata about the modelled transformation or movement, such as number of units from each input batch involved or CO\({}_{2}\) fingerprint information. This approach provides efficiency in tracing and supports both backwards and forward tracing. Given a final product, it can be efficiently traced back through its predecessors to identify all the raw materials and intermediate steps involved, which facilitates quality control, recalls, and audits. Conversely, if an issue is identified at a raw material stage, it can be traced forward to identify all products potentially affected. DAGs can model supply chain traces independently of their complexity (cf.