Skip to content

TopologicallyConnectedComponents ​

The topologically connected components of the arc diagram: blocks joined when an arc of one crosses an arc of the other.

✓ checked against that system · ! checked, with disagreements (hover a chip)FindStatSt000924via PerfectMatching✓St000925via SetPartition✓
TopologicallyConnectedComponents(partition)The topologically connected components of the arc diagram: blocks joined when an arc of one crosses an arc of the other.
Typed signatures
TypePackageApplies
(set_partition) -> numbercombinatoricsalways

Domain: Set partition statistics

Details
  • Defined over SetPartition as an expression in _x, evaluated by compute-engine — the definition IS the implementation.
  • Takes a SetPartition and nothing else — it reads values against their positions, or walks the orbits, so it needs the bijection. Applying it to a bare list is a type error, not a wrong answer.
  • FindStat's St000925. A singleton, which has no arc, is a component of its own.

Definition

Epsil, as the implementation runs it.

on SetPartition, over _x

Length(_x) if Length(Flatten(Map(Function(Most(b), b), _x))) < 1 else Apply(
                                                                             (owner: list<integer>) => Apply(
                                                                                                              (arcOwner: list<integer>) => Apply(
                                                                                                                                                  (crossing: list<list<integer>>) => Apply(
                                                                                                                                                                                            (labels: list<integer>) => Count(Filter(Range(1, Length(_x), 1), Function(labels[c] == c, c))),
                                                                                                                                                                                            Apply((start: list<integer>) => Fold((a: list<integer>, b) => Apply(
                                                                                                                                                                                                                                                                 (pass: list<integer>) => pass,
                                                                                                                                                                                                                                                                 Apply(
                                                                                                                                                                                                                                                                        (reach: list<integer>) => Map(Function(Min(Map(
                                                                                                                                                                                                                                                                                                                        Function(a[c] if i == 0 else reach[i] if arcOwner[i] == c else Length(_x) + 1, i),
                                                                                                                                                                                                                                                                                                                        Range(0, Length(Flatten(Map(Function(Most(b), b), _x))), 1),
                                                                                                                                                                                                                                                                                                                      )), c), Range(1, Length(_x), 1)),
                                                                                                                                                                                                                                                                        Map(Function(Min(Map(
                                                                                                                                                                                                                                                                                              Function(Length(_x) + 1 if j == 0 else a[arcOwner[j]] if crossing[i][j] == 1 else Length(_x) + 1, j),
                                                                                                                                                                                                                                                                                              Range(0, Length(Flatten(Map(Function(Most(b), b), _x))), 1),
                                                                                                                                                                                                                                                                                            )), i), Range(1, Length(Flatten(Map(Function(Most(b), b), _x))), 1)),
                                                                                                                                                                                                                                                                      ),
                                                                                                                                                                                                                                                               ), start, Range(1, Length(_x), 1)), Range(1, Length(_x), 1)),
                                                                                                                                                                                          ),
                                                                                                                                                  Map(Function(Map(
                                                                                                                                                                    Function(1 if [Max(
                                                                                                                                                                                        Flatten(Map(Function(Most(b), b), _x))[i],
                                                                                                                                                                                        Flatten(Map(Function(Most(b), b), _x))[j],
                                                                                                                                                                                      ) <
                                                                                                                                                                                   (Flatten(Map(Function(Rest(b), b), _x))[i] if Flatten(Map(Function(Most(b), b), _x))[i] <
                                                                                                                                                                                                                                 Flatten(Map(Function(Most(b), b), _x))[j] else Flatten(Map(Function(Rest(b), b), _x))[j]) &&
                                                                                                                                                                                   (Flatten(Map(Function(Rest(b), b), _x))[i] if Flatten(Map(Function(Most(b), b), _x))[i] <
                                                                                                                                                                                                                                 Flatten(Map(Function(Most(b), b), _x))[j] else Flatten(Map(Function(Rest(b), b), _x))[j]) <
                                                                                                                                                                                   (Flatten(Map(Function(Rest(b), b), _x))[j] if Flatten(Map(Function(Most(b), b), _x))[i] <
                                                                                                                                                                                                                                 Flatten(Map(Function(Most(b), b), _x))[j] else Flatten(Map(Function(Rest(b), b), _x))[i]), Max(
                                                                                                                                                                                          Flatten(Map(Function(Most(b), b), _x))[i],
                                                                                                                                                                                          Flatten(Map(Function(Most(b), b), _x))[j],
                                                                                                                                                                                        ) <
                                                                                                                                                                                     (Flatten(Map(Function(Rest(b), b), _x))[i] if Flatten(Map(Function(Most(b), b), _x))[i] <
                                                                                                                                                                                                                                   Flatten(Map(Function(Most(b), b), _x))[j] else Flatten(Map(Function(Rest(b), b), _x))[j]) &&
                                                                                                                                                                                     (Flatten(Map(Function(Rest(b), b), _x))[j] if Flatten(Map(Function(Most(b), b), _x))[i] <
                                                                                                                                                                                                                                   Flatten(Map(Function(Most(b), b), _x))[j] else Flatten(Map(Function(Rest(b), b), _x))[i]) <
                                                                                                                                                                                     (Flatten(Map(Function(Rest(b), b), _x))[i] if Flatten(Map(Function(Most(b), b), _x))[i] <
                                                                                                                                                                                                                                   Flatten(Map(Function(Most(b), b), _x))[j] else Flatten(Map(Function(Rest(b), b), _x))[j])][1] else 0, j),
                                                                                                                                                                    Range(1, Length(Flatten(Map(Function(Most(b), b), _x))), 1),
                                                                                                                                                                  ), i), Range(1, Length(Flatten(Map(Function(Most(b), b), _x))), 1)),
                                                                                                                                                ),
                                                                                                              Map(
                                                                                                                   Function(owner[Flatten(Map(Function(Most(b), b), _x))[i]], i),
                                                                                                                   Range(1, Length(Flatten(Map(Function(Most(b), b), _x))), 1),
                                                                                                                 ),
                                                                                                            ),
                                                                             Map(
                                                                                  Function(Min(Filter(
                                                                                                       Range(1, Length(_x), 1),
                                                                                                       Function(Contains(_x[k], e), k),
                                                                                                     )), e),
                                                                                  Range(
                                                                                         1,
                                                                                         Sum(Map(Function(Length(b), b), _x)),
                                                                                         1,
                                                                                       ),
                                                                                ),
                                                                           )

Examples

Basic #

the partition {1,3}∣{2}\{1,3\} \mid \{2\}

live ↗
InTopologicallyConnectedComponents(SetPartition⁡([[1,3],[2]]))\mathrm{TopologicallyConnectedComponents}({\operatorname{SetPartition}}([[1, 3], [2]]))Out22

the partition {1}∣{2,4}∣{3}\{1\} \mid \{2,4\} \mid \{3\}

live ↗
InTopologicallyConnectedComponents(SetPartition⁡([[1],[2,4],[3]]))\mathrm{TopologicallyConnectedComponents}({\operatorname{SetPartition}}([[1], [2, 4], [3]]))Out33
Properties #

FindStat's value for {{1,2}}

live ↗
InCombinatorialStat(SetPartition⁡([[1,2]]),TopologicallyConnectedComponents)\mathrm{CombinatorialStat}({\operatorname{SetPartition}}([[1, 2]]), \text{TopologicallyConnectedComponents})Out11

Known value · FindStat St000925

FindStat's value for {{1,2,3}}

live ↗
InCombinatorialStat(SetPartition⁡([[1,2,3]]),TopologicallyConnectedComponents)\mathrm{CombinatorialStat}({\operatorname{SetPartition}}([[1, 2, 3]]), \text{TopologicallyConnectedComponents})Out11

Known value · FindStat St000925

FindStat's value for {{1},{2}}

live ↗
InCombinatorialStat(SetPartition⁡([[1],[2]]),TopologicallyConnectedComponents)\mathrm{CombinatorialStat}({\operatorname{SetPartition}}([[1], [2]]), \text{TopologicallyConnectedComponents})Out22

Known value · FindStat St000925

About
Examples5
CrosswalkFindStat ×2