Group-Divisible Designs (GDD)¶
This module gathers everything related to Group-Divisible Designs. The
constructions defined here can be accessed through designs.<tab>
:
sage: designs.group_divisible_design(14,{4},{2})
Group Divisible Design on 14 points of type 2^7
The main function implemented here is group_divisible_design()
(which
calls all others) and the main class is GroupDivisibleDesign
. The
following functions are available:
group_divisible_design() |
Return a ![]() |
GDD_4_2() |
Return a ![]() ![]() ![]() |
Functions¶
-
sage.combinat.designs.group_divisible_designs.
GDD_4_2
(q, existence=False, check=True)¶ Return a
-GDD for
a prime power with
.
This method implements Lemma VII.5.17 from [BJL99] (p.495).
INPUT:
q
(integer)existence
(boolean) – instead of building the design, return:True
– meaning that Sage knows how to build the designUnknown
– meaning that Sage does not know how to build the design, but that the design may exist (seesage.misc.unknown
).False
– meaning that the design does not exist.
check
– (boolean) Whether to check that output is correct before returning it. As this is expected to be useless (but we are cautious guys), you may want to disable it whenever you want speed. Set toTrue
by default.
EXAMPLE:
sage: from sage.combinat.designs.group_divisible_designs import GDD_4_2 sage: GDD_4_2(7,existence=True) True sage: GDD_4_2(7) Group Divisible Design on 14 points of type 2^7 sage: GDD_4_2(8,existence=True) Unknown sage: GDD_4_2(8) Traceback (most recent call last): ... NotImplementedError
-
class
sage.combinat.designs.group_divisible_designs.
GroupDivisibleDesign
(points, groups, blocks, G=None, K=None, lambd=1, check=True, copy=True, **kwds)¶ Bases:
sage.combinat.designs.incidence_structures.IncidenceStructure
Group Divisible Design (GDD)
Let
and
be sets of positive integers and let
be a positive integer. A Group Divisible Design of index
and order
is a triple
where:
is a set of cardinality
is a partition of
into groups whose size belongs to
is a family of subsets of
whose size belongs to
such that any two points
from different groups appear simultaneously in exactly
elements of
. Besides, a group and a block intersect on at most one point.
If
and
has exactly
groups of cardinality
then
is said to have type
.
INPUT:
points
– the underlying set. Ifpoints
is an integer, then the set is considered to be
.
groups
– the groups of the design. Set toNone
for an automatic guess (this triggerscheck=True
and can thus cost some time).blocks
– collection of blocksG
– list of integers of which the sizes of the groups must be elements. Set toNone
(automatic guess) by default.K
– list of integers of which the sizes of the blocks must be elements. Set toNone
(automatic guess) by default.lambd
(integer) – value of, set to
by default.
check
(boolean) – whether to check that the design is indeed awith the right parameters. Set to
True
by default.copy
– (use with caution) if set toFalse
thenblocks
must be a list of lists of integers. The list will not be copied but will be modified in place (each block is sorted, and the whole list is sorted). Yourblocks
object will become the instance’s internal data.
EXAMPLE:
sage: from sage.combinat.designs.group_divisible_designs import GroupDivisibleDesign sage: TD = designs.transversal_design(4,10) sage: groups = [range(i*10,(i+1)*10) for i in range(4)] sage: GDD = GroupDivisibleDesign(40,groups,TD); GDD Group Divisible Design on 40 points of type 10^4
With unspecified groups:
sage: D = designs.transversal_design(4,3).relabel(list('abcdefghiklm'),inplace=False).blocks() sage: GDD = GroupDivisibleDesign('abcdefghiklm',None,D) sage: sorted(GDD.groups()) [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i'], ['k', 'l', 'm']]
-
groups
()¶ Return the groups of the Group-Divisible Design.
EXAMPLE:
sage: from sage.combinat.designs.group_divisible_designs import GroupDivisibleDesign sage: TD = designs.transversal_design(4,10) sage: groups = [range(i*10,(i+1)*10) for i in range(4)] sage: GDD = GroupDivisibleDesign(40,groups,TD); GDD Group Divisible Design on 40 points of type 10^4 sage: GDD.groups() [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [10, 11, 12, 13, 14, 15, 16, 17, 18, 19], [20, 21, 22, 23, 24, 25, 26, 27, 28, 29], [30, 31, 32, 33, 34, 35, 36, 37, 38, 39]]
TESTS:
Non-integer ground set:
sage: TD=designs.transversal_design(5,5) sage: TD.relabel({i:chr(97+i) for i in range(25)}) sage: TD.groups() [['a', 'b', 'c', 'd', 'e'], ['f', 'g', 'h', 'i', 'j'], ['k', 'l', 'm', 'n', 'o'], ['p', 'q', 'r', 's', 't'], ['u', 'v', 'w', 'x', 'y']]
-
sage.combinat.designs.group_divisible_designs.
group_divisible_design
(v, K, G, existence=False, check=False)¶ Return a
-Group Divisible Design.
A
-GDD is a pair
where:
is a partition of
where
is a
-PBD
For more information, see the documentation of
GroupDivisibleDesign
orPairwiseBalancedDesign
.INPUT:
v
(integer)K,G
(sets of integers)existence
(boolean) – instead of building the design, return:True
– meaning that Sage knows how to build the designUnknown
– meaning that Sage does not know how to build the design, but that the design may exist (seesage.misc.unknown
).False
– meaning that the design does not exist.
check
– (boolean) Whether to check that output is correct before returning it. As this is expected to be useless (but we are cautious guys), you may want to disable it whenever you want speed. Set toTrue
by default.
Note
The GDD returned by this function are defined on
range(v)
, and its groups are sets of consecutive integers.EXAMPLES:
sage: designs.group_divisible_design(14,{4},{2}) Group Divisible Design on 14 points of type 2^7