[#cluster_linearize-DepGraph-GetConnectedComponent]
= xref:cluster_linearize.adoc[cluster&lowbar;linearize]::xref:cluster_linearize/DepGraph.adoc[DepGraph]::GetConnectedComponent
:relfileprefix: ../../
:mrdocs:

Get the connected component within the subset &quot;todo&quot; that contains tx (which must be in todo)&period;

== Synopsis

Declared in `&lt;cluster&lowbar;linearize&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
SetType
GetConnectedComponent(
    SetType const& todo,
    xref:cluster_linearize/DepGraphIndex.adoc[DepGraphIndex] tx) const noexcept;
----

== Description

Two transactions are considered connected if they are both in `todo`, and one is an ancestor of the other in the entire graph (so not just within `todo`), or transitively there is a path of transactions connecting them&period; This does mean that if `todo` contains a transaction and a grandparent, but misses the parent, they will still be part of the same component&period;

Complexity&colon; O(ret&period;Count())&period;

== Return Value

The connected component of tx within todo&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *todo*
| The subset of positions to search within&period;
| *tx*
| A position in todo whose component is returned&period;
|===


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