グラフ理論と動的計画法

最近トップコーダーの問題で苦しんでいます。The problem combines combinatorics, graph theory, and dynamic programming with a nonstandard bitmap usage. グラフの数が2^((n)(n-1)/2)でブログラムで述べるのが不可能です。While it is possible to enumerate the number of distinct lines (trees where each vertex has at most degree two), it is not straightforward to count the number of graphs or the number of lines per graphs (different graphs may generate the same line, so the line could be counted multiple times in the output).
ネット上で発表された他人の正解はN!/2対称性を除く順列をさいごの因数として使う。