File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ cdef class Matroid(SageObject):
177
177
cpdef _is_3connected_BC_recursion(self , basis, fund_cocircuits) noexcept
178
178
cpdef is_paving(self ) noexcept
179
179
cpdef is_sparse_paving(self ) noexcept
180
+ cpdef girth(self ) noexcept
180
181
181
182
# representability
182
183
cpdef _local_binary_matroid(self , basis = * ) noexcept
Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ additional functionality (e.g. linear extensions).
111
111
- :meth:`connectivity( ) <sage. matroids. matroid. Matroid. connectivity>`
112
112
- :meth:`is_paving( ) <sage. matroids. matroid. Matroid. is_paving>`
113
113
- :meth:`is_sparse_paving( ) <sage. matroids. matroid. Matroid. is_sparse_paving>`
114
+ - :meth:`girth( ) <sage. matroids. matroid. Matroid. girth>`
114
115
115
116
- Representation
116
117
- :meth:`binary_matroid( ) <sage. matroids. matroid. Matroid. binary_matroid>`
@@ -5976,6 +5977,33 @@ cdef class Matroid(SageObject):
5976
5977
return False
5977
5978
return True
5978
5979
5980
+ cpdef girth(self ) noexcept:
5981
+ r """
5982
+ Return the girth of the matroid.
5983
+
5984
+ The girth is the size of the smallest circuit. In case the matroid has
5985
+ no circuits the girth is `\i nfty`.
5986
+
5987
+ EXAMPLES::
5988
+
5989
+ sage: matroids. Uniform( 5,5) . girth( )
5990
+ inf
5991
+ sage: matroids. catalog. K4( ) . girth( )
5992
+ 3
5993
+ sage: matroids. catalog. Vamos( ) . girth( )
5994
+ 4
5995
+
5996
+ REFERENCES:
5997
+
5998
+ [Oxl2011 ]_, p. 327.
5999
+ """
6000
+ for k in range (self .rank() + 2 ):
6001
+ for X in combinations(self .groundset(), k):
6002
+ X = frozenset (X)
6003
+ if self ._is_circuit(X):
6004
+ return k
6005
+ return float (' inf' )
6006
+
5979
6007
# representability
5980
6008
5981
6009
cpdef _local_binary_matroid(self , basis = None ) noexcept:
You can’t perform that action at this time.
0 commit comments