Manuscript Offprint
arXiv:2610.21352Product Costing in Data Pipelines
LI PENG, State Key Laboratory of Blockchain and Data Security, Zhejiang University; Alibaba Group, China
JIE YOU, Alibaba Group, China
FENG SHI, Central South University, China
YIHANG WU, State Key Laboratory of Blockchain and Data Security, Zhejiang University, China
JIANXIN WANG, Central South University, China
WEIRAN LIU, Alibaba Group, China
XINYU PENG*, Zhejiang University; Alibaba Group, China
JUNHUA WANG, Alibaba Group, China
LEI ZHANG, Alibaba Group, China
LIN QU, Alibaba Group, China
XIAOHUI YU, York University, Canada
KUI REN, State Key Laboratory of Blockchain and Data Security, Zhejiang University, China
JINFEI LIU, State Key Laboratory of Blockchain and Data Security, Zhejiang University; Hangzhou High-Tech Zone (Binjiang) Blockchain and Data Security Research Institute, China
Large data-intensive enterprises spend millions of dollars monthly running data pipelines. Apportioning this cost back to individual products, known as product costing, is a prerequisite for data pricing and cost recovery. However, this process is fundamentally more challenging than physical manufacturing costing due to the unique characteristics of data pipelines, including the non-rivalrous nature of data that complicates the costing formulation, the prevalence of cyclic dependencies that distort the accuracy of results, and the massive scale of pipelines that leads to computational intractability.
In this paper, for the first time, we formalize the problem of product costing in data pipelines as a manufacturing cost of data products (MCDP) problem to overcome the non-rivalrous nature of data. To solve MCDP, we propose CostApp, a hybrid algorithm that achieves both exactness and scalability, even for cyclic and massive-scale pipelines. CostApp performs a dimensionality reduction by isolating cyclic dependencies via a feedback arc set (FAS). It aggregates costs onto a compact set of key vertices using a scalable iterative approach, transforming the intractable computational problem into a reduced linear system that can be solved exactly and efficiently by a basic matrix-based method. Experiments on both real-world data and synthetic data show that CostApp scales to process a production pipeline with over 28 million entities within an hour while preserving exactness, supporting pipelines up to larger than the direct matrix-based baseline.
CCS Concepts: • Information systems → Extraction, transformation and loading.
Additional Key Words and Phrases: Data Pipelines, Data Costing, Cost Apportionment, Data Pricing
Corresponding author.
Authors' Contact Information: Li Peng, State Key Laboratory of Blockchain and Data Security, Zhejiang University; Alibaba Group, China, jerry.pl@alibaba-inc.com; Jie You, Alibaba Group, China, youjie.yj@alibaba-inc.com; Feng Shi, Central South University, China, fengshi@csu.edu.cn; Yihang Wu, State Key Laboratory of Blockchain and Data Security, Zhejiang University, China, yhwu_is@zju.edu.cn; Jianxin Wang, Central South University, China, jxwang@mail.csu.edu.cn; Weiran Liu, Alibaba Group, China, weiran.lwr@alibaba-inc.com; Xinyu Peng, Zhejiang University; Alibaba Group, China, steven.pengxy@alibaba-inc.com; Junhua Wang, Alibaba Group, China, junhua.wjh@alibaba-inc.com; Lei Zhang, Alibaba Group, China, zongchao.zl@taobao.com; Lin Qu, Alibaba Group, China, xide.ql@taobao.com; Xiaohui Yu, York University, Canada, xhyu@yorku.ca; Kui Ren, State Key Laboratory of Blockchain and Data Security, Zhejiang University, China, kuiren@zju.edu.cn; Jinfei Liu, State Key Laboratory of Blockchain and Data Security, Zhejiang University; Hangzhou High-Tech Zone (Binjiang) Blockchain and Data Security Research Institute, China, jinfeiliu@zju.edu.cn.
367:2
Li Peng et al.

Fig. 1. An illustration of data pipelines. , denotes a join and project operation in SQL, respectively. represents the version of data entity from the previous day, while entities without superscripts denote the current day's version.
ACM Reference Format:
Li Peng, Jie You, Feng Shi, Yihang Wu, Jianxin Wang, Weiran Liu, Xinyu Peng, Junhua Wang, Lei Zhang, Lin Qu, Xiaohui Yu, Kui Ren, and Jinfei Liu. 2026. Product Costing in Data Pipelines. Proc. ACM Manag. Data 4, 6, Article 367 (December 2026), 37 pages. https://doi.org/10.1145/3856362
Data pipelines in data-intensive enterprises are characterized by consolidation and periodicity, incurring high resource cost and presenting requirements for costing. Data is non-rivalrous in consumption [26, 43, 63], meaning it can be consumed repeatedly without depletion. To leverage this, enterprises integrate processing from numerous business domains into a consolidated digital supply chain, allowing frequently accessed data to be shared across multiple downstream products to maximize reuse value. Consolidated pipelines weave thousands of lineages together, creating a complex, many-to-many dependency graph. As shown in Figure 1, source data (SD) is progressively refined through transformations into intermediate data (ID) and, finally, into valuable data products (DPs) ready for use across various businesses. These transformations include SQL operations (e.g., in Figure 1), Map-reduce jobs or machine learning tasks (e.g., feature extraction). These consolidated pipelines consume massive resources (e.g., CPU, Memory), presenting requirements for cost accounting. Furthermore, these pipelines operate with workload periodicity, typically executing recurrently (e.g., daily extract-transform-load (ETL) jobs) to keep data up-to-date. This continuous and cumulative resource consumption means that even modest unit costs aggregate into substantial financial expenditures over time. For example, at Alibaba, data pipelines incur resource costs equivalent to millions of dollars monthly, a financial burden that continues to escalate as illustrated in Figure 2. Consequently, the interplay of complex consolidated dependencies and long-term periodic consumption makes cost visibility a necessity for operating data pipelines.
367:3

Fig. 2. Resource cost of data pipelines in Alibaba.

Fig. 3. Comparison of approaches.
While resource consumption is distributed across all data entities (SD, ID, DPs), business value is delivered exclusively through the final DPs (via monetization or usage). Thus, DPs constitute the natural unit for financial accountability. We term this product costing in data pipelines, defined as apportioning the total costs of all resources consumed within pipelines to final DPs. This costing method provides the necessary basis for data pricing [15, 43] and cost recovery, where the exactness of the results is critical. Particularly under cost-based pricing models [43], inaccuracies in cost attribution at the DP level can propagate to pricing decisions, potentially leading to systematic mispricing. When aggregated across millions of entities and millions of dollars in costs, such deviations may translate into non-trivial financial losses. Despite its importance to modern data-intensive enterprises, this problem remains largely unexplored in the existing literature.
Challenges. Product costing in data pipelines presents unique challenges not encountered in physical pipelines, as summarized in Table 1.
First, the non-rivalrous nature of data consumption [26, 43, 63] fundamentally challenges cost modeling. In physical manufacturing pipelines, intermediate outputs are typically rivalrous physical goods. The costs embedded in a unit of a physical good are fixed (typically as its marginal cost) and fully transferred downstream upon its consumption. For example, when a car part is used in assembling a vehicle, its cost is fully attributed to that vehicle. Thus, consumption-based costing in physical pipelines naturally upholds the principle of completeness [1] (or break-even [61]), meaning all consumed resources are fully accounted for within the costing without duplication. However, in data pipelines, data is not depleted when used, resulting in (nearly) zero marginal cost for each additional consumption [43]. Applying traditional costing creates a dilemma: allocating cost based on marginal cost [46] leads to severe under-costing, while charging the full cost to every consumer results in massive over-costing, both of which violate completeness. This difficulty challenges the formulation of a cost model that guarantees the completeness of costing.
Second, the workload periodicity of data pipelines leads to a time-versioned nature of data entities, inevitably introducing cyclic dependencies in the lineage graph. For instance, in Figure 1, the generation of relies on joining with , the version of from the previous day ( ). This structural dependency among , , forms a feedback loop or cycle in the lineage graph. Such cycles are pervasive in production pipelines. They cause basic costing methods based on cost roll-up strategy [7] (see §3.3.1) to fail, as costs circulate indefinitely within loops rather than being fully attributed to final data products. Without proper handling, this leads to significant calculation errors that may mislead pricing strategies and incur revenue losses.
Third, the consolidation of data pipelines results in a massive scale of data entities. While traditional physical supply pipelines typically manage a limited number of entities (e.g., thousands of intermediate units), a consolidated data pipeline at large enterprises often comprises tens of millions of data entities with complex dependencies e.g., 28 million vertices in Alibaba. At this
367:4
Li Peng et al.
Table 1. Comparison of physical and data pipelines.
| Physical pipelines | Data pipelines | Unique challenges | |
|---|---|---|---|
| Consumption feature of outputs | rivalrous | non-rivalrous | consumption-based costing not applicable, complicates cost modeling |
| Type of dependencies | acyclic | cyclic | result accuracy of cost roll-up strategy [7] is distorted |
| Scale | small | large | exact costing solutions may be computationally intractable. |
scale, exact costing solutions may become computationally intractable. Specifically, direct algebraic solutions (see §3.3.2) typically require matrix inversion with time complexity. For graphs with millions of vertices, such cubic complexity is prohibitive. Therefore, a practical cost calculation method must be inherently scalable and designed to operate efficiently in a distributed environment.
Contributions. To address these challenges, this paper makes the following contributions:
First, to resolve the dilemma caused by non-rivalrous data consumption, we establish a cost model for data pipelines and formalize product costing as the MCDP problem. Unlike the consumption-based approach, we adopt a ratio-based cost model governed by the cost conservation property (Definition 1 in §3). This formulation guarantees completeness of product costing, ensuring precise cost apportionment to final data products without the under-costing or duplication pitfalls of traditional approaches. To initially solve the MCDP problem, we propose two basic solutions: RollUpApp, a distributed, cost roll-up-based algorithm that scales to large pipelines but only yields approximate results, and MatrixApp, which provides an exact solution via matrix inversion but is limited to small pipelines. These solutions highlight the fundamental trade-off between exactness and scalability, serving as building blocks for our hybrid approach.
Second, we propose CostApp, a hybrid algorithm that achieves both exactness and scalability by strategically integrating our basic methods. The core idea is to decouple the computational complexity by isolating cyclic dependencies. Specifically, CostApp first identifies a feedback arc set (FAS) and strategically inserts auxiliary sink and source vertices on these arcs to isolate these cycles. It then employs the scalable RollUpApp on the resulting acyclic graph to efficiently aggregate costs onto these auxiliary sink vertices and the final data products. This aggregation transforms the problem into a reduced linear system while preserving the final manufacturing cost of data products, which is then solved exactly using MatrixApp. CostApp effectively performs a dimensionality reduction, shifting the bottleneck from inverting a massive matrix (where is millions) to inverting a tiny matrix sized proportional to the feedback arcs ( of , see §5.4). It allows us to solve the MCDP problem with exact results and high scalability. A comparison that highlights its strengths is outlined in Figure 3.
Third, we implement CostApp and conduct comprehensive experiments on both real-world data from Alibaba and synthetic data. Results demonstrate that CostApp successfully reduces a computationally prohibitive problem to a solvable one, achieving both result exactness and high scalability that outperform baselines. It successfully conducts product costing for production pipeline graphs with over 28 million entities in an hour, and has been deployed in the production environments of Alibaba for costing and pricing data for years.
To the best of our knowledge, we are the first to formalize the problem of product costing in data pipelines and to propose a scalable, exact solution. Our contributions are summarized as follows:
-
We establish a data cost model for data pipelines and formulate product costing as the MCDP problem. Then, we propose two basic solutions for this problem: one exact for small pipelines and one approximate for large ones.
-
We propose CostApp, a novel hybrid algorithm that achieves both exactness and scalability for the MCDP problem.
367:5
• We validate the superiority of CostApp through extensive experiments on both large-scale industrial and synthetic data. Our code is released at https://github.com/jerryp1/CostApp.
2 Preliminaries
In this section, we introduce the background knowledge of data pipelines and Pregel-based distributed computation.
2.1 Data Pipelines
In this paper, we focus on consolidated data pipelines that consolidate numerous data transformation tasks (e.g., SQL queries, MapReduce jobs) across diverse business domains for centralized management. Such pipelines have been extensively deployed by major data-intensive enterprises [4, 24, 51, 53]. Their primary objective is to generate high-quality DPs through a sequence of data transformation operations. Typically, these jobs execute in batch mode: reading source data from storage, performing transformations (e.g., cleaning, joining, aggregation, and feature extraction), and persisting the results back to storage. Formally, we denote a processing operation as o, which consumes a set of input data entities to produce a single output data entity. For instance, regarding entity in Figure 1, o corresponds to a SQL join-projection operation . Within these pipelines, three types of data entities are involved:
-
Source data (SD). The starting point of data flow. Typically, they represent raw data collected from users or migrated from other data stores.
-
Intermediate data (ID). The entities that are the output of the computation process but are not yet ready to be used as a product. They are materialized to enable data reuse and reduce redundant computation.
-
Data products (DPs). The final data entities that are ready to be used as products and will not be processed further.
Model data pipelines as a weighted directed cyclic graph (DCG). To model the evolution of data in a structured and traceable manner, we represent the data pipelines using a data lineage [13, 17, 23, 24], a graph-based model that captures how data progresses from its origin to its final form. Specifically, the pipelines are modeled as an edge-weighted directed graph , where
-
V is a vertex set that denotes the set of data entities, such as SD, ID and DPs. The vertices with out-degree 0 (called leaves) represent DPs. The ones with in-degree 0 (called roots) represent SD, and the ones with both in-degree and out-degree at least 1 (called internal vertices) represent ID.
-
A is a directed arc set that represents the transformation flows that produce new data entities from existing ones.
-
is a function that assigns a static cost allocation ratio to each arc, as detailed in §3.
Costing is performed on a billing-period snapshot whose vertices represent logical data entities, not individual runs. All versions of an entity produced within the period are represented by one vertex, and their measured resource costs are summed into that vertex's direct cost (see in §3). For example, under monthly billing, the 30 daily versions of table v contribute to the same vertex. Dependencies observed during the period form the snapshot's arcs. This snapshot therefore preserves the billed cost and dependency structure needed for allocation. As discussed in §1, a dependency on an earlier version appears as a feedback arc, so
367:6
Li Peng et al.
is modeled as a directed cyclic graph (DCG). Other commonly used notations are summarized in Table 2.
Table 2. Notation table.
| Notations | Description |
| and | leaves, roots, and internal vertices |
| (resp., ) | set of all 1-hop upstream (resp., 1-hop downstream) vertices of |
| (resp., ) | in-degree (resp., out-degree) of |
2.2 Pregel-based Distributed Graph Computation
Our solutions adopt the vertex-centric, distributed Pregel model [38]. The graph is partitioned across workers, while each vertex stores only local state, such as an accumulated cost or a label, and exchanges messages with adjacent vertices. Execution proceeds in synchronized iterations called supersteps. In each superstep, a user-defined compute() runs in parallel on every active vertex. It consumes messages sent in the preceding superstep, updates the vertex state, and sends messages for the next superstep. A vertex may call voteToHalt() when it has no work and is automatically reactivated by a later message. The job terminates when all vertices are inactive and no messages are in transit.
This model matches our computation directly. In RollUpApp (see §3.3.1), a message from to carries . Vertex sums all incoming messages and forwards the resulting cost. For a chain stored on different workers, sends its share in one superstep, aggregates it in the next, and the DP receives the final share in the following superstep. FindFAS follows the same message-driven process with labels instead of costs (see §4.2.1), while GetMatrix propagates keyed cost maps (see §4.3.2). Thus, graph partitioning determines where each local computation runs but does not change the algorithm or its result.
3 Problem Formulation and Basic Solutions
In this section, we establish the data cost model in data pipelines (§3.1) and formalize product costing as the MCDP problem (§3.2). Following this, we introduce two basic solutions for the MCDP problem with different limitations (§3.3).
3.1 Data Cost in Data Pipelines
To account for the non-rivalrous nature of data, we establish a structured cost model for any data entity , defining its manufacturing cost as the sum of its own direct cost and allocated upstream costs.
Direct cost (DC). As stated in §1, the manufacturing of data entities in pipelines relies on continuous processes involving periodic computations and ongoing storage. Consequently, the production and maintenance of any data entity incur direct resource expenditures, including CPU usage, memory usage, and storage usage [36, 50, 58, 63]. We define the direct cost, denoted as , as the quantified resource cost incurred solely by producing and maintaining :
where , , denote the respective monetary costs of utilized resources. This value represents the fundamental cost injected into the system. Accordingly, the total cost injected into the pipelines is thus .
Importantly, the specific composition of is orthogonal to our target product costing problem and solutions. Our model is agnostic to the underlying billing mechanisms and can be flexibly adapted to diverse real-world billing policies [58].
367:7
Manufacturing cost (MC). The manufacturing cost of an entity v, denoted as , is defined as the total cost of all resources consumed in manufacturing entity v across its entire production lineage. It comprises the entity's own direct cost and the apportioned costs inherited from its upstream inputs. Formally, for an entity v with upstream inputs , the manufacturing cost is defined recursively as:
Here, is the cost allocation ratio, representing the fraction of 's manufacturing cost allocated to . The second term, , represents the input cost , capturing the cumulative costs inherited from direct upstream dependencies. The following example demonstrates this recursive computation.
Example 1. Consider , , and in Figure 1. Let , , , , . Then, we have , .
Cost allocation ratio . As discussed in §1, consumption-based costing fails to guarantee completeness of costing for non-rivalrous data. To overcome this limitation, a cost allocation ratio is introduced to apportion the manufacturing cost of u to its downstream consumer v. Rather than relying on physical consumption, this ratio-based strategy distributes costs according to relative contribution. To ensure completeness (see Theorem 2), we enforce the following conservation property.
DEFINITION 1 (COST CONSERVATION). A data pipeline graph satisfies the cost conservation property if the sum of cost allocation ratios for any non-leaf node equals unity:
The ratio definition that satisfies the above property is flexible and can be adapted to various allocation strategies, including equal-split, usage-based [50, 58], or value-based strategies [9, 25, 56]. For instance, under a usage-based strategy, the weight can be derived from the normalized data volume read by downstream vertices [50]: where denotes the volume of data read from to produce .
The choice of w determines the resulting allocation, but it does not affect the correctness or asymptotic complexity of our algorithms. This holds for any fixed, nonnegative weights satisfying Definition 1. We justify this claim in §4.4.
3.2 Product Costing in Data Pipelines as an MCDP Problem
Based on the definition of MC, we demonstrate that product costing can be reduced to solving the MCDP problem.
MC of DPs fully captures the total cost of the pipelines. The goal of product costing is to apportion the total direct cost of the pipeline to its final DPs so that every cost is counted exactly once. We call this requirement completeness. A simple example illustrates why completeness is necessary. Suppose an intermediate table A costs 100 and is reused by products B and C. Charging only the near-zero marginal reuse cost allocates none of the original 100, whereas charging the full cost to each product allocates 200 in total. The former under-allocates and the latter duplicates cost.
367:8
Li Peng et al.
Ratios satisfying instead distribute exactly 100, regardless of how the ratio is chosen.
Because the manufacturing cost of each DP includes both its direct cost and all inherited upstream costs, computing these costs for all DPs achieves the product-costing goal above. The following theorem formalizes this connection.
THEOREM 2 (COMPLETENESS OF PRODUCT COSTING). Given a data pipeline graph that satisfy the cost conservation property, the total manufacturing cost of data products (leaf nodes) is equal to the total direct cost injected into the system. Formally:
The proof is demonstrated in Appendix A.1. Theorem 2 shifts product costing to computing the MC of all DPs, which we term the manufacturing cost of data products (MCDP) problem.
DEFINITION 2 (THE MCDP PROBLEM). Given an edge-weighted DCG , a DC vector where for all , the MCDP problem is to compute the MC vector such that each represents the MC of a leaf node (DP) .
Desired goals. We define the desired goals for an algorithm that solves the MCDP problem as follows.
• Exactness. The algorithm must compute the MC for each data product exactly as defined by the cost model (Eq. 2).
• Scalability The algorithm must scale to large data pipelines (e.g., millions of vertices) and complete the computation within a practical time window (e.g., for daily billing cycles).
The necessity of these goals stems from both economic and technical imperatives. First, the exactness of the MCDP solution serves as the foundation for the completeness of product costing. It is fundamental to financial accountability, particularly for data pricing and pipeline optimization. Given that cost-based pricing is prevalent in practice [12, 39, 58] and resource optimization is critical, any inaccuracy risks distorting pricing strategies, eroding revenue, and misallocating budgets. Second, scalability is essential for handling enterprise-level data pipelines, which often comprise millions of entities and require timely cost reporting.
3.3 Basic Solutions
We present two basic solutions for the MCDP problem, RollUpApp and MatrixApp. While neither fully satisfies both exactness and scalability goals simultaneously, they serve as fundamental building blocks for our proposed hybrid approach (see §4).
3.3.1 The RollUpApp Algorithm. A straightforward idea to solve the MCDP problem is to employ the cost roll-up strategy [7, 18, 19, 57], which means aggregating costs bottom-up along the dependency hierarchy. Specifically, in data pipeline lineage graphs, this involves propagating costs from upstream to downstream vertices until accumulation at the leaves. Based on this, we introduce RollUpApp, a scalable algorithm for implementing this propagation.
The core of RollUpApp is an iterative cost propagation mechanism based on a stateful cost variable and a cost roll-up operation CR. Here, represents the cost currently held by v, and initialized with its direct cost i.e., . In each iteration, CR is applied to non-leaf vertices to propagate their costs downstream. is a two-step state update:
(1) Distribute Cost: For each direct downstream neighbor , its cost is updated by adding a proportional share of 's cost: .
367:9

(a) Before CR.

(b) After CR.
Fig. 4. An example of a cost roll-up operation CR.
(2) Reset Cost: The cost at v is set to zero, signifying that its contribution has been fully passed on: .
An example of a CR operation is shown in Figure 4.
Apportion cost via CR Operations based on Pregel. Building upon CR, we introduce RollUpApp that repeatedly applies the CR to all non-leaf vertices to solve the MCDP problem. We adopt a Pregel-based implementation [38] since CR is vertex centric and naturally fits distributed graph processing frameworks. RollUpApp is shown in Alg. 1. It takes as input the graph , the stateful cost variable . The output is the final cost state for all vertices . The algorithm proceeds in supersteps.
Initially, each vertex initiates a new state (line 1). In each superstep, every active non-leaf vertex performs CR operation (line 3). Each vertex collects all incoming costs from the messages received from upstream neighbors and accumulates these into its cost state (line 5). RollUpApp then pushes its current cost to its immediate downstream neighbors according to the edge weights (line 6), and resets its cost to zero (line 7), indicating that its cost is “flowed-away”. The process iterates until all non-leaf vertices become inactive. Finally, the algorithm returns the final cost state for all (line 10). The final cost state of DPs can be extracted from as for .
RollUpApp is scalable to large graphs due to its Pregel-based distributed computing paradigm [38]. For DAGs, RollUpApp is guaranteed to terminate and yield exact results.
THEOREM 3. Given a data pipeline DAG that satisfies the cost conservation property and initialized as , RollUpApp( ) terminates and exactly computes the MC vector where for all leaves (thereby solving the MCDP problem) in at most P supersteps, where P is the length of the longest path in G.
Algorithm 1: RollUpApp (Pregel-style pseudocode)
Input: Graph , direct costs for each
Output:
1 Each vertex sets ; // Initialization
2 while any non-leaf vertex v is active do
3 foreach active vertex v do in parallel
/* CR operation in Pregel style
compute(msgs)
update ;
sends to each ;
updates ;
voteToHalt();
// Reactivated upon receiving a message
9 return
367:10
Li Peng et al.
Proof intuition. Every CR operation conserves cost because its outgoing weights sum to one. In a DAG, cost can advance at least one edge per superstep and can never return to a processed vertex. Hence, after at most the longest-path length P, all cost has reached the leaves. Cost conservation then ensures that each leaf holds exactly its recursively defined MC. The full proof is in Appendix A.2.
Limitations. In graphs with cycles (DCGs), costs circulate indefinitely, preventing the algorithm from terminating naturally. While enforcing a superstep threshold ensures termination, it inevitably leads to approximate results, failing the exactness goal.
3.3.2 The MatrixApp Algorithm. To address the cyclic dependencies where RollUpApp fails, we formulate the cost flow as a system of linear equations.
Linear system formulation. As defined in Eq. 2, the manufacturing costs across a cyclic graph are mutually dependent. For any vertex v, its cost consists of its direct cost and the apportioned costs from its inputs:
Considering all vertices in indexed from 1 to , this forms a global system of linear equations. Let be the vector of manufacturing costs , be the vector of direct costs , is a cost allocation matrix where if there is an arc from to and 0 otherwise, and is an identity matrix. The system can be expressed in matrix form (see Appendix B for detailed derivation) as:
Solving this system for c yields the exact and unique solution to the MCDP problem, formalized as MatrixApp in Alg. 2.
THEOREM 4 (EXACTNESS OF MATRIXAPP). Given a data pipeline graph that satisfies the cost conservation property, MatrixApp computes the exact and unique solution to the MCDP problem.
Proof intuition. Eq. 4 writes all recursive cost equations simultaneously. The weights are nonnegative, and every vertex has a positive-weight path to a leaf. These properties make the spectral radius of W smaller than one, so is invertible. Its unique solution is precisely the MC vector defined by Eq. 2. The full proof is in Appendix A.3.
Limitations. While MatrixApp guarantees exactness, it is computationally prohibitive for large-scale pipelines. Matrix inversion generally incurs cubic time complexity and quadratic space complexity . Even with optimizations for sparse matrices, this approach becomes computationally and memory-prohibitive for pipelines with millions of entities, failing the scalability goal.
Our proposed RollUpApp and MatrixApp for the MCDP problem highlight a fundamental trade-off between exactness and scalability, motivating the need for a hybrid solution.
Algorithm 2: MatrixApp
Input: Cost allocation matrix W, DC vector d Output: MC vector of DPs
1 Compute ; 2 Extract the sub-vector from c; 3 return
367:11

Fig. 5. The key design of CostApp.
4 The Improved Algorithm: CostApp
We introduce CostApp, a novel hybrid algorithm that strategically integrates the strengths of both basic methods to deliver an exact and highly scalable solution for the MCDP problem on cyclic data pipelines. We first overview our approach ( ), followed by a step-by-step detailing of its execution phases ( , ), and conclude with analyses of its correctness and efficiency ( ).
4.1 Overview of CostApp
The high-level idea of CostApp is decoupling and reduction: it transforms an intractable, large-scale problem into an equivalent but easily solvable, compact one. The algorithm CostApp is illustrated in Alg. 3. CostApp operates in two main phases:
Phase 1: Acyclic cost aggregation. This phase uses scalable, distributed graph algorithms to propagate all direct costs throughout the acyclic portions of the pipelines and consolidate them onto a small, well-defined set of terminal vertices. The process begins by identifying the cyclic dependencies using our scalable FindFAS algorithm (line 1) to obtain an FAS. Instead of simply removing these arcs, we isolate the cycles using GraphEdit (line 2), which replaces each feedback arc with a special path through auxiliary sink and source vertices. They effectively isolate the cyclic dependency and render the majority of the graph acyclic, enabling us to use the highly scalable RollUpApp algorithm to efficiently propagate all direct costs (line 5). Upon completion, all costs are precisely aggregated onto a small set of terminal vertices i.e., the original data products and the newly created sink nodes. This sets the stage for an exact solution.
Phase 2: Cyclic cost resolution. With all costs consolidated on the terminal vertices, this phase constructs and solves a compact linear system to resolve the remaining cyclic dependencies. First, we extract the aggregated costs from Phase 1 to form a new, reduced direct cost vector (line 6). We then compute the reduced cost allocation matrix, , using GetMatrix (line 7), which captures the cost-flow relationships only among these terminal vertices. This transforms the original large-scale problem into a compact and equivalent linear system, which we solve exactly and efficiently using MatrixApp* (a variant of MatrixApp, see §4.3.3) (line 8). This final step yields the exact manufacturing costs results for all DPs.
Running example. Figure 6 illustrates the execution of CostApp step by step. For simplicity, we initialize the cost of each vertex to 1. In Phase 1, the ordering labels (orange) generated by FindFAS identify the feedback arc (blue) in step (1.a). Next, auxiliary sink and source vertices (blue) are strategically inserted to isolate the cyclic dependency (1.b). All costs are aggregated onto the terminal vertices (red, including all sink vertices and leaf vertices) by invoking RollUpApp (1.c), zeroing out the remaining vertices (green). Moving to Phase 2, unit costs are injected at the source
367:12
Li Peng et al.

Fig. 6. An illustrative workflow of CostApp.
vertices to construct the reduced cost allocation matrix (2.a). Finally, MatrixApp* is invoked to solve this compact linear system to yield the exact MCs (2.b).
Key design. The core idea of CostApp is the injection of auxiliary sink and source vertices on the feedback arcs to overcome both the cyclic and massive scale challenges ( ). In Phase 1, sink vertices act as collectors to intercept all costs that would flow over feedback arcs. This simultaneously isolates cycles and simplifies cost dependencies, paving the way for formulating a compact equivalent linear system. To resolve this compact system in Phase 2, the source vertices serve as re-injection points. They capture how the intercepted costs at the sink vertices re-enter the original graph, allowing us to obtain a compact cost allocation matrix and efficiently solve this system.
Figure 5 summarizes the key design of CostApp. By strategically injecting auxiliary vertices and integrating RollUpApp and MatrixApp, CostApp shifts the computational bottleneck from a massive matrix inversion to a tiny one (often less than 0.05% of in size, see §5.4). Our design is simple yet effective, achieving a dramatic performance gain while preserving the exactness of results (see Theorem 7). We now detail each phase.
Algorithm 3: CostApp
Input: Graph , direct costs for all
Output: The MC vector of DPs
/* Phase 1: Acyclic Cost Aggregation */
1 ; // (1.a) Identifying cycles
2 ; // (1.b) Isolating cycles
3 Let be the subgraph of without sink-to-source arcs;
4 Let be the set of terminal vertices, comprising the leaves of , i.e., ;
5 ; // (1.c) Aggregating costs
/* Phase 2: Cyclic Cost Resolution */
6 ;
7 ; // (2.a) Getting the cost allocation matrix
8 ; // (2.b) Solving a compact system for final costs
9 return
367:13
4.2 Phase 1: Acyclic Cost Aggregation
The goal of phase 1 is to aggregate all direct costs from millions of internal vertices onto a small set of terminal vertices, while preserving the manufacturing cost of every DP. To achieve this, directly using RollUpApp on the original graph to push cost would fail, as costs would circulate indefinitely in cycles. Our solution, therefore, involves three steps: (1) identifying cycles via finding an FAS, (2) isolating cycles via graph editing, and (3) aggregating costs on the resulting acyclic graph.
4.2.1 (1.a) Identifying Cycles via Finding an FAS. To make cost aggregation possible, we must first break all cycles while preserving the majority of the original graph structure. A standard way in graph theory is to find a FAS, i.e., a subset of arcs whose removal makes the graph acyclic. While finding a minimum FAS is an NP-hard problem [16, 20, 28], for our purpose any valid FAS suffices, as long as it can be computed efficiently on large graphs.
We therefore design a scalable Pregel-style algorithm FindFAS with the following high-level strategy. First, we assign each vertex a hierarchical label. Given these labels, any arc for which the destination label is a prefix of the source label is classified as a feedback arc. The set of all such arcs forms a valid FAS (Lemma 2). Arcs that do not satisfy this prefix condition need not be included in the FAS.
Distributed labeling for vertex ordering. To establish the ordering, we use a synchronous labeling algorithm Label. Each vertex v maintains a label Label(v), represented as a dot-separated sequence of positive integers (e.g., ‘1.2.1’). We use the conventional lexicographic order defined below.
DEFINITION 3 (LEXICOGRAPHICAL LABEL ORDERING). Given two distinct labels and , we say is lexicographically smaller than , denoted , if either:
(1) is a prefix of (i.e., and for all ).
(2) There exists an index such that for all and .
The Pregel-based Label algorithm assigns distinct integer labels to roots and initializes every other vertex with T, a value larger than any valid label. In each superstep, every active vertex v:
(1) collects candidate labels from its upstream neighbors,
(2) adopts the lexicographically smallest candidate if it is smaller than , and
(3) propagates an extended version of its new label, obtained by appending a local outgoing-edge suffix, to its downstream neighbors.
This process repeats until no label changes. In Figure 6(1.a), a root with label ‘1’ proposes ‘1.1’ along its first outgoing branch. The downstream vertex keeps that label if it is smaller than all other incoming label, and then extends it for the next hop. Hence labels grow from an ancestor to its descendants, while every vertex consistently selects one smallest incoming label. The full pseudocode is in Appendix C.
LEMMA 1. Label terminates and assigns a stable label to every vertex in at most supersteps, where is the length of the longest simple path in G.
The proof is similar to the proof of Theorem 3 and we omit it here for brevity.
Finding an FAS. Once Label terminates, every arc falls into exactly one of the following types:
(1) direct forward arc: is a prefix of (e.g., , in Figure 6).
367:14
Li Peng et al.
(2) cross forward arc: Label(u) <lo Label(v) but Label(u) is not a prefix of Label(v).
(3) feedback arc: Label(v) is a prefix of Label(u) (e.g., Label(v_5) = 1.1.1.1, Label(v_4) = 1.1 in Figure 6).
(4) cross backward arc: Label(v) <lo Label(u) but Label(v) is not a prefix of Label(u) (e.g., Label(v_1) = 2, Label(v_3) = 1.1.1 in Figure 6).
Only type (3) arcs constitute . A type (4) arc may lie on a cyclic path, but its destination label is not a prefix of its source label, so it need not be selected.
LEMMA 2. The set
is a valid feedback arc set for G. In other words, is a DAG.
Proof sketch. Consider any directed cycle and let be a vertex on it with the smallest label. Because every vertex keeps the smallest label proposed by its predecessors, traversing the cycle from forces Label to remain a prefix of the labels on that traversal. If is the predecessor of on the cycle, then Label is a prefix of Label, so the closing arc belongs to . Therefore, removing removes at least one arc from every directed cycle, so no directed cycle remains. Appendix A.5 gives the full proof.
Therefore, FindFAS first runs Label and then, in one superstep, marks each incoming arc for which Label(v) is a prefix of Label(u). Its superstep complexity is , dominated by Label.
Figure 6(1.a) illustrates the result. Each vertex receives a hierarchical label (orange), and is selected (blue) because is a prefix of .
4.2.2 (1.b) Isolating Cycles via Graph Editing. Simply deleting the FAS arcs would break the original cost flows. To preserve them while removing cycles from Phase 1, we replace each FAS arc with a path through a sink vertex and a source vertex. The sink retains the cost during Phase 1, and the source marks where that cost resumes its downstream flow in Phase 2.
To this end, we introduce a graph transformation GraphEdit. For each feedback arc , GraphEdit performs the following local rewrite on G:
(1) Remove the original arc .
(2) Create two new auxiliary vertices: a sink vertex and a source vertex , and add them to and , respectively.
(3) Insert three arcs forming the path with , , .
Figure 6(1.b) shows this transformation. The feedback arc is replaced by . Phase 1 accumulates the cost at , and Phase 2 uses to compute how that cost reaches the terminal vertices. Appendix D gives the formal illustration of GraphEdit.
Crucially, this transformation does not change the manufacturing cost of any original vertex. The path in is replaced by an equivalent path in that carries exactly the same cost (due to ), and all other edges remain untouched. As a result, from the perspective of the original vertices, the total cost transmitted along every path is preserved. This is formalized below.
THEOREM 5 (EQUIVALENCE OF MC OF DPS AFTER GRAPH EDITING). Let and be the transformed graph and cost state produced by GraphEdit( , , ). The manufacturing cost for any original data product is identical in both the original system defined on and the transformed system defined on .
The proof is provided in Appendix A.6.
367:15
4.2.3 (1.c) Aggregating Costs on the Acyclic Graph. After graph editing, we obtain a modified graph with additional sink/source vertices and arcs. Let denote the set of sink-to-source arcs . By construction, removing yields an acyclic subgraph . The leaves of , which we call terminal vertices, are
that is, all original DPs (leaves of G) and all newly created sink vertices.
The acyclic structure of allows us to aggregate costs onto the much smaller set without disrupting the MC of DPs. Specifically, we run RollUpApp on (Alg. 3, line 3), initializing each vertex v with its post-GraphEdit cost state . Because RollUpApp correctly transfers all costs to the leaves of an acyclic graph (Theorem 3), it propagates all costs through and consolidates them onto . The following theorem states that this aggregation preserves the MC of every DP.
THEOREM 6 (EQUIVALENCE OF MC OF DPs AFTER AGGREGATING COSTS). Let be the cost state output by RollUpApp( ). The manufacturing cost for any original data product is identical in both the system defined on and the system defined on .
Proof intuition. The internal vertices of have no outgoing path except through a terminal vertex. Because RollUpApp transfers cost without loss or duplication, aggregating the internal costs at the terminal vertices does not change the final total cost received by any terminal vertex. Restoring the isolated sink-to-source dependencies therefore yields the same MC for every DP. The full proof is in Appendix A.7.
As illustrated in Figure 6(1.c), the entire initial direct cost of the pipeline is consolidated onto the much smaller terminal set (highlighted in red). The costs of all other vertices (highlighted in green) are zero, reducing the scale of the remaining cost-flow dependencies.
Phase 1 has used a scalable graph algorithm to transform a large, distributed MCP instance into a compact representation over a small number of terminal vertices, thereby setting up Phase 2 to resolve the remaining cyclic dependencies via a tiny linear system.
4.3 Phase 2: Cyclic Cost Resolution
Phase 2 uses this compact representation to determine how the aggregated costs at sink vertices are redistributed among themselves and ultimately to the DPs . Specifically, contains every direct cost that can reach terminal t without crossing an isolated feedback dependency. These values are sufficient because all non-terminal states are zero, and every remaining cyclic flow must leave a sink , re-enter through its paired source , and reach another member of . The terminal costs and sink-to-terminal transfer ratios therefore form a closed system. Solving it accounts for repeated traversals of the original cycles and recovers the final DP costs without explicitly including any internal vertex with in the reduced system.
4.3.1 Formulating the Reduced Linear System. Our insight is that we can treat the aggregated costs on as new direct costs for this reduced system. We denote this reduced cost vector by , where each entry corresponds to for a terminal vertex in . Consequently, this system follows our original cost definition (Eq. 2) for the final MC of , denoted by :
Here, is a reduced cost allocation matrix that captures how cost flows among these terminal vertices via the isolated cyclic dependencies, where an entry represents the fraction of cost that flows from terminal vertex to .
367:16
Li Peng et al.
This equation has the same form as the system in §3.3.2. Because retains the required nonnegativity and row-sum properties, the reduced system has a unique solution (Appendix A.4). We can therefore solve it exactly with MatrixApp. With already computed in Phase 1, the remaining task is to construct .
4.3.2 (2.a) Getting the Cost Allocation Matrix. To compute , our core idea is to inject unit costs 1.0 into the source vertices and track their propagation through the acyclic graph . By observing how these costs are eventually distributed among the terminal vertices, we can construct the cost allocation matrix.
Recall that , and every sink vertex is uniquely paired with a source vertex via a single sink-to-source arc. A crucial observation is that the -th entry of the matrix, , precisely equals the cost fraction received by the terminal vertex when a unit cost (1.0) is injected at the -th source vertex and propagated through . This holds because any cost flowing from to other terminal vertices must traverse the path starting with . Leveraging this property, we can efficiently compute by injecting unit costs at all source vertices and executing RollUpApp.
Based on this idea, we design GetMatrix to obtain based on Pregel, as shown in Alg. 4. To enable efficient computation within a single Pregel job, we adopt a map-based cost propagation approach. Specifically, instead of a scalar cost, we assign a cost state map to each vertex (line 3) to record {source identifier: cost} pairs. This representation allows the unit costs from all source vertices to be propagated in parallel within a single Pregel job rather than through one job per source, while the identifiers keep their contributions distinguishable when paths merge. We inject unit costs at all source vertices (lines 4-8) and propagate them through using RollUpApp* (line 9). Due to the cost conservation property (Definition 1), the final cost map at any terminal vertex constitutes the i-th column of (lines 10-16). Thus, all columns of are obtained in a single Pregel job, setting the stage for solving the reduced system in the next step.
Map propagation applies each arc weight independently to every value, and values with the same key are summed when paths merge. For example, suppose two sources contribute 0.6 and 0.2 to an intermediate vertex x, giving the map . If x forwards half of its state to terminal t, then t receives . Thus, the keys keep the contributions from different sources separate throughout the propagation.
Note that this map-based approach relies on a variant of RollUpApp that aggregates cost maps by summing values of the same keys. We term this variant RollUpApp and detail it in Appendix E. Noting that GetMatrix (line 7 in Alg.3) and RollUpApp (line 5 in Alg. 3) both operate with Pregel on , they can be merged into a single Pregel workload to avoid duplicated overhead. We denote this merged workload as S&G in the following parts.
4.3.3 (2.b) Solving the Reduced Linear System. With and in hand, we can solve the compact system defined in §4.3.1. Rather than apply MatrixApp to the entire reduced matrix, we exploit its block structure to further reduce the computational cost.
Recall that . We index the rows and columns of by listing first and the DPs second. Since data products are leaves and do not propagate costs, both blocks in the DP row group are zero. Consequently, the reduced allocation matrix is block upper triangular:
Therefore, only the sink block must be inverted, while the DP costs are obtained by matrix-vector multiplication:
367:17
Algorithm 4: GetMatrix
Input: Graph , set of sink vertices , data products , set of source vertices .
Output: Cost allocation matrix
/* 1. Setup and Initialization */
1 Let , ;
2 Initialize as a zero matrix;
3 empty map for each ; // Initiates a cost state map
4 for to do
5 Let be the -th terminal vertex in ;
6 if then
7 Let be the source vertex paired with sink ;
8 ; // Inject unit cost
/* 2. RollUpApp* aggregates maps by summing values of the same keys */
9 RollUpApp* ( )
/* 3. Fill the matrix with the results */
10 for to do
11 Let be the -th terminal vertex;
12 for to do
13 if then
14 ; // Get value injected from , default to 0
15 else
16 ; // Non-sink terminals do not inject costs
17 return
where and are the subvectors of corresponding to data products and sink vertices, respectively. We term this variant as MatrixApp*. This optimization further reduces the dominant inversion cost to , followed by a cheap matrix-vector multiplication. In production data pipelines, is vastly smaller than due to the sparsity of feedback relationships ( , see §5.4).
4.4 Analysis
We now focus on the correctness and complexity of CostApp.
Correctness. To formally prove the correctness of CostApp, we demonstrate that the dimensionality reduction achieved through Phase 1 and Phase 2 preserves this exactness.
THEOREM 7 (CORRECTNESS OF COSTAPP). For any data pipeline graph that satisfies the cost conservation property and initialized as , CostApp calculates the manufacturing cost for all data products exactly, matching the exact results of the global MatrixApp algorithm.
PROOF SKETCH. The proof proceeds by tracing the state transitions across the execution of CostApp. Let be the exact cost vector solving the global linear system (Eq. 4), and is the ground truth of MC of DPs (Theorem 4). First, the transformations in GraphEdit strictly preserve the accumulated costs along any path directed to the leaves, so the costs of all original vertices are
367:18
Li Peng et al.
preserved in the transformed graph (Theorem 5). Second, RollUpApp aggregates all costs along the acyclic partition of the graph onto the terminal vertices. Due to Theorem 6, this aggregation preserves the exactness of MC of DPs. Finally, the remaining dependencies exclusively form a reduced linear system defined on the terminal vertices. Solving this reduced system via MatrixApp* recovers the exact identical solution for the data products as in the global system solved by MatrixApp. The detailed proof is given in Appendix A.8.
Independence from the choice of . The guarantees above hold for any fixed, nonnegative weights satisfying Definition 1. FindFAS depends only on graph topology. The supersteps and messages of RollUpApp and GetMatrix depend on paths and arcs, and the dimension of MatrixApp* depends on . Thus, neither exactness nor asymptotic complexity (see below) depends on the numerical values of .
Complexity. CostApp combines distributed graph processing with a compact linear solve. Table 3 summarizes the complexity of each component. The total complexity of CostApp is the sum of its distributed and centralized components: . The first term, , represents the near-linear complexity of the Pregel-based modules (FindFAS, S&G). These steps handle the bulk of the computation and dominate the overall runtime. The second term, , is the complexity of MatrixApp*, where represents the complexity of matrix multiplication in MatrixApp*.
Table 3. Complexity comparison.
| Algorithm / Module | Scalability | Exactness | Time Complexity |
|---|---|---|---|
| RollUpApp [7] | High | Approximate | |
| MatrixApp | Low | Exact | |
| CostApp | High | Exact | |
| FindFAS | - | - | |
| S&G (RollUpApp + GetMatrix) | - | - | |
| MatrixApp* | - | - |
Notation: is the number of vertices, is the number of arcs, is the size of the feedback arc set, is the number of DPs, is the number of supersteps, are the longest simple path length of , , respectively.
5 Experiments
In this section, we conduct a comprehensive experimental evaluation of our proposed CostApp for the MCDP problem.
Our goal is to answer the following research questions:
-
RQ1: Exactness and Scalability. How CostApp outperform baselines in terms of exactness and scalability?
-
RQ2: Modular Evaluation. What are the performance characteristics of CostApp's individual components, and where are the primary computational bottlenecks?
-
RQ3: Real-world Efficiency. How effective and practical is CostApp when applied to production data pipelines?
5.1 Experimental Setup
Our workloads, including Pregel-based graph computations and SQL queries, are conducted on the MaxCompute platform [11] that is deployed on production clusters at Alibaba (a top-tier global internet enterprise). The concrete platform settings are shown in Table 4. Unless otherwise specified, all tasks are executed based on the setting in Table 4. We denote S&G as the combination
367:19
of RollUpApp and GetMatrix modules in CostApp (lines 5-6 in Alg. 3). MatrixApp* denotes the linear system solver constituted in CostApp (line 8 in Alg. 3).
Table 4. Execution form of modules of CostApp and the setting of platforms.
| Modules | Execution form |
|---|---|
| FindFAS | Pregel |
| GraphEdit | SQL |
| S&G | Pregel |
| MatrixApp* | Single Machine |
(a) Execution form of modules.
| Pregel/SQL | |workers| | 100 |
|---|---|---|
| memory per worker | 30GB | |
| |threads| per worker | 1 | |
| |cpu cores| per worker | 8 | |
| Single Machine | memory | 100GB |
| |cpu cores| | 8 |
(b) Platform settings.
Baselines. We compare CostApp against three baselines operating directly on G: (1) RollUpApp (Alg. 1), a cost roll-up approach [7, 18, 19, 57] that yields approximate results on cyclic graphs, (2) MatrixApp-D, Alg. 2 with an exact global solver using dense LU decomposition [6], and (3) MatrixApp-S, Alg. 2 with the state-of-the-art sparse solver SuperLU [33] to exploit the sparsity of the global allocation matrix W. MatrixApp-D and MatrixApp-S differ only in the matrix representation and solver backend. The submodule MatrixApp* in CostApp applies dense LU decomposition since the reduced inverted matrix in Eq. 6 is dense.
Table 5. Statistics of G1—G4.
| #Vertices | #Arcs | #DPs | |
|---|---|---|---|
| G1 | 28,181,925 | 66,758,378 | 10,003,135 |
| G2 | 11,061,395 | 36,345,530 | 5,805,784 |
| G3 | 712,772 | 3,808,320 | 309,852 |
| G4 | 581,853 | 3,341,002 | 252,812 |

Fig. 7. Degree distribution of G1.
Datasets. We use both real-world and synthetic datasets.
Real-world Datasets: We use four large-scale production data pipeline graphs from Alibaba, denoted as G1–G4, where G1 is the full view of the whole consolidated data pipelines. Their detailed statistics are presented in Table 5. The datasets exhibit scale-free characteristics and the degree of each node in these graphs follows a power-law distribution, with an average degree of each entity 2.5. A graphic view of the degree distribution is shown in Figure 7.
Synthetic Datasets: To systematically evaluate performance under controlled conditions, we use synthetic graphs with varying parameters, including number of vertices, edge density (average degree), and the number of injected feedback arcs. To simulate the degree distribution of the scale-free real-world datasets (as in Figure 7), the graph was generated using a Barabási–Albert model [10]. To obtain a pipeline topology, we orient each BA edge from the existing vertex to the newly added vertex, producing a DAG. We then add a controlled number of later-to-earlier arcs between randomly selected vertex pairs to introduce cyclic dependencies. Weights of graphs are set based on equal-split strategy. The BA model captures degree skew but not every semantic constraint of an industrial pipeline. We therefore use the synthetic graphs to study sensitivity to graph size, density, and feedback sparsity, while the four production graphs G1–G4 evaluate performance on real pipelines.
367:20
Li Peng et al.

Fig. 8. Max relative error across scales.

Fig. 9. Exactness evaluation on G1.

(a) Time vs
(b) Time vs
(c) Time vs
Fig. 10. Comparison of scalability of algorithms.
5.2 Exactness and Scalability
To answer RQ1, we evaluate the exactness and scalability of CostApp compared to our baselines. Unless varied explicitly, the experiments use the default synthetic graph with and to approximate the scale and density of real-world pipelines.
5.2.1 Exactness. Given MatrixApp as the ground truth for exactness (Theorem 4), we evaluate the accuracy of CostApp and RollUpApp by measuring the Maximum Relative Error (MRE) of the estimated MC of DPs compared to the exact MC obtained from MatrixApp. RollUpApp is set to run for a fixed threshold of supersteps (=10) in Figure 8 to enforce termination, while in Figure 9, we track it with various thresholds.
Exactness across data scales. Figure 8 reports the MRE across varying pipeline sizes. CostApp consistently maintains an MRE around , consistent with standard floating-point roundoff, and thus matches the exact solution to machine precision regardless of graph scale. Conversely, RollUpApp suffers from a significant MRE (> 40%) due to unresolved cyclic dependencies. These results are consistent with the exactness guarantee in Theorem 7.
Convergence efficiency. Figure 9 further illustrates the exactness-runtime trade-off on a large cyclic pipeline graph G1. Exactness is measured by 1-MRE. Because unhandled costs circulate indefinitely within loops, RollUpApp requires extensive execution time merely to approach the exact solution asymptotically and does not reach machine precision within the measured time. In contrast, by effectively isolating cycles, CostApp inherently eliminates this convergence bottleneck, matching the exact solution to machine precision within a highly practical runtime (36 minutes).
5.2.2 Scalability. We evaluate the scalability of CostApp by analyzing the runtime performance with respect to various graph characteristics, including the number of vertices ( ), the number of arcs ( ), and the number of injected feedback arcs ( ).
Scalability with respect to and . Figure 10(a) demonstrates the scalability advantage of CostApp. While the baseline MatrixApp-D suffers from cubic complexity and runs out of memory
367:21

(a) Runtime and supersteps

(b) Memory consumption and communicated messages
Fig. 11. Evaluation of Pregel-based modules.
(OOM) on graphs exceeding vertices, CostApp exhibits near-linear scalability, successfully processing graphs with vertices. Although MatrixApp-S is more memory-efficient (see §5.3) than MatrixApp-D due to its exploitation of sparsity, it incurs prohibitive runtime (more than 2 days) for pipelines with more than vertices due to the inherently sequential nature of SuperLU. Similarly, Figure 10(b) shows that the runtime of CostApp scales linearly with the number of arcs ( ). This behavior is consistent with the communication complexity of our Pregel-based modules, where message passing dominates (§5.3). For the arc-scaling experiment, we fix . At this scale, MatrixApp-D runs out of memory, while MatrixApp-S exceeds the two-day time limit, as shown in Figure 10(a). We therefore omit them from Figure 10(b).
Impact of FAS size . Figure 10(c) isolates the impact of cycles by varying while keeping and constant. The results reveal that the total runtime grows with , with a growth curve parallel to that of the MatrixApp* component. The gap between the two curves represents the overhead of the distributed graph processing stages (S&G). Since and are fixed, this distributed overhead remains constant, confirming that the marginal increase in runtime is driven solely by the matrix operations on the reduced graph. This validates that our hybrid design successfully confines the computationally expensive, cycle-dependent workload to a compact algebraic step, preventing the cubic complexity from dominating the entire pipelines.
5.3 Modular Evaluation
We profile the main components of CostApp to answer RQ2. The following experiments use the same default graph setting as in §5.2.
Pregel-based modules. Figure 11 presents the performance of the core Pregel-based modules of CostApp: FindFAS and S&G. In Figure 11a, #SS denotes the number of Pregel supersteps. In Figure 11b, “Memory” is peak memory per worker and “Comm.” is the total number of messages across all workers.
As shown in Figure 11a, both modules demonstrate near-linear scalability with respect to the number of vertices ( ). Notably, the S&G module requires nearly double the execution time of FindFAS when . Figure 11b explains the gap. FindFAS sends more messages because labels propagate broadly, but each message contains only one scalar label. S&G propagates key-value maps ( ), so serialization, merging, and network payload increase with the number of source entries in each map. Its per-message computation and communication cost is therefore higher, so it takes longer despite sending fewer messages. Memory usage for both modules scales moderately, remaining within a manageable 12GB per worker even for graphs with vertices.
367:22
Li Peng et al.

(a) Runtime

(b) Memory consumption
Fig. 12. Evaluation of MatrixApp-D/S and MatrixApp .
Linear system solvers. Figure 12 shows that baselines MatrixApp-D and MatrixApp-S exhibit poor scalability. MatrixApp-D fails beyond vertices due to its space requirement triggering OOM errors (Figure 12b). While MatrixApp-S uses less memory (< 5GB), its runtime becomes impractical (> 2 days) for . In contrast, MatrixApp* scales efficiently to vertices within 360s with a minimal memory footprint. This efficiency is achieved by shifting the computational bottleneck from the global vertex count to the significantly smaller FAS size . By transforming the inversion of a massive matrix into a tiny matrix (e.g., when ), CostApp successfully eliminates the intractable resource demands of algebraic methods, enabling exact costing for large-scale pipelines.
5.4 Real-world Pipeline Evaluation
To validate the performance of CostApp (RQ3) on practical pipeline graphs, we conducted experiments on four large-scale production data pipelines G1-G4 at Alibaba.
FAS size in real-world pipelines. As the size of FAS identified by FindFAS directly impacts the efficiency of the following steps, we first evaluate of G1–G4 as shown in Figure 13. Since FindFAS employs randomized label initialization, the size of the identified FAS ( ) exhibits slight variance. We report the average of 10 runs. Crucially, we observe that is consistently lower than 0.05% of . This result confirms that the cycles in real-world data pipeline graphs are indeed sparse, justifying the design of CostApp that leverages the sparsity of cycles. The small size of FAS is crucial for ensuring the efficiency of the MatrixApp* step.
Overall Performance and Breakdown. We evaluate the performance of CostApp on G1-G4 and present the results in Figure 14.
The production results demonstrate the practical efficiency of CostApp on industrial-scale graphs. On the largest graph, G1, end-to-end execution takes approximately 2250 seconds, which is within the strict time window for a daily billing cycle. Runtime decreases consistently from G1 to G4 as the graph size decreases.
The breakdown of execution time provides deep insight into why CostApp scales. The distributed graph processing stages (FindFAS and S&G) dominate the workload, accounting for over 80% of the total runtime on G1. In contrast, the MatrixApp* step consumes a minor fraction (< 20%) of the time. Most work therefore remains in the near-linear distributed components, while cubic matrix inversion is confined to a small reduced system.
Overall, the results show that CostApp preserves exactness and completes within one hour on all four of Alibaba’s production graphs, each containing millions of vertices.
367:23

Fig. 13. Sizes of FAS on G1—G4.

Fig. 14. Evaluation on G1—G4 and time breakdown.
5.5 Discussion
Comparison with SCC condensation. An alternative approach to solving MCDP is to contract each strongly connected component (SCC), process the resulting DAG in topological order, and solve a local linear system for each non-trivial SCC. This approach is exact, but sparse feedback arcs do not imply small SCCs. For example, suppose the graph is one directed cycle through all vertices. Removing any one arc breaks the cycle, so . SCC condensation, however, places all vertices in one SCC. It must therefore solve a local system, whereas CostApp solves a residual system. Furthermore, multiple non-trivial SCCs (e.g. 1803 SCCs in G1) also require multiple local solves, while CostApp solves one residual system for all feedback dependencies.
The two approaches also organize computation differently. SCC processing must alternate between graph propagation and local solving along the condensation DAG because an SCC cannot be solved until its upstream contributions are available, incurring high runtime. CostApp instead completes scalable graph propagation and then solves one compact residual system, avoiding interleaved execution. The FAS-based reduction is therefore preferable when feedback dependencies are sparse but the SCCs they create may be large. Our experiment on G1 confirms this effect, with interleaved execution making the SCC approach slower than CostApp under the same production configuration.
6 Related Work
6.1 Data Pipelines
Data pipelines, particularly ETL (Extract-Transform-Load) workflows, have been widely studied as the backbone of data warehousing and analytics [8, 14, 29, 49, 59, 60, 62]. They enable the automated extraction of data from diverse sources, support complex transformations to ensure data quality, and facilitate loading into target stores for subsequent analysis or selling. Many big companies embrace data pipelines to build data manufacturing lines and provide business data pipeline platforms, e.g., Meta [51], Alibaba [62], and Google [5]. A typical data pipeline is executed in scheduled mode [40], which minimizes the load on source systems by operating during off-peak hours.
6.2 Cost of Digital Product in Economy
The cost structure of digital products differs fundamentally from that of physical goods, due to major reductions in search, replication, transportation, tracking, and production costs [43]. Search and transportation are made efficient by the Internet, enabling easy discovery and access. Replication costs approach zero, allowing scale, customization, and new models such as bundling and subscriptions [37, 45]. Low tracking costs facilitate personalized pricing, while raising concerns about privacy [21, 41]. Due to free-duplication nature of data, the production cost of data only
367:24
Li Peng et al.
contains fixed cost that is not related to the sharing amount. Thus, the unit production cost can approach zero through sharing as long as sufficient reuse and sales volume. These facilitate the development of innovative pricing strategies and the evolution of data marketplaces [34, 44, 48, 55, 63]. Different from prior works that focus on the cost structure and pricing strategies of digital products, our work aims to product costing in data pipelines, which is a prerequisite for pricing and orthogonal to cost structure.
6.3 Value and Cost Allocation
Prior work also studies how to choose an allocation rule. Shapley-value methods allocate a coalition’s value according to each participant’s marginal contribution and follow well-established fairness principles [9, 47]. In data valuation, they infer contribution from repeated utility evaluations, but exact computation generally requires exponentially many coalitions, so scalable methods rely on approximation or task-specific structure [22, 25, 30, 42, 56, 64]. Our setting instead starts from measured resource costs and a business-selected allocation policy. A value-based rule, including one derived from Shapley values, may determine w. CostApp is complementary to these methods because it computes the exact pipeline-wide costs implied by those weights.
7 Conclusion and Future Work
In this paper, we addressed the critical challenge of product costing in large-scale data pipelines. By formalizing the MCDP problem to account for the non-rivalrous nature of data, we proposed CostApp, a hybrid algorithm that achieves both high scalability and result exactness. By strategically isolating cyclic dependencies, CostApp reduces the computational complexity of exact costing from cubic to near-linear relative to the graph size. Extensive experiments show CostApp scales to process a production pipeline with over 28 million entities within an hour while preserving exactness, supporting pipelines up to larger than the direct matrix-based baseline.
Future work. Our work opens several promising research directions. First, extending CostApp to support explainable product costing. It means the exact cost breakdown of each data product is fully traceable to its upstream origins, and would provide vital insights for fine-grained pipeline optimization. Second, the core capability of CostApp in efficiently solving cyclic, large-scale sparse linear systems holds vast potential beyond data pipelines. It presents a promising pathway for accelerating numerical solvers in much broader domains, such as exact value function evaluations in Markov Decision Processes (MDPs) and solving the Leontief inverse in macroscopic input-output economic modeling [31, 32, 54]. Detailed discussions on these extensions are provided in Appendix F.
Acknowledgement
This work was supported in part by NSFC (U23A20306, 62472378, U25A20430, 62472449), the Zhejiang Provincial Natural Science Foundation for Distinguished Young Scholars (LR25F020001), and the Zhejiang Province Pioneer Plan (2024C01074, 2025C01084).
References
[1] [n. d.]. The audit of assertions. https://www.accaglobal.com/us/en/student/exam-support-resources/fundamentals-exams-study-resources/f8/technical-articles/assertions.html. Accessed: 2025-06-30.
[2] [n. d.]. Breaking Down The Numbers: How Much Data Does The World Create Daily in 2024? http://edgedelta.com/company/blog/how-much-data-is-created-per-day. Accessed: 2025-09-22.
[3] [n. d.]. Building a Simple Data Pipeline. https://airflow.apache.org/docs/apache-airflow/stable/tutorial/pipeline.html. Accessed: 2025-06-30.
[4] [n. d.]. From ETL to ELT: Modernising Pipelines for High-Volume Metrics. https://www.alibabacloud.com/blog/build-and-run-an-etl-data-pipeline-and-bi-with-luigi-and-metabase-on-alibaba-cloud_598152. Accessed: 2025-06-30.
367:25
[5] [n. d.]. Google Cloud Dataflow. https://cloud.google.com/dataflow/docs/overview. Accessed: 2025-06-30.
[6] [n. d.]. LU decomposition. https://en.wikipedia.org/wiki/LU_decomposition. Accessed: 2026-03-20.
[7] [n. d.]. Using the Cost Rollup Process to Calculate Product Costs. https://docs.oracle.com/cd/G24469_01/fscm92pbr53/eng/fscm/scem/UsingtheCostRollupProcesstoCalculateProductCosts-c9fbea.html. Accessed: 2026-03-20.
[8] [n. d.]. What is ETL? https://cloud.google.com/learn/what-is-etl?hl=en. Accessed: 2025-06-30.
[9] Karthik V Aadithya, Balaraman Ravindran, Tomasz P Michalak, and Nicholas R Jennings. 2010. Efficient computation of the shapley value for centrality in networks. In International workshop on internet and network economics. Springer, 1–13.
[10] Réka Albert and Albert-László Barabási. 2002. Statistical mechanics of complex networks. Reviews of modern physics 74, 1 (2002), 47.
[11] Alibaba Cloud. 2025. MaxCompute. https://www.alibabacloud.com/en/product/maxcompute?_p_lc=1. Accessed: 2025-01-10.
[12] Juliana Ventura Amaral and Reinaldo Guerreiro. 2019. Factors explaining a cost-based pricing essence. Journal of Business & Industrial Marketing 34, 8 (2019), 1850–1865.
[13] Michael Backes, Niklas Grimm, and Aniket Kate. 2015. Data lineage in malicious environments. IEEE Transactions on Dependable and Secure Computing 13, 2 (2015), 178–191.
[14] Chengliang Chai, Jiayi Wang, Yuyu Luo, Zeping Niu, and Guoliang Li. 2022. Data management for machine learning: A survey. IEEE Transactions on Knowledge and Data Engineering 35, 5 (2022), 4646–4667.
[15] Zicun Cong, Xuan Luo, Jian Pei, Feida Zhu, and Yong Zhang. 2022. Data pricing in machine learning pipelines. Knowledge and Information Systems 64, 6 (2022), 1417–1455.
[16] Pierluigi Crescenzi, Viggo Kann, and M Halldórsson. 1995. A compendium of NP optimization problems.
[17] Yingwei Cui and Jennifer Widom. 2003. Lineage tracing for general data warehouse transformations. the VLDB Journal 12, 1 (2003), 41–58.
[18] Lucy Cunnama, Edina Sinanovic, Lebogang Ramma, Nicola Foster, Leigh Berrie, Wendy Stevens, Sebaka Molapo, Puleng Marokane, Kerrigan McCarthy, Gavin Churchyard, et al. 2016. Using top-down and bottom-up costing approaches in LMICs: The case for using both to assess the incremental costs of new technologies at scale. Health economics 25 (2016), 53–66.
[19] Enrik ENGH, Valentina ZAHARIA, and Daniela BORDEIANU. 2018. A system of management integration of product costing in industry. Annals: Series on engineering sciences 10, 2 (2018), 31–42.
[20] Guy Even. 1995. Joseph (Seffi) Naor, Baruch Schieber, and Madhu Sudan. Approximating minimum feedback sets and multi-cuts in directed graphs. Integer Programming and Combinatorial Optimization (1995), 14–28.
[21] Drew Fudenberg and J Miguel Villas-Boas. 2012. Price discrimination in the digital economy. (2012).
[22] Amirata Ghorbani and James Zou. 2019. Data shapley: Equitable valuation of data for machine learning. In International conference on machine learning. PMLR, 2242–2251.
[23] Robert Ikeda and Jennifer Widom. 2009. Data lineage: A survey. Stanford University Publications. http://ilpubs.stanford.edu 8090, 918 (2009), 1.
[24] Gabriela Jacques-Silva, Evangelia Kalyvianaki, Katriel Cohn-Gordon, Adham Meguid, Huy Nguyen, Danny Ben-David, Carl Nayak, Varun Saravagi, George Stasa, Ioannis Papagiannis, et al. 2025. Unified Lineage System: Tracking Data Provenance at Scale. In Companion of the 2025 International Conference on Management of Data. 457–470.
[25] Ruoxi Jia, David Dao, Boxin Wang, Frances Ann Hubis, Nick Hynes, Nezihe Merve Gürel, Bo Li, Ce Zhang, Dawn Song, and Costas J Spanos. 2019. Towards efficient data valuation based on the shapley value. In The 22nd International Conference on Artificial Intelligence and Statistics. PMLR, 1167–1176.
[26] Charles I Jones and Christopher Tonetti. 2020. Nonrivalry and the Economics of Data. American Economic Review 110, 9 (2020), 2819–2858.
[27] Nicola Jones. 2024. The AI revolution is running out of data. What can researchers do? Nature 636, 8042 (2024), 290–292.
[28] Richard M Karp. 1972. Reducibility among combinatorial problems. In Complexity of computer computations. Springer, 85–103.
[29] Bilal Khan, Saifullah Jan, Wahab Khan, and Muhammad Imran Chughtai. 2024. An Overview of ETL Techniques, Tools, Processes and Evaluations in Data Warehousing. Journal on Big Data 6 (2024).
[30] Yongchan Kwon and James Zou. 2022. Beta Shapley: A Unified and Noise-Reduced Data Valuation Framework for Machine Learning. In Proceedings of the 25th International Conference on Artificial Intelligence and Statistics (Proceedings of Machine Learning Research, Vol. 151). PMLR, 8780–8802.
[31] Wassily Leontief. 1974. Structure of the world economy: Outline of a simple input-output formulation. The American Economic Review 64, 6 (1974), 823–834.
[32] Wassily Leontief. 1986. Input-output economics. Oxford University Press.
367:26
Li Peng et al.
[33] Xiaoye S Li. 2005. An overview of SuperLU: Algorithms, implementation, and user interface. ACM Transactions on Mathematical Software (TOMS) 31, 3 (2005), 302–325.
[34] Jinfei Liu, Jian Lou, Junxu Liu, Li Xiong, Jian Pei, and Jimeng Sun. 2021. Dealer: an end-to-end model marketplace with differential privacy. Proceedings of the VLDB Endowment 14, 6 (2021).
[35] Rui Liu, Kwanghyun Park, Fotis Psallidas, Xiaoyong Zhu, Jinghui Mo, Rathijit Sen, Matteo Interlandi, Konstantinos Karanasos, Yuanyuan Tian, and Jesús Camacho-Rodríguez. 2023. Optimizing Data Pipelines for Machine Learning in Feature Stores. Proceedings of the VLDB Endowment 16, 13 (2023), 4230–4239.
[36] Chenghao Lyu, Qi Fan, Fei Song, Arnab Sinha, Yanlei Diao, Wei Chen, Li Ma, Yihui Feng, Yaliang Li, Kai Zeng, et al. 2022. Fine-Grained Modeling and Optimization for Intelligent Resource Management in Big Data Processing. In VLDB 2022-48th International Conference on Very Large Databases, Vol. 15.
[37] Jeffrey K MacKie-Mason, Juan F Riveros, and Robert S Gazzale. 2000. Pricing and bundling electronic information goods: Experimental evidence. MIT Press.
[38] Grzegorz Malewicz, Matthew H Austern, Aart JC Bik, James C Dehnert, Ilan Horn, Naty Leiser, and Grzegorz Czajkowski. 2010. Pregel: a system for large-scale graph processing. In Proceedings of the 2010 ACM SIGMOD International Conference on Management of data (SIGMOD). 135–146.
[39] Aliomar Lino Mattos, Josà Oyadomari, Fernando Nascimento Zatta, et al. 2021. Pricing Research: State of the Art and Future Opportunities. SAGE Open 11, 3 (2021).
[40] Aiswarya Raj Munappy, Jan Bosch, and Helena Homström Olsson. 2020. Data pipeline management in practice: Challenges and opportunities. In Product-Focused Software Process Improvement: 21st International Conference, PROFES 2020, Turin, Italy, November 25–27, 2020, Proceedings 21. Springer, 168–184.
[41] Andrew Odlyzko. 2003. Privacy, economics, and price discrimination on the internet. In Proceedings of the 5th international conference on Electronic commerce. 355–366.
[42] Junyuan Pang, Jiayao Zhang, Jiazheng Song, Jinfei Liu, and Kui Ren. 2026. ASSS: Adaptive Stratified Sampling for Shapley-like Values. Proceedings of the ACM on Management of Data (SIGMOD) (2026), 1–28.
[43] Jian Pei. 2020. A survey on data pricing: from economics to data science. IEEE Transactions on knowledge and Data Engineering (TKDE) 34, 10 (2020), 4586–4608.
[44] Jian Pei, Raul Castro Fernandez, and Xiaohui Yu. 2023. Data and ai model markets: Opportunities for data and model sharing, discovery, and integration. Proceedings of the VLDB Endowment 16, 12 (2023), 3872–3873.
[45] Carl Shapiro. 1999. Information rules: A strategic guide to the network economy. Harvard Business School Press.
[46] Carl Shapiro and Hal R Varian. 1998. Versioning: the smart way to sell information. Harvard business review 107, 6 (1998), 107.
[47] Lloyd S. Shapley. 1953. A Value for n-Person Games. In Contributions to the Theory of Games, Volume II, Harold W. Kuhn and Albert W. Tucker (Eds.). Annals of Mathematics Studies, Vol. 28. Princeton University Press, 307–317.
[48] Wei Shuyue, Yongxin Tong, Zimu Zhou, Tianran He, and Yi Xu. 2025. Efficient Data Valuation Approximation in Federated Learning: A Sampling-Based Approach. In 2025 IEEE 41st International Conference on Data Engineering (ICDE). IEEE Computer Society, 2922–2934.
[49] Alkis Simitsis, Spiros Skiadopoulos, and Panos Vassiliadis. 2023. The history, present, and future of ETL technology. In DOLAP. 3–12.
[50] Tapan Srivastava and Raul Castro Fernandez. 2024. Saving Money for Analytical Workloads in the Cloud. Proceedings of the VLDB Endowment 17, 11 (2024), 3524–3537.
[51] Yutian Sun, Tim Meehan, Rebecca Schlussel, Wenlei Xie, Masha Basmanova, Orri Erling, Andrii Rosa, Shixuan Fan, Rongrong Zhong, Arun Thirupathi, et al. 2023. Presto: A decade of SQL analytics at Meta. Proceedings of the ACM on Management of Data 1, 2 (2023), 1–25.
[52] R.S. Sutton and A.G. Barto. 2018. Reinforcement Learning, second edition: An Introduction. MIT Press. https://books.google.com.br/books?id=sWV0DwAAQBAJ
[53] Jan Vincent Szlang, Sebastian Bress, Sebastian Cattes, Jonathan Dees, Florian Funke, Max Heimel, Michel Oleynik, Ismail Oukid, and Tobias Maltenberger. 2025. Workload Insights from the Snowflake Data Cloud: What Do Production Analytic Queries Really Look Like? Proceedings of the VLDB Endowment 18, 12 (2025), 5126–5138.
[54] Thijs Ten Raa. 2009. Input-output economics: Theory and applications-featuring Asian economies. World Scientific.
[55] Yongxin Tong, Libin Wang, Zimu Zhou, Lei Chen, Bowen Du, and Jieping Ye. 2018. Dynamic pricing in spatial crowdsourcing: A matching-based approach. In Proceedings of the 2018 international conference on management of data. 773–788.
[56] Shuyue Wei, Yongxin Tong, Zimu Zhou, and Tianshu Song. 2020. Efficient and fair data valuation for horizontal federated learning. In Federated Learning: Privacy and Incentive. Springer, 139–152.
[57] Marc Wentker, Matthew Greenwood, and Jens Leker. 2019. A bottom-up approach to lithium-ion battery cost modeling with a focus on cathode active materials. Energies 12, 3 (2019), 504.
367:27
[58] Caesar Wu, Rajkumar Buyya, and Kotagiri Ramamohanarao. 2019. Cloud pricing models: Taxonomy, survey, and interdisciplinary challenges. ACM Computing Surveys (CSUR) 52, 6 (2019), 1–36.
[59] Xike Xie, Xingjun Hao, Torben Bach Pedersen, Peiquan Jin, and Jinchuan Chen. 2016. OLAP over probabilistic data cubes I: Aggregating, materializing, and querying. In 2016 IEEE 32nd International Conference on Data Engineering (ICDE). IEEE, 799–810.
[60] Ying Yang, Niccolò Meneghetti, Ronny Fehling, Zhen Hua Liu, and Oliver Kennedy. 2015. Lenses: An on-demand approach to etl. Proceedings of the VLDB Endowment 8, 12 (2015), 1578–1589.
[61] H Peyton Young. 1985. Cost Allocation: Methods, Principles, Applications. North Holland Publishing Company.
[62] Fangyuan Zhang, Mengqi Wu, Chunlei Xu, Yunong Bao, Jiyu Qiao, Yingli Zhou, Hua Fan, Caihua Yin, Wenchao Zhou, and Feifei Li. 2025. Streaming View: An Efficient Data Processing Engine for Modern Real-Time Data Warehouse of Alibaba Cloud. Proceedings of the VLDB Endowment 18, 12 (2025), 5153–5165.
[63] Jiayao Zhang, Yuran Bi, Mengye Cheng, Jinfei Liu, Kui Ren, Qiheng Sun, Yihang Wu, Yang Cao, Raul Castro Fernandez, Haifeng Xu, et al. 2024. A Survey on Data Markets. arXiv preprint arXiv:2411.07267 (2024).
[64] Jiayao Zhang, Qiheng Sun, Jinfei Liu, Li Xiong, Jian Pei, and Kui Ren. 2023. Efficient sampling approaches to shapley value approximation. Proceedings of the ACM on Management of Data (SIGMOD) 1, 1 (2023), 1–24.
[65] Mark Zhao, Emanuel Adamiak, and Christos Kozyrakis. 2025. cedar: Optimized and Unified Machine Learning Input Data Pipelines. Proceedings of the VLDB Endowment 18, 2 (2025), 488–502.
[66] Mark Zhao, Niket Agarwal, Aarti Basant, Buğra Gedik, Satadru Pan, Mustafa Ozdal, Rakesh Komuravelli, Jerry Pan, Tianshu Bao, Haowei Lu, et al. 2022. Understanding data storage and ingestion for large-scale deep recommendation model training: Industrial product. In Proceedings of the 49th annual international symposium on computer architecture. 1042–1057.
367:28
Li Peng et al.
A Proof of Theorems and Lemmas
A.1 Proof of Theorem 2
PROOF. We begin with the total direct cost of the system. By rearranging Eq. 2, we can express the direct cost of any single vertex as . Summing over all vertices in the graph :
(7)
Let us analyze the total input cost term, . By the definition of input cost , we get:
This double summation iterates over all directed arcs . We can change the order of summation to first sum over all potential source nodes and then over their direct downstream neighbors :
We can factor out from the inner summation, as it is constant with respect to v:
By the cost conservation property (Definition 1), the inner sum equals 1 for any non-leaf node . For any leaf node , its set of downstream neighbors is empty, so the inner sum is 0. Therefore, the expression simplifies to the sum of manufacturing costs over all non-leaf nodes:
Substituting this result back into Eq. 7:
The right-hand side is the sum of manufacturing costs over all vertices minus the sum of manufacturing costs over all non-leaf vertices. This difference is exactly the sum of manufacturing costs over the leaf vertices, .
This completes the proof.
Proc. ACM Manag. Data, Vol. 4, No. 6, Article 367. Publication date: December 2026.
□
367:29
A.2 Proof of Theorem 3
PROOF. Let denote the cost held by vertex at the beginning of superstep , with . The algorithm terminates when for all non-leaf vertices . The proof proceeds in two parts: termination and exactness.
- Termination. In a DAG, the cost propagation is unidirectional. A cost contribution from an initial can only reach a vertex v via a path from u to v. After one superstep, this cost can reach vertices at a path distance of 1. After k supersteps, it can reach vertices at a path distance of at most k.
Let be the longest path length in . After supersteps, any cost originating from any vertex will have propagated along all possible paths of length up to . Since no path in the graph is longer than , all costs must have passed through all intermediate (non-leaf) vertices on their respective paths and accumulated at the leaf vertices.
Consequently, at the beginning of superstep , no non-leaf vertex can receive any message, as all upstream cost flows have already terminated at leaves. Since all non-leaf vertices also distributed their own costs in prior supersteps, for all . This satisfies the termination condition, proving the algorithm halts in at most supersteps.
- Exactness. Let be the final cost at a leaf upon termination. We must show .
First, observe that the total cost is conserved. In any superstep, for any active non-leaf vertex v, the cost it sends out is
because the outgoing weights satisfy
Thus, . Upon termination,
satisfying cost conservation.
Let be the total cost that flows through or terminates at vertex v throughout the algorithm's execution. This is the sum of its direct cost and all costs received from upstream neighbors over all supersteps.
The total cost received by v from an upstream neighbor u is the proportion of the total cost that flowed through u, which is precisely . Substituting this gives:
This system of linear equations defining for all is identical to the one defining the manufacturing cost in Equations 2. Since is a DAG, this system has a unique solution. Therefore, for all .
367:30
Li Peng et al.
For a leaf node , it only accumulates cost and never distributes it. Its final cost is the total cost that has flowed into it, which is . Thus:
This confirms that the algorithm exactly computes the manufacturing cost for all data products. ☐
A.3 Proof of Theorem 4
Proof. By the definition of the MCDP problem, the manufacturing cost of any entity must comply to the recursive relation in Eq. 2: . Based on the analysis in Appendix B, this element-wise definition is equivalent to the linear system formulated in Eq. 4, i.e., . Based on the analysis in Appendix A.4, the spectral structure of the allocation matrix ensures that is non-singular and invertible. Consequently, a unique algebraic solution strictly exists. Since MatrixApp directly implements this exact closed-form inversion and extracts the subset of answers for the terminal data products , it inherently captures the true MC of DPs. Thus, it exactly solves the MCDP problem.
A.4 Proof of Matrix Invertibility
We prove that is invertible by showing that the spectral radius of satisfies . Since a matrix and its transpose share the same eigenvalues, this suffices to guarantee that all eigenvalues of are strictly positive, and thus the matrix is nonsingular.
Recall that W is the cost allocation matrix defined in §3.3.2. By construction:
(1) W is non-negative: for all .
(2) For every non-leaf vertex , the outgoing weights satisfy the conservation constraint
so the corresponding row of W sums to 1.
(3) For every leaf vertex , we have , hence the entire row of W is zero.
Thus every row sum of W is at most 1, and at least one row sum (any leaf row) is strictly less than 1.
Step 1: . Let be an eigenvalue of with eigenvector , so . Let be an index such that
Consider the k-th coordinate of the eigen-equation:
367:31
Taking absolute values and using the triangle inequality,
Since , we obtain . Hence .
Step 2: . We now show that is impossible. Suppose, for contradiction, that there exists an eigenvalue with . For the chain of inequalities above to hold as equalities, we must simultaneously have:
(1) The row sum of row k equals 1, i.e.,
Thus vertex k is not a leaf (since leaf rows are all zeros).
(2) For every with , we must have . Otherwise the second inequality would be strict.
Condition (2) implies that every direct downstream neighbor of with a positive weight also has the same maximal modulus . Repeating this argument along any directed path starting from , we conclude that all vertices reachable from with positive path weight also satisfy .
In a valid data pipeline, every non-leaf vertex has at least one path to some leaf data product. Therefore, there exists a leaf vertex reachable from via a directed path with positive total weight. By the propagation argument above, this implies
However, since p is a leaf, its outgoing weights are all zero, so the p-th row of W is the zero vector. The eigen-equation at coordinate p is
With , this forces , contradicting .
Therefore no eigenvalue of W can satisfy , and thus
Step 3: Invertibility of . Since and and share the same eigenvalues, every eigenvalue of also has modulus strictly less than 1. Hence every eigenvalue of is strictly positive, so is nonsingular and invertible. This guarantees that the linear system
has a unique solution .
367:32
Li Peng et al.
A.5 Proof of Lemma 2
The proof of Lemma 2 is provided below.
Proof. It suffices to show that every directed cycle contains an arc for which is a prefix of . After Label stabilizes, each vertex stores the smallest label proposed along its incoming paths. The labels of distinct vertices are distinct because each root has a unique initial label and each outgoing arc has a unique local suffix. Consider any directed cycle. Since the cycle is finite and the labels are totally ordered by Definition 3, it contains a vertex with the smallest final label. We follow the cycle from and show inductively that is a prefix of every label encountered before returning to . Suppose this holds at vertex . The proposal sent along an arc extends , so it also has as a prefix. Because keeps the smallest proposal, is no greater than this extension. By the choice of , it is also no smaller than . Under Definition 3, any label between a label and one of its extensions must have the former as a prefix. Otherwise, it would either end before the former, making it smaller, or its first differing component would make it smaller than the former or larger than the extension. Thus, is a prefix of . Let be the predecessor of on the cycle. Since and have distinct labels, is a proper prefix of , so . Hence every directed cycle contains an arc removed from , and is a DAG.
A.6 Proof of Theorem 5
Proof. Let and be the unique manufacturing cost vectors that solve the linear systems for graphs and , respectively. We need to show that for any original vertex , its manufacturing cost is the same in both solutions, i.e., .
The GraphEdit procedure modifies the graph locally for each feedback arc . We next analyze the effect of a single such transformation. The cost equations for all vertices not involved in any feedback arc remain unchanged. We only need to examine the equations for vertices , and the new auxiliary vertices and .
In the original graph G, the manufacturing cost for vertex v includes a term from u:
In the transformed graph , the initial cost state is denoted by , and the arc is replaced by the path . The new cost equations are:
By construction in Algorithm 6, we have for any original vertex , and the new vertices have zero initial cost, i.e., . The weights are assigned as , , and . The upstream neighbors of remain unchanged except that is replaced by .
Substituting Eq. 12 into Eq. 13, we get:
367:33
Now, substituting this result for into Eq. 14:
Assuming for all upstream neighbors, this recursive dependency reduces correctly to an equation identical to the original cost equation for (Eq. 11).
Since the fundamental linear structure and aggregated cost formulations remain equivalent for every original vertex in the transformed system, the unique solution to the system must also be identical. Thus, the manufacturing costs for all data products are preserved.
A.7 Proof of Theorem 6
PROOF. Denote and . Let denote the cost vector corresponding to , where and represent the costs associated with the nodes in and , respectively. Similarly, let denote the cost vector corresponding to . The corresponding weight matrix is written as
Let P denote the length of the longest path in . Then, according to the process of RollUpApp, we have
\begin{align*}\begin{pmatrix}\mathbf{0}\\\mathbf{d}_{22}\end{pmatrix}&=\begin{bmatrix}\left(\mathbf{W}_{11}&\mathbf{W}_{12}\right)^\top\\\mathbf{0}&\mathbf{I}\end{bmatrix}^{P}\begin{pmatrix}\mathbf{d}_{11}\\\mathbf{d}_{12}\end{pmatrix}\\&=\begin{pmatrix}(\mathbf{W}_{11}^\top)^{P}\mathbf{d}_{11}\\\mathbf{W}_{12}^\top\left(\mathbf{I}+\mathbf{W}_{11}^\top+\cdots+(\mathbf{W}_{11}^\top)^{P-1}\right)\mathbf{d}_{11}+\mathbf{d}_{12}\end{pmatrix}.\end{align*}Let be the manufacturing cost vector of , and let be the manufacturing cost vector of . Then the linear systems for and are
Note that
Therefore,
is a solution to the linear system corresponding to . Since the solution to this linear system is unique, this must be its unique solution. The equality therefore implies the conclusion of Theorem 6.
A.8 Proof of Theorem 7
PROOF. Let denote the exact manufacturing cost (MC) vector for all data products in the original data pipeline defined by the initial state . By Theorem 4, represents the exact ground truth that satisfies the global linear system formulation. We demonstrate that the sequence of transformations applied in CostApp strictly preserves this exact result.
367:34
Li Peng et al.
First, in Phase 1, CostApp isolates cyclic dependencies via the GraphEdit operation, yielding a modified graph and a corresponding cost state . According to Theorem 5, removing feedback arcs and introducing auxiliary vertices does not alter the cost flows toward the leaves. Consequently, the MC of any data product in the new system defined on remains identically .
Second, by executing RollUpApp on the acyclic subgraph , CostApp iteratively propagates costs until they are completely aggregated onto the terminal vertices , resulting in the cost state . By Theorem 6, propagating costs along an acyclic subgraph strictly conserves the ultimate allocation to final DPs. Thus, the MC of DPs in the system is completely equivalent to that in , continuing to equal .
Finally, in Phase 2, the aggregated costs on terminal nodes are extracted as the reduced direct cost vector . The residual cyclic dependencies are captured by the reduced cost allocation matrix . The cost redistribution over is thus formulated as the reduced linear system . Since Theorem 4 guarantees that solving such a linear formulation yields exact results, executing MatrixApp* on this reduced system computes the exact MCs for the system . As , extracting the entries corresponding to precisely recovers , which concludes the proof.
B Matrix Form Derivation
To derive the matrix form of MC from the scalar equations, we start with the definition of MC for a single vertex :
This equation holds for all vertices in the graph . We can express this system of linear equations in matrix form as follows:
Let be the column vector of manufacturing costs, where the -th element is . Let be the column vector of direct costs, where the -th element is . Let be the weighted adjacency matrix, where if an arc exists from to , and 0 otherwise.
The summation term represents the total input cost for vertex . Let's analyze the matrix-vector product . The -th element of this product vector is computed as:
Since is non-zero only when is a direct predecessor of (i.e., ), this sum is exactly equivalent to the input cost term in the original scalar equation.
We can now rewrite the scalar equation for each vertex using this vector notation:
Since this relationship holds for every element , we can express it for the entire system of equations in vector form:
367:35
This simplifies to the final matrix equation:
C The label Algorithm
The Label algorithm is shown in Alg. 5. Roots receive unique integer labels, while every other vertex starts with T, a value larger than any valid label. A vertex adopts a candidate only when it is smaller than its current label. After an update, it appends an outgoing-edge suffix and sends the new labels downstream. The process stops when no label changes.
Algorithm 5: Label (Pregel-style pseudocode)
Input: Graph .
Output: The final label for each vertex .
/* Initialization: Assign unique integer labels to roots
*/
1 foreach root vertex in parallel: ;
2 foreach non-root vertex : ; // Larger than any valid label
3 foreach root and its j-th downstream neighbor : send to ;
4 while any vertex is active do
5 foreach active vertex v do in parallel
6 compute(msgs)
7 label_updated ← false;
8 ;
9 foreach message containing label do
10 if then
11 ;
12 if then
13 ;
14 label_updated ← true;
15 if label_updated then
16 /* Propagate new labels to downstream neighbors
17 foreach j-th neighbor do
18 send message with label to ;
19 voteToHalt();
// Reactivated upon receiving a message
19 return final labels for all ;
D A Formulation of GraphEdit
Alg. 6 presents the pseudocode for the GraphEdit algorithm. This algorithm takes as input a directed graph G and a feedback arc set . For each arc in , it removes the arc from G and introduces two new auxiliary vertices: a sink vertex and a source vertex. The original arc is replaced by three new arcs: one from the original source to the new sink, one from the new source to the original target, and one connecting the new sink to the new source. The weights of these new arcs are assigned as specified in the algorithm.
367:36
Li Peng et al.
Algorithm 6: GraphEdit
Input: Directed graph , direct costs for all , feedback arc set
Output: Edited graph , new cost states for all , set of new sink vertices , set of new source vertices
1 , , , ;
2 foreach arc do
3 Remove arc from ;
4 Create new vertex and add to and ;
5 Create new vertex and add to and ;
6 Add new arc with weight to ;
7 Add new arc with weight 1 to ;
8 Add new arc with weight 1 to ;
9 ;
10 ;
11 return ;
Algorithm 7: RollUpApp* (Pregel-style pseudocode)
Input: Graph , stateful cost map
Output:
1 Each vertex sets ; // Initialization
2 while any non-leaf vertex v is active do
3 foreach active vertex v do in parallel
/* CR operation in Pregel style */
4 compute(msgs)
5 foreach do
6 foreach key getKeys() do
7 update getValue(key);
8 sends to each ; // Send weighted map to downstream neighbors
9 updates ;
10 voteToHalt();
// Reactivated upon receiving a message
11 return
E The RollUpApp* Algorithm
We present the RollUpApp* algorithm in Alg. 7, a Pregel-style pseudocode variant of RollUpApp (Alg. 1). This variant utilizes a stateful cost map at each vertex v to accumulate costs for multiple keys simultaneously. During each superstep, active vertices aggregate incoming cost maps from upstream neighbors into their local cost map and then propagate weighted versions of this aggregated map to their downstream neighbors. This approach allows for efficient handling of multiple cost dimensions in a single pass through the graph.
F Extended Future Work
We discuss some promising directions to inspire future work.
367:37
(1) Explainable product costing in data pipelines. For fine-grained cost optimization, enterprises require a detailed understanding of how each upstream data entity contributes to the cost of a final data product. This can be achieved by maintaining a map that tracks the propagation of monetary costs from each component through the pipeline. This method yields a detailed breakdown of each data product, attributing its total cost to its constituent components and enabling explainability. This idea will incur additional storage and communication overhead. We leave the concrete design and optimization of solutions to this explainability as future work.
(2) Exploration of potential applications of CostApp. Although motivated by data pipelines, CostApp’s core capability, which is solving large-scale sparse linear systems with cyclic structures, has the potential to apply to broader problems. One potential application is solving Bellman equations in Markov Decision Processes (MDPs) with sparse state transition matrix. In an MDP, the value function v satisfies the Bellman equation , where R is the reward vector, P is the state transition matrix, and is the discount factor. Rearranging this equation yields , which aligns with the form in §3.3.2. A common method for evaluating the value function is through value iteration [52], which can be proved to be equivalent to the cost iteration of RollUpApp for . The experimental results in §5 suggest that CostApp obtains exact solutions faster than RollUpApp achieves solutions of acceptable accuracy, indicating its potential to accelerate value function computation in MDPs with sparse transitions and large state spaces. Another potential application is input-output economic modeling [31, 32, 54], where industries are interdependent with cyclic supply chains. In this model, x denotes the total production required and can be obtained by resolving a Leontief inverse: , where d is a demand vector and A is an input-output matrix, which is naturally large-scale and sparse. Thus, CostApp can be directly applied to efficiently compute x on large-scale economic networks without approximations. These examples demonstrate that CostApp can inspire the optimization of numerical solvers for large-scale sparse linear systems, making it valuable future work to explore more potential applications.
Received 17 April 2026; revised 19 August 2026; accepted 12 September 2026