
COMMENTS

Two edges {a,b}, {c,d} are crossing if a < c < b < d or c < a < d < b, and nesting if a < c < d < b or c < a < b < d. A graph with positive integer vertices is topologically connected if the graph whose vertices are the edges and whose edges are crossing pairs of edges is connected.


MATHEMATICA

croXQ[eds_]:=MatchQ[eds, {___, {x_, y_}, ___, {z_, t_}, ___}/; x<z<y<tz<x<t<y];
nesXQ[eds_]:=MatchQ[eds, {___, {x_, y_}, ___, {z_, t_}, ___}/; x<z<t<yz<x<y<t];
csm[s_]:=With[{c=Select[Tuples[Range[Length[s]], 2], And[OrderedQ[#], UnsameQ@@#, Length[Intersection@@s[[#]]]>0]&]}, If[c=={}, s, csm[Sort[Append[Delete[s, List/@c[[1]]], Union@@s[[c[[1]]]]]]]]];
Table[Length[Select[Subsets[Subsets[Range[n], {2}]], !nesXQ[#]&&Length[csm[Union[Subsets[#, {1}], Select[Subsets[#, {2}], croXQ]]]]<=1&]], {n, 0, 5}]
