  We explore the special structure of the top-dimensional homology of any
compact triangulable space $X$ of dimension $d$. Since there are no
$(d+1)$-dimensional cells, the top homology equals the top cycles and is thus a
free abelian group. There is no obvious basis, but we show that there is a
canonical embedding of the top homology into a canonical free abelian group
which has a natural basis up to signs. This embedding structure is an invariant
of $X$ up to homeomorphism. This circumstance gives the top homology the
structure of an (orientable) matroid, where cycles in the sense of matroids
correspond to the cycles in the sense of homology. This adds a novel
topological invariant to the topological literature.
  We apply this matroid structure on the top homology to give a polynomial-time
algorithm for the construction of a basis of the top homology (over
$\mathbb{Z}$ coefficients).
