路由模拟——论文算法设计部分(4)

类别:软件工程 点击:0 评论:0 推荐:

 

                    §3.3 Floyed路由算法与演化路由算法实验数据分析
    算法的测试数据,使用图7中的网络结构。则网络的拓扑信息与耗散信息分别为:

拓扑信息矩阵 耗散信息矩阵

1 1 1 0 0

1 1 0 1 0

1 0 1 1 0

0 1 1 1 1

0 0 0 1 1

0 2 3 1000000 1000000

2 0 1000000 6 1000000

3 1000000 0 4 1000000

1000000 6 4 0 5

1000000 1000000 1000000 5 0

                                                         表8  算法测试数据网络信息表
       注释:耗散信息中,1000000表示无穷大。
       3.3.1 Floyed路由算法分析
       我们知道Floyed算法的复杂度是O(n3)的,但改造的Floyed路由算法的复杂度略微大于这个。因为算法的停机条件是路由表的完成。可以证明,Floyed路由算法对于连通图计算所得的路由表是全局最优的。证明本文从略,详见于参考资料[2]。
       下面是五次实验算法的测试结果:


实验标号 源路由器标号 计算路由表所耗时间(ms) 平均时间(ms) 
1                  0                         109                                           - 
2                  0                         109                                           - 
3                  0                         110                                           - 
4                  0                         110                                           - 
5                  0                         109                                           - 


                                             表9  Floyed算法测试结果表
      该表格的数据将作为一种对比标准,与后面的演化路由算法的测试数据进行对比分析。
      3.3.2 演化路由算法分析
      1,演化路由算法的参数设置
      演化路由算法的参数设置如下:

名称 说明 算法设定值 MAX_GENE_NUMBER 种群大小 20 GENE_LENGTH 基因最大长度 100 PBUILDER 保守成长与开明成长的分界概率 0.08 MAX_T 演化代数 10

                          表10  演化路由算法参数设置说明表
       这些参数的设置,都是根据个人经验。但并不一定是最优的。我们下面竟通过实验数据来分析算法的性能。
       2,演化路由算法收敛性的说明
       但首先要说明的是,演化路由算法是收敛的。
       研究演化路由算法Algorithm EvoRoutCompute,可知算法的收敛性关键在于下面的过程收敛:
                     While ( gene IS NOT COMPLETE )
                     { // gene成长至成熟
                            Gene-Builder;
                            If ( Gene-DECOMPLETE )
                                  Gene-RANDOMDELETE;
                     };
       此过程用于gene初始化后,或gene成熟后的进一步演化中。
       如定义,非空gene中的元素始终包含from与to。且由算法Algorithm 5. Gene-Builder可知,gene新增的片段都是gene的对立基因_gene中的元素,由对立基因的定义可知:
       gene中元素的序列是NodeSet集合或其子集的元素的排列,记为from p1…pm to。其中p1,…,pm都是NodeSet集合的元素即 图中的结点。(1)
       如果(1)中排列所形成的“路径”在图中是合法的,即gene处于成熟态(COMPLETE),该过程结束,演化路由算法收敛。
       如果(1)中排列所形成的“路径”在图中不合法,则gene继续成长;若对立基因_gene已为空,由算法Algorithm 6. Gene-DECOMPLETE可以判断这种情况,则由算法Algorithm 7. Gene-RANDOMDELETE对gene随机删除一段(gene可能再次成为初始态)而重新成长。
       换言之,该过程是按照随机策略搜索NodeSet集合中元素排列空间的序列点,如果该序列是图中合法的路径则搜索过程结束。由于图的连通性,合法路径在这个空间中是必然存在的,这个过程也将收敛,则演化路由算法是收敛的。
       3,演化路由算法分析
       下面是演化路由算法的测试结果:


目标路由器标号 演化代数(第?代) 路由计算所耗时间(ms) 平均时间(ms) 
0                                 0                             47                                           - 
0                                 1                             16                                           - 
0                                 2                              0                                            - 
0                                 3                             18                                           - 
0                                 4                              0                                            - 
0                                 5                             26                                           - 
0                                 6                              0                                            - 
0                                 7                             16                                           - 
0                                 8                              15                                          - 
0                                 9                              16                                         15.4 
1                                 0                              15                                           - 
1                                 1                               0                                            - 
1                                 2                              16                                           - 
1                                 3                              16                                           - 
1                                 4                               0                                            - 
1                                 5                               15                                          - 
1                                 6                               16                                          - 
1                                 7                               16                                          - 
1                                 8                               15                                          - 
1                                 9                               16                                        12.5 
2                                 0                               16                                          - 
2                                 1                               16                                          - 
2                                 2                               15                                          - 
2                                 3                               16                                          - 
2                                 4                               16                                          - 
2                                 5                               31                                          - 
2                                 6                               15                                          - 
2                                 7                               16                                          - 
2                                 8                               16                                          - 
2                                 9                               15                                        17.2 
3                                 0                                0                                           - 
3                                 1                               31                                          - 
3                                 2                               16                                          - 
3                                 3                               15                                          - 
3                                 4                               16                                          - 
3                                 5                               16                                          - 
3                                 6                                15                                         - 
3                                 7                               32                                          - 
3                                 8                               15                                          - 
3                                 9                               16                                        17.2 
4                                 0                               62                                          - 
4                                 1                               47                                          - 
4                                 2                               31                                          - 
4                                 3                               32                                          - 
4                                 4                                31                                         - 
4                                 5                                31                                         - 
4                                 6                                31                                         - 
4                                 7                                32                                         - 
4                                 8                                62                                         - 
4                                 9                                31                                        39.0 
-                                  -                                 -                                  总时间:101.3 


                                                   表11  演化路由算法测试结果表
         对于图7的测试数据,实验结果表明,演化路由算法在执行过程中,每一代的演化获得的路由路径均是全局最优的(当然,原因之一是网络结构的测试数据量太小)。测试结果表中的总时间,就是通过一代演化获得路由表的平均总时间。
        与Floyed路由算法实验数据对比,演化路由算法在图7网络中的测试数据上并没有很大的优势:        Floyed路由算法完成0号路由器的路由表计算,平均总时间是在109-110ms; 演化路由算法完成0号路由器的路由表计算(按演化一代计算),平均总时间为101.3ms。         但演化算法的优势在于对于大规模增长速度的问题有很好的处理能力,所以对于图7中的网络该优势并不能完全展现。
         另外,保守成长与开明成长的分界概率PBUILDER是个关键的参数,开明成长促使搜索空间的增大,而保守成长促使算法搜索过程更快的收敛,所以PBUILDER调整的是两个相反相成的因素,在图7的测试数据中,该值是针对问题的规模设定的。有理由相信,这个参数需要针对问题的规模变化进行调整,以获得更好的性能。还有就是,种群的大小和演化代数的设置,都影响算法的效率,也需要考虑问题的规模进行调整。
         3.3.3 对演化路由算法改进的建议
         演化路由算法中也已经说明,算法实现的是第二草稿,成熟态gene集合geneSet中的一半基因没有进一步演化而直接进入下一代的竞争,而成熟态gene的进一步演化(Algorithm 9. Gene-Evolution.)仍只是个框架,且没有考虑杂交的因素;在演化路由算法的改进过程中,这些将是首先考虑的因素。
         由实验数据的对比分析中,也可以看出演化路由算法的演化参数也是至关重要的。一个好的建议是,保守成长与开明成长的分界概率PBUILDER和演化代数MAX_T都设置为问题规模的函数。探索这些函数是有意义的事情。
         另外,程序的实现可以采用高效的方式。如演化路由算法中有排序算法的应用,本文采取的是插值排序算法,但问题规模增大后可采取更有效率的排序算法如快速排序。
演化路由算法的整体框架也可以进一步探索而进行改进。本文不再详述。

 

本文地址:http://com.8s8s.com/it/it36730.htm