Given a set $X$ and a topology $\mathcal{T}$ over $X$, is there a general way to determine a (non-trivial) basis for the topology $\mathcal{T}$?
I understand that a family $\mathcal{B}$ of open subsets of $X$ is a basis for $\mathcal{T}$ if and only if for any point $x$ belonging to any open set $U$, there is a $B \in \mathcal{B}$ such that $x ∈ B ⊆ U$, but is there a general procedure (or algorithm) to go about to determine a basis than just test each $x$ for each open set $U$?
I may just be overcomplicating the above, but any help would be greatly appreciated.
There is really only an algorithm in simple cases, like when $X$, or more generally $\mathcal{T}$, is finite: in that case, any base for $X$ must contain all $U_x := \bigcap \{O \in \mathcal{T}: x \in O\}$ (which is a finite intersection, so open) for all $x \in X$ and in fact $\{U_x: x \in X\}$ is a base for $(X,\mathcal{T})$.
For other spaces: most spaces in practice come with a given base from the definition of that space: metric spaces and ordered spaces and product spaces all come with a natural base (sometimes subbase) for their topology: open balls, open intervals and segments, or (sub)basic product sets etc. So the reverse problem, of finding a base from a topology is not at all common; most spaces come with "natural" bases.
Of course $\mathcal{T}$ or $\mathcal{T}\setminus \{\emptyset\}$ are both trivially bases for $\mathcal{T}$, as well.