Identifier
Identifier
Values
[] generating graphics... => 1
[1] generating graphics... => 1
[2] generating graphics... => 2
[1,1] generating graphics... => 0
[3] generating graphics... => 2
[2,1] generating graphics... => 2
[1,1,1] generating graphics... => 0
[4] generating graphics... => 4
[3,1] generating graphics... => 2
[2,2] generating graphics... => 3
[2,1,1] generating graphics... => 2
[1,1,1,1] generating graphics... => 0
[5] generating graphics... => 3
[4,1] generating graphics... => 8
[3,2] generating graphics... => 8
[3,1,1] generating graphics... => 6
[2,2,1] generating graphics... => 7
[2,1,1,1] generating graphics... => 2
[1,1,1,1,1] generating graphics... => 0
[6] generating graphics... => 8
[5,1] generating graphics... => 8
[4,2] generating graphics... => 32
[4,1,1] generating graphics... => 18
[3,3] generating graphics... => 4
[3,2,1] generating graphics... => 34
[3,1,1,1] generating graphics... => 20
[2,2,2] generating graphics... => 16
[2,2,1,1] generating graphics... => 14
[2,1,1,1,1] generating graphics... => 2
[1,1,1,1,1,1] generating graphics... => 0
[7] generating graphics... => 6
[6,1] generating graphics... => 30
[5,2] generating graphics... => 40
[5,1,1] generating graphics... => 60
[4,3] generating graphics... => 42
[4,2,1] generating graphics... => 184
[4,1,1,1] generating graphics... => 82
[3,3,1] generating graphics... => 80
[3,2,2] generating graphics... => 104
[3,2,1,1] generating graphics... => 246
[3,1,1,1,1] generating graphics... => 30
[2,2,2,1] generating graphics... => 84
[2,2,1,1,1] generating graphics... => 54
[2,1,1,1,1,1] generating graphics... => 2
[1,1,1,1,1,1,1] generating graphics... => 0
[8] generating graphics... => 22
[7,1] generating graphics... => 44
[6,2] generating graphics... => 238
[6,1,1] generating graphics... => 210
[5,3] generating graphics... => 66
[5,2,1] generating graphics... => 588
[5,1,1,1] generating graphics... => 622
[4,4] generating graphics... => 160
[4,3,1] generating graphics... => 766
[4,2,2] generating graphics... => 1134
[4,2,1,1] generating graphics... => 1588
[4,1,1,1,1] generating graphics... => 426
[3,3,2] generating graphics... => 342
[3,3,1,1] generating graphics... => 1398
[3,2,2,1] generating graphics... => 1756
[3,2,1,1,1] generating graphics... => 1740
[3,1,1,1,1,1] generating graphics... => 30
[2,2,2,2] generating graphics... => 374
[2,2,2,1,1] generating graphics... => 630
[2,2,1,1,1,1] generating graphics... => 210
[2,1,1,1,1,1,1] generating graphics... => 2
[1,1,1,1,1,1,1,1] generating graphics... => 0
click to show generating function       
Description
The number of graphs with given frequency partition.
The frequency partition of a graph on $n$ vertices is the partition obtained from its degree sequence by recording and sorting the frequencies of the numbers that occur.
For example, the complete graph on $n$ vertices has frequency partition $(n)$. The path on $n$ vertices has frequency partition $(n-2,2)$, because its degree sequence is $(2,\dots,2,1,1)$. The star graph on $n$ vertices has frequency partition is $(n-1, 1)$, because its degree sequence is $(n-1,1,\dots,1)$.
There are two graphs having frequency partition $(2,1)$: the path and an edge together with an isolated vertex.
Code
def statistic(la):
    """The number of graphs with frequency partition la.

    The frequency partition of a graph on n vertices is the partition
    obtained by taking the frequencies of the degrees of its vertices.

    sage: statistic([2,1])
    2
    """
    c = 0
    la = Partition(la)
    for G in graphs(la.size()):
        s = G.degree_sequence()
        if Partition(sorted([s.count(i) for i in Set(s)], reverse=True)) == la:
            c += 1
    return c
Created
Nov 04, 2016 at 22:15 by Martin Rubey
Updated
Nov 04, 2016 at 22:15 by Martin Rubey