[#MakeTxGraph]
= MakeTxGraph
:mrdocs:

Construct a new TxGraph with the specified limit on the number of transactions within a cluster, and on the sum of transaction sizes within a cluster&period;

== Synopsis

Declared in `&lt;txgraph&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::unique&lowbar;ptr&lt;TxGraph&gt;
MakeTxGraph(
    unsigned int max&lowbar;cluster&lowbar;count,
    uint64&lowbar;t max&lowbar;cluster&lowbar;size,
    uint64&lowbar;t acceptable&lowbar;cost,
    std::function&lt;std::strong&lowbar;ordering(xref:TxGraph/Ref.adoc[TxGraph::Ref] const&, xref:TxGraph/Ref.adoc[TxGraph::Ref] const&)&gt; const& fallback&lowbar;order) noexcept;
----

== Description

* max&lowbar;cluster&lowbar;count cannot exceed MAX&lowbar;CLUSTER&lowbar;COUNT&lowbar;LIMIT&period;
* acceptable&lowbar;cost controls how much linearization optimization work will be performed per cluster before they are considered to be of acceptable quality&period;
* fallback&lowbar;order determines how to break tie&hyphen;breaks between transactions&colon; fallback&lowbar;order(a, b) &lt; 0 means a is &quot;better&quot; than b, and will (in case of ties) be placed first&period; This ordering must be stable over the transactions&apos; lifetimes&period;

== Return Value

A new, empty TxGraph configured with the given limits&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *max&lowbar;cluster&lowbar;count*
| Maximum number of transactions per cluster&semi; cannot exceed MAX&lowbar;CLUSTER&lowbar;COUNT&lowbar;LIMIT&period;
| *max&lowbar;cluster&lowbar;size*
| Maximum sum of transaction sizes within a cluster&period;
| *acceptable&lowbar;cost*
| Amount of linearization optimization work performed per cluster before its quality is considered acceptable&period;
| *fallback&lowbar;order*
| Tie&hyphen;break comparator between transactions&semi; must be stable over their lifetimes&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
