effect-tree - v1.0.36
    Preparing search index...

    Function getPruferCodeArbitrary

    • An arbitrary for a valid Prüfer code with the given node count, by default 3. An arbitrary for a Prüfer code must obey these laws:

      1. Number of codes is nodeCount - 2.
      2. Every code in the array is in th range 1 ≤ code ≤ nodeCount.

      The set of codes generated is in bijection with all vertex trees of nodeCount nodes.

      The 1st Prüfer code is [] which decodes to the only possible vertex tree at node count 2:

      ┬1
      └─2
      

      Parameters

      • nodeCount: number = 3

      Returns Arbitrary<number[]>