Abstract
Executing graph optimization algorithms such as the Minimum Mean Cycle (MMC) while preserving privacy has significant potential for handling sensitive information between users and companies. For example, it enables <u>multilateral netting to solve the Minimum Cost Flow (MCF) problem [4]</u> without disclosing mutual debts, making it highly relevant for processes like netting among multinational corporations. <u>Aly et.</u> <u>al.</u> <u>[2]</u> proposed an algorithm using Multi-Party Computation (MPC) to execute the MMC problem. However, this approach is based on <u>Karp's algorithm [1]</u>, which was found by <u>Chaturvedi et al . [3]</u> to occasionally fail to detect cycles. In this study, we propose a revised protocol that corrects this issue and enhances its efficiency. We implemented our protocol using MP-SPDZ and confirmed that it correctly identifies the MMC, similar to traditional protocols. Our findings indicate that our proposed protocol operates correctly and more efficiently than Aly's protocol, which reduces the time/round complexity from
1. Introduction
1-1. Importance of Graph Theory Optimization
Graph theory optimization problems play a crucial role in various domains, from computer science and engineering to economics and finance. These problems involve finding the most efficient way to navigate, connect, or utilize network structures, and solutions to these problems have far-reaching implications for improving systems and processes.
One of the representative problems in graph theory optimization is the Minimum Cost Flow (MCF) problem, which aims to find the least costly way to send a certain amount of flow through a network. The MCF problem is foundational in numerous applications, providing critical insights and optimizations.
In the financial sector, particularly in Netting, the Minimum Cost Flow (MCF) problem is often addressed to optimize the settlement of transactions and reduce systemic risk [4]. Netting involves aggregating multiple financial obligations to streamline transactions, minimize risk, and enhance efficiency. However, one of the critical challenges in this context is maintaining the privacy and confidentiality of sensitive financial data. Traditional methods for solving the MCF problem may require exposing transaction details, leading to significant privacy concerns and potential security risks.
Beyond netting, the MMC problem and its solutions have a wide array of applications across various fields:
- Network Security: Enhancing security measures by optimizing the flow of information and resources while minimizing potential points of vulnerability.
- Supply Chain Management: Streamlining logistics and distribution networks to reduce costs and improve delivery times.
- Urban Planning: Developing efficient transportation systems by optimizing traffic flow and reducing congestion.
The Minimum Mean Cycle (MMC) problem is a crucial component in solving the MCF problem. The MMC problem focuses on identifying cycles in directed graphs with the minimum average weight, which is essential for detecting inefficient paths and optimizing network performance. By incorporating the MMC problem into the solution of the MCF problem, we can achieve more accurate and efficient outcomes.
To address the privacy concerns inherent in solving the MCF problem, we explore the use of Multi-Party Computation (MPC) to securely solve the MMC problem. MPC is a cryptographic approach that allows multiple parties to collaboratively compute a function over their inputs while keeping those inputs private. By applying MPC techniques, we can solve the MMC problem without exposing sensitive data, thus preserving the privacy of financial transactions and other confidential information.
1-2. Previous Work
<u>Aly et al. [2]</u> proposed a method to solve <u>Karp's MMC algorithm [1]</u> using Multi-Party Computation. However, this approach has some problems and suffers from significant computational complexity and time consumption. Additionally, the <u>Karp's algorithm [1]</u> was found by <u>Chaturvedi et al . [3]</u> to occasionally fail to detect cycles.
1-3. Our Contribution
in this study, we propose a novel approach that not only addresses these shortcomings but also offers a more efficient and practical solution for securely solving the MMC problem using MPC. Our proposed protocol aims to reduce computational and time complexities, enhance cycle detection accuracy, and ensure robust privacy protection. Our experimental results demonstrate a significant improvement in efficiency, with a reduction in time complexity from
2. Minimum Mean Cycle Problem
Minimum Mean Cycle Problem and its solution is defined by <u>Karp in 1978 [1]</u>.
2-1. Problem Definition
Given a connected graph
denotes the cost on the edgec_{i,j} \in C .(i,j) denotes the minimum cost from noded^k(i) tos that contains exactlyi edges.k
First of all, for any cycle
Thus, the minimum mean cycle is:
Minimum Mean Cycle (MMC) Problem is the problem to find this
2-2. Efficient MMC
The MMC problem is known as NP-hard, and Karp introduces an efficient algorithm for solving it. The solution is followed by 2 steps.
The first step, we call it as Walk, is to calculates
Initially,
The second step is to calculate the minimum mean cycle by:
See <u>Karp's paper [1]</u> for a proof of equation (4). Overall algorithmic complexity is
3. Aly’s Secure MMC Protocol
Notation
denotes secret shared or encrypted values of[a] a denotes the assignment that if[z] = _{[c]} [x]:[y] is one,[c] is assigned to[x] or[z] otherwise.[y]
3-1. Protocol
<u>Aly et. al. [2]</u> provide algorithmic solutions to MMC problem in a secure multi-party and distributed setting. This protocol is constructed by 2 sub-protocols:
walk([C],[b]) \rightarrow [A],[walks] mmc([A],[walks]) \rightarrow [\text{min-cost}], [\text{min-cycle}]
This corresponds to Steps 1 and 2 of Karp's Algorithm in section 2.
In first sub-protocol, we have two inputs. The cost matrix
From these inputs, we outputs two values. One is the 2-dimensional walk cost matrix
Protocol 3-1. Aly’s Walk Protocol
Input: A matrix of shared costs
Output: A matrix of walk costs
[A] \leftarrow [\infin], [A]_{00} \leftarrow [0], [C] \leftarrow [C] + [\infin](1-[b]) - for
tok \leftarrow 1 do|V|+1 - for
toj \leftarrow 1 do|V| - for
toi \leftarrow 1 do|V| [c] \leftarrow [A]_{ik-1} + [C]_{ij} < [A]_{jk} [A]_{jk} \leftarrow _{[c]} [A]_{ik-1} + [C]_{ij} : [A]_{jk} [walks]_{..kj} \leftarrow _{[c]} [walks]_{..k-1i} : [walks]_{..kj} [walks]_{ijkj} \leftarrow _{[c]} [walks]_{ijkj} + 1 : [walks]_{ijkj}
- end
- for
- end
- for
- end
In second sub-protocol, we have two outputs.
Protocol 3-2. Aly’s MMC Protocol
Input: A matrix of walk costs
Output: The cost of the minimum mean cycle
- for
toj \leftarrow 1 do|V| [\text{max-cycle}],[\text{max-cost}] \leftarrow \phi - for
tok \leftarrow |V| do1 [\text{a-num}] \leftarrow [A]_{j(|V|+1)} - [A]_{jk} [\text{a-den}] \leftarrow |V|-k [c] \leftarrow [\text{k-num}] \cdot [\text{a-den}] < [\text{a-num}] \cdot [\text{k-den}] [\text{k-num}] \leftarrow _{[c]} [\text{a-num}] : [\text{k-num}] [\text{k-den}] \leftarrow _{[c]} [\text{a-den}] : [\text{k-den}] [\text{max-cycle}] \leftarrow _{[c]} [walks]_{..|V|j} - [walks]_{..kj} : [\text{max-cycle}] [\text{max-cost}] \leftarrow _{[c]} [A]_{jk} : [\text{max-cost}]
- end
[c] \leftarrow [\text{j-num}] \cdot [\text{k-den}] < [\text{k-num}] \cdot [\text{j-den}] [\text{j-num}] \leftarrow _{[c]} [\text{k-num}] : [\text{j-num}] [\text{j-den}] \leftarrow _{[c]} [\text{k-den}] : [\text{j-den}] [\text{min-cycle}] \leftarrow _{[c]} [\text{max-cycle}] : [\text{min-cycle}] - $[\text{min-cost}] \leftarrow _{[c]} [\text{max-cost}] : [\text{min-cost}]
$
- end
Complexity
This method requires
3-2. Problem in Aly’s Protocol
Aly’s protocol implements <u>Karp algorithm [1]</u> in the secure manner. In karp’s alrogithm, we determine
Lemma 1
Let
This lemma means that the cycle can be detected by traversing the edge progression from the last edge and marking the vertices visited by the walk until a previous marked vertex is encountered, from s-j path with
4. CM-based Secure MMC Protocol
Notation
denotes secret shared or encrypted values of[a] a denotes the assignment that if[z] = _{[c]} [x]:[y] is one,[c] is assigned to[x] or[z] otherwise.[y]
4-1. Protocol
We propose a protocol that converts the minimum mean cycle detection from Aly's protocol to one with Lemma1. In addition, a few changes have been made to the data structure. We name it “CM-based Securely MMC Protocol”, taking the initials of Chaturvedi and McConnell, who proposed Lemma 1.
CM-based protocol is constructed by 3 sub-protocols:
walk([C],[b]) \rightarrow [A],[ep] mmc mmcn([A],[ep]) \rightarrow [\text{min-cost}],[\text{minimizing-node}] extract\text{-}cycle([\text{minimizing-node}],[ep]) \rightarrow [\text{min-cycle}]
Here, Aly's second sub-protocol is divided into CM-based second and third sub-protocols.
In fist sub-protocol, For the most part, it is the same as Protocol 3-1, with one difference: Instead of
Protocol 4-1. CM-based Walk Protocol
Input: A matrix of shared costs
Output: A matrix of walk costs
[A] \leftarrow [\infin], [A]_{00} \leftarrow [0], [C] \leftarrow [C] + [\infin](1-[b]) - for
tok \leftarrow 1 do|V|+1 - for
toj \leftarrow 1 do|V| - for
toi \leftarrow 1 do|V| [c] \leftarrow [A]_{ik-1} + [C]_{ij} < [A]_{jk} [A]_{jk} \leftarrow _{[c]} [A]_{ik-1} + [C]_{ij} : [A]_{jk} [ep]_{jk} \leftarrow _{[c]} i : [ep]_{jk}
- end
- for
- end
- for
- end
In (a) of the 2nd sub-protocol, instead of computing
The algorithm is detailed as Protocol 4-2-a.
Protocol 4-2-a. CM-based MMCN Protocol
Input: A matrix of walk costs
Output: The cost of the minimum mean cycle
- for
toj \leftarrow 1 do|V| [\text{max-cost}] \leftarrow \phi - for
tok \leftarrow |V| do1 [\text{a-num}] \leftarrow [A]_{j(|V|+1)} - [A]_{jk} [\text{a-den}] \leftarrow |V|-k [c] \leftarrow [\text{k-num}] \cdot [\text{a-den}] < [\text{a-num}] \cdot [\text{k-den}] [\text{k-num}] \leftarrow _{[c]} [\text{a-num}] : [\text{k-num}] [\text{k-den}] \leftarrow _{[c]} [\text{a-den}] : [\text{k-den}] [\text{max-cost}] \leftarrow _{[c]} [A]_{jk} : [\text{max-cost}]
- end
[c] \leftarrow [\text{j-num}] \cdot [\text{k-den}] < [\text{k-num}] \cdot [\text{j-den}] [\text{j-num}] \leftarrow _{[c]} [\text{k-num}] : [\text{j-num}] [\text{j-den}] \leftarrow _{[c]} [\text{k-den}] : [\text{j-den}] - $[\text{minimizing-node}] \leftarrow _{[c]} j : [\text{minimizing-node}]
$ - $[\text{min-cost}] \leftarrow _{[c]} [\text{max-cost}] : [\text{min-cost}]
$
- end
In (b) of the 2nd sub-protocol, from
Protocol 4-2-b. CM-based Extract-Cycle Protocol
Input: A minmizing node
Output: A matrix with the minimum mean cycle
,[\text{backpointers}]_{0} \leftarrow [\text{minimizing-node}] [\text{next-index}] \leftarrow [\text{minimizing-node}] - for
tok \leftarrow |V| do1 [\text{val}] \leftarrow [0] - for
toj \leftarrow 0 do|V|-1 [match] = j == [\text{next-index}] [\text{val}] = _{[\text{match}]} [ep]_{jk}:[\text{val}] [\text{match-index-matrix}]_{jk} = [match]
- end
[\text{next-index}] = [\text{val}] [\text{backpointers}].append([\text{val}])
- end
- for
toi \leftarrow 0 do|V|-1 [\text{counter}] \leftarrow [0] - for
tok \leftarrow 0 do|V| [\text{counter}] = [\text{counter}] + [\text{match-index-matrix}]_{ik}
[c] = [\text{counter}] >= 2 [\text{cycle-node}] = _{[c]} i : [\text{cycle-node}]
- end
[\text{min-cycle}] \leftarrow [0],[\text{counter}] \leftarrow [0] - for
tok \leftarrow |V| do1 [\text{edge-from}] \leftarrow [\text{backpointers}]_k [c] = [\text{edge-from}] [\text{cycle-node}] [\text{counter}] = [\text{counter}] + [c] [c_0] = [\text{counter}] + 1 - for
toj \leftarrow 0 do|V|-1 [c_1] = [\text{match-index-matrix}]_{jn-k} [c_2] = [c_0]*[c_1] - for
toi \leftarrow 0 do|V|-1 [c_3] = [\text{match-index-matrix}]_{jn-k+1} [\text{min-cycle}]_{ji} = [\text{min-cycle}]_{ji} + ([c_2] * [c_3])
- end
- end
- end
Complexity
This method requires
Table 4-1. Complexity Analysis of Secure MMC Protocols
multiplications/communication rounds complexity | space complexity | |
---|---|---|
Aly’s | $O( | V |
CM-based | $O( | V |
4-2. Implementation
We have implemented CM-based Securely MMC protocol in naive secret sharing scheme using Python MP-SPDZ. And we confirmed that the minimum mean cycle was found reliably in a number of random edges, including the counterexamples shown by <u>Chaturvedi et al [3]</u>.
5. Conclusion
In this study, we have proposed a more efficient protocol for solving the Minimum Mean Cycle (MMC) problem using Multi-Party Computation (MPC). Our CM-based approach not only addresses but also significantly improves upon the issues identified in Aly's protocol. Specifically, our protocol reduces the time/round complexity from
Despite these advancements, the complexity remains super-quadratic in terms of the number of nodes, which can pose practical challenges for very large graphs. To mitigate this limitation, we propose the following strategies:
- By exposing the graph's topography, we can optimize the edge search to include only the minimum necessary edges, thereby reducing the time/round complexity to
. This approach, however, requires a trade-off with some degree of privacy.O(|V|^2 \cdot |E|) - Implementing simpler algorithms that provide approximate or sub-optimal solutions, such as Greedy Algorithms and Distributed Algorithms, can further enhance practicality. These algorithms can significantly reduce computational overhead while delivering sufficiently accurate results for many applications.
In summary, our protocol offers a substantial improvement over existing methods, paving the way for more efficient and practical solutions to the MMC problem in secure computation settings. Future work will focus on refining these strategies to further balance the trade-offs between efficiency, accuracy, and privacy.
6. Acknowledgments
This study is supported by an Ethereum Foundation R&D grant and is a collaborative work with Enrico and Nam from Ethereum Foundation.
Reference
- Richard M. Karp, “A characterization of the minimum cycle mean in a digraph”, Discrete Mathematics, Volume 23, Issue 3, 1978, Pages 309-311, ISSN 0012-365X, https://doi.org/10.1016/0012-365X(78)90011-0.
- Aly, A., Van Vyve, M. (2015). Securely Solving Classical Network Flow Problems. In: Lee, J., Kim, J. (eds) Information Security and Cryptology - ICISC 2014. ICISC 2014. Lecture Notes in Computer Science(), vol 8949. Springer, Cham. https://doi.org/10.1007/978-3-319-15943-0_13
- Mmanu Chaturvedi, Ross M. McConnell, “A note on finding minimum mean cycle”, Information Processing Letters, Volume 127, 2017, Pages 21-22, ISSN 0020-0190, https://doi.org/10.1016/j.ipl.2017.06.007.
- Fleischman, T.; Dini, P. “Mathematical Foundations for Balancing the Payment System in the Trade Credit Market”, J. Risk Financial Manag. 2021, 14, 452. https://doi.org/10.3390/jrfm14090452