PageRenderTime 38ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/ComputerAlgebra/Matroids/Lisp/plans/general.hpp

https://github.com/exp04shy/oklibrary
C++ Header | 134 lines | 0 code | 2 blank | 132 comment | 0 complexity | e744b4f86ce224d83674bdd59ad49ad4 MD5 | raw file
  1. // Oliver Kullmann, 13.7.2008 (Swansea)
  2. /* Copyright 2008 Oliver Kullmann
  3. This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
  4. it and/or modify it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation and included in this library; either version 3 of the
  6. License, or any later version. */
  7. /*!
  8. \file ComputerAlgebra/Matroids/Lisp/plans/general.hpp
  9. \brief Plans regarding matroids in Maxima/Lisp
  10. \todo Fundamental notions
  11. <ul>
  12. <li> A "matroid" is a special type of hypergraph. </li>
  13. <li> A problem are the those many variations, i.e., whether to specify
  14. a matroid by the "independent subsets", by "circuits" etc. </li>
  15. <li> Let "mtr" be the abbreviation for "matroid"; then perhaps we
  16. have "mtr_x" for the variations:
  17. <ol>
  18. <li> "is" for independent subsets (a hypergraph [V,M] such that M is
  19. non-empty, hereditary (stable under subset-formation), and fulfils
  20. the augmentation property, i.e., for A, B in M with |A| < |B| there exists
  21. x in B - A with A + {x} in M; for implicitly given matroids, which
  22. could be infinite, we need further distinctions); </li>
  23. <li> "ds" for dependent subsets; </li>
  24. <li> "cr" for circuits; </li>
  25. <li> "bs" for bases; </li>
  26. <li> "rk" for a rank-function; here we don't have a hypergraph but
  27. a pair [V,f], where V is a set and f yields for every subset of V
  28. a natural number (with zero). </li>
  29. <li> "clos" for closure; perhaps we have a module in
  30. ComputerAlgebra/Sets, where we handle closure systems, i.e.,
  31. pairs [X,f], X a set and f a map, which transforms subsets into subsets,
  32. in general. </li>
  33. </ol>
  34. </li>
  35. <li> The hypergraph-based notions should be given more "notational
  36. prominence" (than the others), perhaps always using 2-letters ? </li>
  37. <li> Important to be complete and precise. </li>
  38. <li> Important that all dual notions are easily at hand, perhaps the letter
  39. "d" is reserved to indicate "dual notions". </li>
  40. <li> We also need to be compatible with oriented matroids; see
  41. ComputerAlgebra/Matroids/Lisp/OrientedMatroids/plans/general.hpp. </li>
  42. <li> The direct definition is inefficient:
  43. <ol>
  44. <li> The possibility of implicit representations of the base set is of
  45. importance especially for infinite matroids. </li>
  46. <li> And perhaps the existential quantifiers in the axioms can
  47. additionally be realised, e.g. for "_is" a function f(A,B) which
  48. yields x in B - A. </li>
  49. <li> In this way, through the different axiomatisations, many different
  50. functions arise, given directly or derived. One needs a system for that.
  51. </li>
  52. <li> Perhaps we use for example "isr", that is, "independent set
  53. realiser". One could also use "issf" ("sf" for "Skolem function"). </li>
  54. <li> Perhaps important also the variation where e.g. f(A,B) is the set
  55. of *all* x in B - A s.t. A + x is independent. </li>
  56. <li> Importantly, also for the various set systems (independent sets,
  57. circuits, etc.) we can have explicit and implicit representations. One
  58. could use "imp" for "implicit", and "exp" for "explicit". </li>
  59. <li> Perhaps we make implicit representation of the set of
  60. independent subsets the default, while for the bases the explicit
  61. representation is the default. </li>
  62. </ol>
  63. </li>
  64. </ul>
  65. \todo Examples
  66. <ul>
  67. <li> Vector matroid M[A]:
  68. <ol>
  69. <li> Given a combinatorial matrix A over a skew field, subsets of the
  70. column-set, or, alternatively, of the row-set, are independent iff they
  71. are linearly independent. </li>
  72. <li> With the Maxima function "rank" one can handle the field of reals or
  73. the field of rationals, while for other fields apparently no functions are
  74. provided, and so we need to provide generic functions ourselves. </li>
  75. <li> See "Missing functionality" in
  76. ComputerAlgebra/Algebra/Lisp/plans/FiniteFields.hpp. </li>
  77. </ol>
  78. </li>
  79. <li> Cycle matroid M(G):
  80. <ol>
  81. <li> Given a general graph G, sets of edges of cyles yield the set of
  82. circuits of a matroid on E(G). </li>
  83. <li> Here the check is easy: Compute the induced subgraph and check
  84. whether it is a cycle graph; this is done by cycle_gg_p and
  85. edge_induced_subgraph_gg. </li>
  86. </ol>
  87. </li>
  88. </ul>
  89. \todo Greedy algorithm
  90. <ul>
  91. <li> Given a hereditary hypergraph [V,E] with non-empty E, and a weight
  92. function w: V -> RR, the greedy algorithm determines a maximal element B
  93. of E as follows:
  94. <ol>
  95. <li> B := {}; </li>
  96. <li> if there is no x in V - B with B + {x} in E, return B; </li>
  97. <li> otherwise choose such x with w(x) maximal, set B := B + {x},
  98. and repeat from the previous step. </li>
  99. </ol>
  100. </li>
  101. <li> The hereditarity condition exactly ensures that every B could be
  102. chosen. </li>
  103. <li> [V,E] is a matroid if and only if the greedy algorithm yields for
  104. every w a maximal element of E which is also of maximal weight (amongst
  105. all maximal elements of E). </li>
  106. <li> The two main variation seem to dependent on how to find x:
  107. <ol>
  108. <li> Either one has to run through all of V - B, </li>
  109. <li> or a special function computes them. </li>
  110. </ol>
  111. </li>
  112. <li> So here for more efficient implementation a function f(I) would be
  113. needed, which for a given independent set I computes the set of all
  114. x in V - I s.t. I + {x} is still independent.
  115. <ol>
  116. <li> For example for Kruskal's algorithm, f needed internal state,
  117. and would start with all edges possible, and with every edge added
  118. to B would remove all edges which now lead to cycles. </li>
  119. <li> How is Kruskal's algorithm doing that? </li>
  120. </ol>
  121. </li>
  122. <li> The greedy algorithm can find all bases of maximal weight; if x
  123. is always chosen randomly, do we then sample all bases fairly? </li>
  124. </ul>
  125. */