Algorithm for finding a subbasis of a topological space Let $X$ be a finite topological space. Is there any algorithm for finding a subbasis of $X$ with the smallest possible cardinality? What we can say about the cardinality of this subbasis (I mean what we can say about $w(X)$ the weight of $X$)?
I think that if $X$ is compact and Hausdorff, then $w(X)\leq |X|$. But I want to know about non-Hausdorff case and I want to know that is there any formula for $w(X)$
https://www.encyclopediaofmath.org/index.php/Weight_of_a_topological_space
Thanks for your helps in advance
 A: Each finite topological space $X$ has the smallest basis $\mathcal B(X)=\{B_x:x\in X\}$, where $B_x=X\setminus \{y\in X:\overline{\{y\}}\not\ni x\}$ is the intersection of all open set containing a point $x$.  Indeed, if $\mathcal B$ be any basis of the spaces $X$ then for each point $x\in X$ there exists a set $U\in\mathcal B$ such that $x\in U\in B_x$. Since $B_x$ is the smallest open set containing the point $x$, $U=B_x$. Thus $\mathcal B=\mathcal B(X)$. 
In particular, $w(X)=|\mathcal B(X)|\le X$. If $X$ is a $T_1$-space then $B_x=\{x\}$ for each $x\in X$, so the space $X$ is discrete and $w(X)=|X|$. 
The question about a minimum size $sw(X)$ of a subbase of the space $X$ is more interesting. Clearly, that $sw(X)\le X$. On the other hand, if  $\mathcal S$ is a subbase of a space $X$ then the family $\mathcal S$ can create and most $2^{|\mathcal S|}-1$ distinct non-empty intersections, so $2^{sw(X)}-1\ge w(X)$ for each $X$. The following examples show that these bounds are rather tight.
Let $X=\{1,\dots,n\}$ and $B_x=\{y\in X:y\le x\}$ for each $x\in X$. Then $\tau=\mathcal B(X)\cup\varnothing$. So for each family $\mathcal F\subset\tau$ an intersection $\bigcap\mathcal F$ equals the smallest member of the family $\mathcal F$. In particular, every subbase $\mathcal S$ of the space $X$ is closed with respect to intersection of its members. This follows that $S\supset \mathcal B(X)$, so in this case $sw(X)=w(X)=|X|$.
Let now $X=\{1,\dots,n\}$ endowed with the discrete topology. Put $k=\lceil\log_2 n\rceil$ and for each $1\le i\le k$ let $S^0_i$ consists of all $n\in X$ such that $i$-th binary digit of $n$ equals $i$, and $S^1_i=X\setminus S^0_i$. Then the family $\mathcal S=\{S^0_k, S^1_k:1\le i\le k\}$ is a subbase of the space $X$ and $|\mathcal S|\le 2\lceil\log_2 n\rceil$. 
For the discrete $X$ we can obtain a better upper bound than $2^{sw(X)}-1\ge w(X)$ as follows. Let $\mathcal S=\{S_1,\dots, S_k\}$ be a subbase of the space $X$. For each $x\in X$ put $S(x)=\{1\le i\le k: S_i\ni x\}$. Then a family $\{S(x):x\in X\}$ contains no distict sets $S(x)\subset S(y)$. Then by Sperner’s Theorem, $|X|\le {|\mathcal S| \choose \lfloor |\mathcal S|/2\rfloor}$. Thus ${sw(X)\choose \lfloor sw(X)/2\rfloor}\ge w(X)$. 
The above bound is tight. Indeed, given a natural number $k\ge 2$ let $X$ be a family of all subsets of $\{1,\dots,k\}$ of size $\lfloor k/2\rfloor$. For each $1\le i\le k$ put $S_i=\{S\in X: S\ni i\}$. Then the family $\{S_i\}$ is a subbase of the discrete topology on the space $X$. Namely, for each $S\in X$ we have $S=\bigcap\{S_i: S\ni i\}$.
That is, for a discrete space $X$ $sw(X)$ is the smallest $k$ such that ${k\choose \lfloor k/2\rfloor}\ge |X|$.
