(self)
return tuple([rgs[i] for i in sorted(
            [i for p in partition for i in p], key=default_sort_key)])
Returns the "restricted growth string" of the partition.

        The RGS is returned as a list of indices, L, where L[i] indicates
        the block in which element i appears. For example, in a partition
        of 3 elements (a, b, c) into 2 blocks ([c], [a, b]) the RGS is
        [1, 1, 0]: "a" is in block 1, "b" is in block 1 and "c" is in block 0.

        Examples
        ========

        >>> from sympy.combinatorics.partitions import Partition
        >>> a = Partition([[1, 2], [3], [4, 5]])
        >>> a.members
        (1, 2, 3, 4, 5)
        >>> a.RGS
        (0, 0, 1, 2, 2)
        >>> a + 1
        {{1, 2}, {3}, {4}, {5}}
        >>> _.RGS
        (0, 0, 1, 2, 3)
Returns the "restricted growth string" of the partition.
Returns the restricted growth string of the partition .
def RGS(self):
        """
        Returns the "restricted growth string" of the partition.

        The RGS is returned as a list of indices, L, where L[i] indicates
        the block in which element i appears. For example, in a partition
        of 3 elements (a, b, c) into 2 blocks ([c], [a, b]) the RGS is
        [1, 1, 0]: "a" is in block 1, "b" is in block 1 and "c" is in block 0.

        Examples
        ========

        >>> from sympy.combinatorics.partitions import Partition
        >>> a = Partition([[1, 2], [3], [4, 5]])
        >>> a.members
        (1, 2, 3, 4, 5)
        >>> a.RGS
        (0, 0, 1, 2, 2)
        >>> a + 1
        {{1, 2}, {3}, {4}, {5}}
        >>> _.RGS
        (0, 0, 1, 2, 3)
        """
        rgs = {}
        partition = self.partition
        for i, part in enumerate(partition):
            for j in part:
                rgs[j] = i
        return tuple([rgs[i] for i in sorted(
            [i for p in partition for i in p], key=default_sort_key)])
def RGS ( self ) : rgs = { } partition = self . partition for i , part in enumerate ( partition ) : for j in part : rgs [ j ] = i return tuple ( [ rgs [ i ] for i in sorted ( [ i for p in partition for i in p ] , key = default_sort_key ) ] )