摘要: 此定理说明用n-1条边将n个一致的顶点连接起来的连通图的个数为n^(n-2),也可以这样理解,将n个城市连接起来的树状公路网络有n^(n-2)种方案。所谓树状,指的是用n-1条边将n个顶点构成一个连通图。当然,建造一个树状的公路网络将n个城市连接起来,应求其中长度最短、造价最省的一种,或效益最大的一种。Cayley定理只是说明可能方案的数目. 1 #include 2 using namespace std; 3 #define N 10003 4 int main() 5 { 6 int t,i,n; 7 for(cin>>t;t--;) 8 { 9 cin>>n;1 阅读全文
posted @ 2013-05-16 20:38 SStep 阅读(306) 评论(0) 推荐(0) 编辑