# 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:** 42

<div class="post-metadata">

**Author:** ![stefanwouldgo](https://delvingbitcoin.org/user_avatar/delvingbitcoin.org/stefanwouldgo/32/664_2.png) [@stefanwouldgo](https://delvingbitcoin.org/u/stefanwouldgo)\
**Post date:** [February 11, 2025, 10:44am UTC](https://delvingbitcoin.org/t/how-to-linearize-your-cluster/303/42 "2025-02-11T10:44:34Z")

</div>

> [@ajtowns](#):
>
> I haven’t read the papers, but I’m not following how you construct a network flow where solving a max flow / min cut gives you a subset of txs that maximises f\_C - \lambda s\_CfC−λsCf\_C - \lambda s\_C for a given \lambdaλ\lambda.

But that’s just what the DeepSeek approach does. It finds a subset C with maximum weight under the side condition that C is a closure. And we choose the weight to be f-\lambda s for all nodes. It’s a closure because it’s a min-cut, and the original edges get infinite capacity, so they are never cut. It maximizes weight because the size of the min-cut is exactly the sum of excluded nodes with positive weight plus the sum of included nodes with negative weight.

The trick is that turning our feerate into a weight by introducing \lambda lets us simply sum up the weights into total weight instead of directly optimizing a ratio.

> [@ajtowns](#):
>
> The [DeepSeek](https://delvingbitcoin.org/t/how-to-linearize-your-cluster/303/15) approach seems like it could solve for a CCC that gives the largest feerate, by bisecting on different values for \lambdaλ\lambda, but that seems more like finding the breakpoints in order?

No, bisection does not find them in order. It always finds the optimal improvement for the diagram in the interval you are looking at. And then you choose the next interval to look for.

---

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