h$MKY      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l mnopqrs (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred>matroid6data type to keep track of forrests in a (multi-)graphmatroidobtain an empty forrestmatroid4Takes a forrest and tries to add another edge to it. If possible (t), then it returns the forrest with the edge added otherwise (u2) returns the component with a cycle after adding e!. Please note that for a result Left x , the set x contains a cycle, but it is not necessarily a cycle itself. (It's a cycle with trees on it)matroidfresh component id counter matroid/tracks which vertex belongs to which component matroid-tracks which edges belong to which component matroid(forrest to insert into / find the cycle matroidname of the edge matroidincidence tuple of the edge; (x,x)% represents a loop around the vertex x  (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred>5matroidlittle helper that either chooses the implementation of a typeclass member from the record, or uses the default implementationmatroidrecord getter function matroid the matroid matroid/default implementation of the typeclass member  (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred matroid;returns the rank of the set, wrt. to the given basis filter matroid(tests whether a given set is independent matroid6obtains an independent subset with maximal cardinality matroid#computes the closure of a given set matroid returns the loops in the matroid matroid!rank function of the dual matroidmatroid"returns the coloops in the matroidmatroidbasis filter of the matroidmatroidset of matroid elements matroid!the rank function of the matroid matroidset of matroid elements matroid$the independence test of the matroidmatroidset of matroid elements matroid!the rank function of the matroid matroidthe groundset of the matroidmatroidset of matroid elements matroid$the closure operator of the matroid matroid!the rank function of the matroid matroidthe ground set of the matroid matroidset of matroid elements matroid!the rank function of the matroid matroidthe ground set of the matroid    (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred>tmatroid8abstract matroid data type with elements of a given typeIts purpose is to hide the underlying type from the type system. The records resemble the typeclass Matroid, where everything except for the groundset has been placed inside the v-Monad. A value of w indicates that the default implementation of the typeclass should be used.matroiddefault values for matroid*returns the restriction of a given matroidNote that this routine implements the correct routines provided that the prerequisite members in the input matroid are defined. Routines which have missing prerequisite members in the input matroid will be left to w.  fills all  record members. matroid1returns the restriction of a given matroid, namedNote that this routine implements the correct routines provided that the prerequisite members in the input matroid are defined. Routines which have missing prerequisite members in the input matroid will be left to w.  fills all  record members.!matroid*returns the contraction of a given matroidNote that this routine implements the correct routines provided that the prerequisite members in the input matroid are defined. Routines which have missing prerequisite members in the input matroid will be left to w.  fills all  record members."matroid1returns the contraction of a given matroid, namedNote that this routine implements the correct routines provided that the prerequisite members in the input matroid are defined. Routines which have missing prerequisite members in the input matroid will be left to w.  fills all  record members.#matroid*returns the contraction of a given matroidNote that this routine implements the correct routines provided that the prerequisite members in the input matroid are defined. Routines which have missing prerequisite members in the input matroid will be left to w.  fills all  record members.$matroid1returns the contraction of a given matroid, namedNote that this routine implements the correct routines provided that the prerequisite members in the input matroid are defined. Routines which have missing prerequisite members in the input matroid will be left to w.  fills all  record members.matroidinput matroid matroidrestriction of ground set matroidname matroidinput matroid matroidrestriction of ground set !matroidinput matroid matroid&contract the ground set onto this set "matroidname matroidinput matroid matroid&contract the ground set onto this set #matroidinput matroid $matroidname matroidinput matroid  !"#$ !"#$ (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred>"&matroid3Typeclass that provides the full matroid interface.The type parameter a is the type of the elements of the matroid, it is most commonly used in a (x a) type.In this typeclass, we assume that every set of matroid elements passed to any of the routines is actually a subset of ' m=. Behaviour for other sets shall be considered undefined.In order to keep things DRY, the default implementations are fumbled through the  a# instance definition below through 43 and setting the corresponding record value to w.'matroidThe ground set of the matroid, its elements are usually called edges. This set is finite.(matroid)name of the matroid, may be used for show)matroidreturns the rank of the set*matroid(tests whether a given set is independent+matroidobtains an independent subset of the input subset, which has maximal cardinality among all such subsets.Please note that this routine returns a basis of the input subset wrt. the matroid, which is not necessarily also a basis of the matroid itself. You can obtain at least one basis of the matroid via basis m $ groundset m,matroid#computes the closure of a given set-matroid/returns this matroid as abstract matroid object.matroid;returns the dual of this matroid as abstract matroid object/matroidreturns the restricted matroid M|X as result of the unary matroid operation *|X0matroidreturns the contracted matroid M.X as a result of the unary matroid operation *.X1matroid returns the loops in the matroid2matroid!rank function of the dual matroid3matroid"returns the coloops in the matroid4matroid.takes an object of a type that implements the &! typeclass, and turns it into an  record.5matroidThis instance contains the default implementations of the members of the & typeclass. )matroid the matroid matroidset of matroid elements*matroid the matroid matroidset of matroid elements+matroid the matroidmatroidset of matroid elements,matroid the matroidmatroidset of matroid elements -matroidmatroid .matroidmatroid /matroid the matroid matroid$restricts the ground set to this set0matroid the matroid matroid'contracts the ground set onto this set 1matroid the matroid 2matroid the matroid matroidset of matroid elements 3matroid the matroid &0/.-'321,+*)(4&0/.-'321,+*)(4 (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred>) 6matroidwe use this data type to combine a given a basis filter with the default implementations from the Matroid typeclassymatroid%matroid from basis-filter constructor7matroidwe use this data type to combine a given independence test with the default implementations from the Matroid typeclasszmatroid*matroid from independence-test constructor8matroidwe use this data type to combine a given rank function with the default implementations from the Matroid typeclass{matroid&matroid from rank function constructor9matroid5matroid constructor given groundset and rank function:matroid;named matroid constructor given groundset and rank function;matroid=matroid constructor given groundset and test for independence<matroidnamed matroid constructor given groundset and test for independence=matroid8matroid constructor given groundset and set-basis filter>matroid>named matroid constructor given groundset and set-basis filter ymatroidnamematroidground set of the matroidmatroid?function that returns a maximal independent subset of its inputzmatroidnamematroidground set of the matroidmatroidindependence test function{matroidnamematroidground set of the matroidmatroid rank function9matroid ground set matroidrank function :matroidname matroid ground set matroidrank function ;matroid ground set matroidindependence test <matroidname matroid ground set matroidindependence test =matroid ground set matroid#returns maximal independent subset >matroidname matroid ground set matroid#returns maximal independent subset 6789:;<=> 9:;<=>876 (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred>/Ematroiddata type representing the cycle matroid (aka. polygon matroid) of a (multi-)graphFmatroid constructs a E; from a set of (abstract) edges and the incident-vertex mapGmatroidconstructs an unnamed E; from a set of (abstract) edges and the incident-vertex mapHmatroidconstructs a named E; from a set of (abstract) edges and the incident-vertex mapImatroidconstructs the graphic matroid M(K_n) where K_n is the complete graph on n vertices|matroidgiven name of the matroidmatroid4ground set of M(G) = E for a (multi-)graph G = (V,E)matroidmap that maps the edge e to the set of its incident vertices {u,v}; the order is ignored, and {v} is represented by (v,v) Fmatroid!set of edges of the (multi-)graphmatroidmap that maps the edge e to the set of its incident vertices {u,v}; the order is ignored, and {v} is represented by (v,v) Gmatroid!set of edges of the (multi-)graphmatroidmap that maps the edge e to the set of its incident vertices {u,v}; the order is ignored, and {v} is represented by (v,v) Hmatroidname of the matroid matroid!set of edges of the (multi-)graphmatroidmap that maps the edge e to the set of its incident vertices {u,v}; the order is ignored, and {v} is represented by (v,v) Imatroidn = number of vertices in K_nEFGHIEFHGI (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred>3LmatroidObtains an independent set of the given matroid that is optimal wrt. some optimization problem.This version uses a ranking of the benefits of the elements of the groundset and the indep function in order to obtain an optimal result.MmatroidObtains an independent set of the given matroid that is optimal wrt. some optimization problem.This version uses a choice function that selects the best element from a list of allowed choices, or Nothing to stop the process.Lmatroidmatroid to optimize on matroidelements of the groundset of the matroid, ordered from the best (most revenue, least cost, ...) element to the worst yet still improving element Mmatroidmatroid to optimize on matroidpicks the best element from the set, or nothing if adding an element would result in a worse outcome LMLM (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred>4ILM  (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred>5Nmatroid"enumerates all bases of a matroid Nmatroidmatroid NN  (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred>9(Omatroiddata type that represents a free matroid over a given set (free matroids are of course uniform)}matroid ground setPmatroiddata type representing a uniform matroid over a given ground set~matroiduniform matroid constructorQmatroid>returns a uniform matroid on the intergers from 1..n of rank rRmatroid9returns a uniform matroid on a given ground set of rank rSmatroidreturns a free matroid on a given ground set (where every subset of the groundset is independent)~matroid!ground set of the uniform matroidmatroidrank of the uniform matroid (provided that groundset is big enough), must be >= 0. Qmatroid0size of the uniform matroid (number of edges, n)matroidrank of the uniform matroid (r)Rmatroid!ground set of the uniform matroidmatroidrank of the uniform matroid (r)Smatroidground set of the free matroidOPQRSPRQOS (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred95 !"#$&0/.-'321,+*()49:;<=>EFGHIOPQRS9:;<=>  (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred>= \matroid5a generator for uniform matroids of a reasonable size]matroid.a generator for uniform matroids of small size^matroid3a generator for graphic matroids of reasonable size_matroid.a generator for graphic matroids of small size`matroid2a generator for M(K_n) matroids of reasonable sizeamatroid2a generator for free matroids of a reasonable sizebmatroida generator for consintency matroid type based on another generatorcmatroida generator for consintency matroid type based on another generatordmatroida generator for consintency matroid type based on another generatorematroida generator for matroids of the form M|X based on a generator for Mfmatroida generator for matroids of the form M.X based on a generator for Mgmatroida generator for matroids of the form M^* based on a generator for M \]^_`abcdefg \]^_`abcdefg  (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIX Safe-Inferred>A~hmatroidTests whether a given integer valued set function is indeed monotone increasing in at most unit stepsimatroidTests whether a given boolean valued set function indeed only flips from true to false once when adding elements to its argumentjmatroid>Tests the exchange property of the indep function of a matroidkmatroidTests whether a given set valued set function is isotone in the set latticehmatroidthe rank function (or similar) matroid$sequence to check monotonicity with imatroid the indep function (or similar) matroid$sequence to check monotonicity with jmatroidthe indep function matroidX matroidY kmatroidthe cl function (or similar) matroid$sequence to check monotonicity with hijkhijk  (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIXNone>B+lmatroidmatroid test case generator ll (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIXNone>Jmmatroid+all tests that any matroid should/must passnmatroid;tests the invariants associated with operations on matroidsrk_{M|X}(Y) = rk_M(Y)coRk_{M.X}(Y) = coRk_M(Y)rk_(M^*)(Y) = coRk_M(Y)loop(M) = coloop(M^*)coloop(M^*) = loop(M)%groundsets of restriction/contraction&restriction is the dual of contractionomatroidtest suite for rank axioms The following properties are verified: - rk is monotone increasing - rk(X+{x}) <= rk(X) + 1 (unit increasing) - rk(emptyset) = 0 (important special case) - rk(X) <= |X| (subcardinal) - rk(A/B) + rk(A/B) <= rk(A) + rk(B) (submodular)pmatroidtest suite for indep propertiesThe following properties are verified: - indep X && Ysubseteq X => indep Y (hereditary) - indep emptyset - indep X && indep Y && |Y| > |X| => exists yin Y: indep X+{y} (exchange property)qmatroidtest suite for basis propertiesThe following properties are verified: - basis X subseteq X - indep (basis X) - y in X(basis X) => not indep (basis X)+{y}rmatroid+test suite for closure operator properties The following properties are verified: - cl is monotone - cl(X) subseteq E - cl(cl(X)) == cl(X) (idempotence) - e in EX, yin cl(X+{e})cl(X) => e in cl(X+{y}) - rk(X) == rk(cl(X)) and cl(X) is maximal with this propertysmatroidtests a given matroid implementation for equality against the default implementationsrk, indep, and cl should produce the same output when given the same input.basis however is only required to produce a basis of the given subset, and which basis is produced really depends on how the basis is derived. Here, we are ok if b1 and b2 have cl1(b1) == cl1(b2) == cl2(b1) == cl2(b2).mmatroidmatroid test case generator nmatroidmatroid test case generator omatroidmatroid test case generator pmatroidmatroid test case generator qmatroidmatroid test case generator rmatroidmatroid test case generator smatroidmatroid test case generator mnopqrsmnopqrs (c) Immanuel Albrecht, 2020-202xBSD-3mail@immanuel-albrecht.de experimentalPOSIXNoneKA\]^_`abcdefglmnopqrs !"#$%&'()*+,-./0123456789:;<=>? !@ABCDEFGHIJKLMNOPQRSTUVWX Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v wxyz{|}~  matroid-0.0.0.1-inplaceData.Matroid.Graphic.InternalData.Matroid.Internal.HelpersData.Matroid.Typeclass.DefaultsData.Matroid.OpsData.Matroid.TypeclassData.Matroid.InternalData.Matroid.GraphicData.Matroid.Algorithms.Greedy!Data.Matroid.Algorithms.EnumerateData.Matroid.UniformTest.Matroid.GeneratorsTest.Matroid.HelpersTest.Matroid.Algorithms.SuitesTest.Matroid.SuiteswrapUpData.Matroid.Algorithms Data.Matroid Test.MatroidForrestF emptyForrestinsertEdgeOrGetCycleComponent $fShowForrest $fEqForrest $fOrdForrest defaultsTorkindepbasisclloopscoRkcoloopsAMatroidWMatroid w_groundset w_showNamew_rkw_indepw_basisw_cl w_abstractw_dual w_restriction w_contractionw_loopsw_coRk w_coloopswrappedMatroid a_restrictiona_namedRestriction a_contractiona_namedContractiona_dual a_namedDual$fShowAMatroidMatroid groundsetshowNameabstractdual restriction contraction$fMatroidAMatroidaBasisFilterMatroid IndepMatroid RkMatroidfromRk namedFromRk fromIndepnamedFromIndepfromBasisFilternamedFromBasisFilter$fMatroidRkMatroida$fShowRkMatroid$fMatroidIndepMatroida$fShowIndepMatroid$fMatroidBasisFilterMatroida$fShowBasisFilterMatroidGraphicMatroid fromGraph fromGraph'namedFromGraphmK$fMatroidGraphicMatroida$fShowGraphicMatroidgreedygreedy1enumerateBases FreeMatroidUniformMatroiduniform uniformOnfreeOn$fMatroidUniformMatroida$fShowUniformMatroid$fShowFreeMatroid$fMatroidFreeMatroida$fEqFreeMatroid$fOrdFreeMatroid$fEqUniformMatroid$fOrdUniformMatroidgenUniformMatroidsgenSmallUniformMatroidsgenGraphicMatroidsgenSmallGraphicMatroidsgenMKnMatroidsgenFreeMatroidsviaRankviaIndepviaBasisFilterviaRestrictionviaContractionviaDualisMonotoneUnitIncreasingisMonotoneDecreasingBoolhasIndepExchangePropertyisIsotoneSetMapgreedyOptimizationTestSuite matroidSuiteopInvariantsSuiterkPropertiesSuiteindepPropertiesSuitebasisPropertiesSuiteclPropertiesSuiteviaConsistencySuitebase Data.EitherRightLeft GHC.MaybeMaybeNothingcontainers-0.6.2.1Data.Set.InternalSetBasisMIndepMRkMMGFreeU