next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Matroids :: independentSets(Matroid)

independentSets(Matroid) -- independent subsets of a matroid

Synopsis

Description

A subset of the ground set is called independent if it is contained in a basis, or equivalently, does not contain a circuit. This method returns all independent subsets of the ground set of a fixed size $s$. If no size $s$ is given, returns a list of all independent sets of M.

i1 : M = matroid({a,b,c,d},{{a,b},{a,c}})

o1 = a matroid of rank 2 on 4 elements

o1 : Matroid
i2 : independentSets(M, 2)

o2 = {set {0, 1}, set {0, 2}}

o2 : List
i3 : netList independentSets M

     +----------+
o3 = |set {}    |
     +----------+
     |set {0}   |
     +----------+
     |set {1}   |
     +----------+
     |set {0, 1}|
     +----------+
     |set {2}   |
     +----------+
     |set {0, 2}|
     +----------+
i4 : V = specificMatroid "vamos"

o4 = a matroid of rank 4 on 8 elements

o4 : Matroid
i5 : I3 = independentSets(V, 3)

o5 = {set {0, 1, 2}, set {0, 1, 4}, set {0, 2, 4}, set {1, 2, 4}, set {0, 1,
     ------------------------------------------------------------------------
     3}, set {0, 3, 4}, set {1, 3, 4}, set {0, 2, 3}, set {2, 3, 4}, set {1,
     ------------------------------------------------------------------------
     2, 3}, set {0, 1, 5}, set {0, 2, 5}, set {1, 2, 5}, set {0, 3, 5}, set
     ------------------------------------------------------------------------
     {1, 3, 5}, set {2, 3, 5}, set {0, 4, 5}, set {1, 4, 5}, set {2, 4, 5},
     ------------------------------------------------------------------------
     set {3, 4, 5}, set {0, 1, 6}, set {0, 2, 6}, set {1, 2, 6}, set {0, 3,
     ------------------------------------------------------------------------
     6}, set {1, 3, 6}, set {2, 3, 6}, set {0, 4, 6}, set {1, 4, 6}, set {2,
     ------------------------------------------------------------------------
     4, 6}, set {3, 4, 6}, set {0, 5, 6}, set {1, 5, 6}, set {2, 5, 6}, set
     ------------------------------------------------------------------------
     {3, 5, 6}, set {4, 5, 6}, set {0, 1, 7}, set {0, 2, 7}, set {1, 2, 7},
     ------------------------------------------------------------------------
     set {0, 3, 7}, set {1, 3, 7}, set {2, 3, 7}, set {0, 4, 7}, set {1, 4,
     ------------------------------------------------------------------------
     7}, set {2, 4, 7}, set {3, 4, 7}, set {0, 5, 7}, set {1, 5, 7}, set {2,
     ------------------------------------------------------------------------
     5, 7}, set {3, 5, 7}, set {4, 5, 7}, set {0, 6, 7}, set {1, 6, 7}, set
     ------------------------------------------------------------------------
     {2, 6, 7}, set {3, 6, 7}, set {4, 6, 7}, set {5, 6, 7}}

o5 : List
i6 : #I3

o6 = 56

See also