surda var. https://stackoverflow.com/questions/8814059/generating-topological-space-diagram-in-mathematica/8815337#8815337
suraya da bakilabilir. https://mathematica.stackexchange.com/questions/5/generating-a-topological-space-diagram-for-an-n-element-set/165#165
Ben test ettim 22 eleman icin 29 saniye, 24 eleman icin 95 saniye aliyor. 27 eleman icin denedim yaklasik 5 dakika sonra sonlandirdim programi.
In[1]:= set = Subsets[Range@6]
Out[1]= {{}, {1}, {2}, {3}, {4}, {5}, {6}, {1, 2}, {1, 3}, {1, 4}, {1,
5}, {1, 6}, {2, 3}, {2, 4}, {2, 5}, {2, 6}, {3, 4}, {3, 5}, {3,
6}, {4, 5}, {4, 6}, {5, 6}, {1, 2, 3}, {1, 2, 4}, {1, 2, 5}, {1, 2,
6}, {1, 3, 4}, {1, 3, 5}, {1, 3, 6}, {1, 4, 5}, {1, 4, 6}, {1, 5,
6}, {2, 3, 4}, {2, 3, 5}, {2, 3, 6}, {2, 4, 5}, {2, 4, 6}, {2, 5,
6}, {3, 4, 5}, {3, 4, 6}, {3, 5, 6}, {4, 5, 6}, {1, 2, 3, 4}, {1, 2,
3, 5}, {1, 2, 3, 6}, {1, 2, 4, 5}, {1, 2, 4, 6}, {1, 2, 5, 6}, {1,
3, 4, 5}, {1, 3, 4, 6}, {1, 3, 5, 6}, {1, 4, 5, 6}, {2, 3, 4,
5}, {2, 3, 4, 6}, {2, 3, 5, 6}, {2, 4, 5, 6}, {3, 4, 5, 6}, {1, 2,
3, 4, 5}, {1, 2, 3, 4, 6}, {1, 2, 3, 5, 6}, {1, 2, 4, 5, 6}, {1, 3,
4, 5, 6}, {2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}}
In[2]:= set2 =Sort@Join[{First@set, Last@set}, RandomSample[Most@Rest@set, 22]]
Out[2]= {{}, {1}, {2}, {3}, {4}, {5}, {6}, {1, 2}, {1, 3}, {2, 3}, {5,
6}, {1, 2, 3}, {1, 3, 4}, {1, 3, 6}, {1, 4, 5}, {1, 5, 6}, {2, 3,
4}, {2, 3, 6}, {2, 4, 5}, {4, 5, 6}, {1, 2, 3, 5}, {2, 3, 4, 5}, {1,
2, 3, 5, 6}, {1, 2, 3, 4, 5, 6}}
In[3]:= topologyQ[x_List] :=Intersection[x, #] === # &[
Union[{Union @@ x}, Intersection @@@ Rest@#, Union @@@ #] &@Subsets@x]
In[4]:= topologyQ@set2 // AbsoluteTiming
Out[4]= {95.7043, False}