# Merging incomparable linearizations

**URL:** <https://delvingbitcoin.org/t/merging-incomparable-linearizations/209>\
**Category:** Implementation\
**Tags:** wg-cluster-mempool, mempool\
**Created:** [November 19, 2023, 4:12am UTC](https://delvingbitcoin.org/t/merging-incomparable-linearizations/209 "2023-11-19T04:12:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ajtowns](https://delvingbitcoin.org/user_avatar/delvingbitcoin.org/ajtowns/32/417_2.png) [@ajtowns](https://delvingbitcoin.org/u/ajtowns)\
**Post date:** [November 20, 2023, 9:46am UTC](https://delvingbitcoin.org/t/merging-incomparable-linearizations/209/2 "2023-11-20T09:46:53Z")

</div>

> [@sipa](#):
>
> The second input is [B,A,C,F,E,D,G], which is chunked as [BACFE,DG]. The BACFE chunk has higher feerate (66/5=13.5) than B (13) initially, but gets overtaken by the AEDGC chunk.

One way of characterising a chunk is by listing its childless-descendants; for BACFE, those would be E and F. But in this case F’s feerate alone is 11, while BACFE’s is 13.2; which gives you an easy clue that splitting that chunk into [BACE,F] would be an improvement.

> [@sipa](#):
>
> If one diagram is on top in some place(s) and the other is on top in others, we call them incomparable.

I think you could extend this comparison to create a compatible total order just by saying “given two diagrams, d\_1 and d\_2, then if x\_0 is the earliest point where d\_1(x\_0) \ne d\_2(x\_0), then d\_1 \> d\_2 iff d\_1(x\_0) \> d\_2(x\_0)” ?

I think “prefix-intersection merging” then guarantees to produce a linearisation L\_3 such that L\_3 \ge L\_1 and L\_3 \ge L\_2 according to that total order. I don’t think it guarantees that L\_3 will be comparable to L\_1 or L\_2 according to the original partial order, but I think you’d need a fairly complicated cluster for that to actually occur.

---

_[View the full topic](https://delvingbitcoin.org/t/merging-incomparable-linearizations/209)._
