# How to linearize your cluster

**URL:** <https://delvingbitcoin.org/t/how-to-linearize-your-cluster/303>\
**Category:** Implementation\
**Tags:** wg-cluster-mempool, mempool\
**Created:** [December 18, 2023, 8:55pm UTC](https://delvingbitcoin.org/t/how-to-linearize-your-cluster/303 "2023-12-18T20:55:14Z")\
**Posts on this page:** 1\
**Showing post:** 66

<div class="post-metadata">

**Author:** ![sipa](https://delvingbitcoin.org/user_avatar/delvingbitcoin.org/sipa/32/1100_2.png) [@sipa](https://delvingbitcoin.org/u/sipa)\
**Post date:** [April 5, 2025, 10:40pm UTC](https://delvingbitcoin.org/t/how-to-linearize-your-cluster/303/66 "2025-04-05T22:40:24Z")

</div>

Hmm, I think this works, but it has some caveats:

- Changes to \lambda during GGT recursion mean that transactions may move from the sink side of the partition to the source side; I believe this violates the condition that only sink-to-node and node-to-source capacities may change. If so, this means the factor n speedup on the worst case disappears.
- It means that the edges need to be expanded to their transitive closure (if A depends on B, and B depends on C, we need an edge from A to C as well). With complexities like \mathcal{O}(n^2 \sqrt{m}), this may be a slight worsening in practice, if we account for the fact that realistic clusters tend to have m = \mathcal{O}(n), but the full transitive closure may well have m = \mathcal{O}(n^2).

I do remember reading about specialized bipartite-graph min-cut algorithms, though…

* * *

> [@Lagrang3](#):
>
> I will love to see through your code.

I’ll do a writeup soon on the implementation and optimizations I came up with, but I’m still experimenting with a few ideas first (in particular, trying representing the edge data in n\times n matrix form, so bitsets can be used to match things more easily).

---

_[View the full topic](https://delvingbitcoin.org/t/how-to-linearize-your-cluster/303)._
