检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:谢光艺 XIE Guangyi(Intelligent Science and Information Engineering College,Xi'an Peihua University,Xi'an 710125,China)
机构地区:[1]西安培华学院智能科学与信息工程学院,陕西西安710125
出 处:《现代信息科技》2023年第20期96-99,共4页Modern Information Technology
基 金:西安培华学院校改课题重点项目(PHKCSZ202102)。
摘 要:OSPF协议是计算机网络常用的路由协议,它采用了Dijkstra算法。Dijkstra算法在各领域都有广泛的应用,掌握其原理很有必要,因此提出在MATLAB中利用三重循环实现算法的仿真。首先确定代价矩阵,明确起始路由器,并把该路由器放入到S集中。其次采用最外层循环判断是否遍历全部路由器,中间循环遍历S集中的路由器,里层循环遍历U集中的路由器,寻找到每一次外层循环时距起始路由器的代价最小的路由器,并把这个路由器移出U集,并放入到S集中。最后通过回溯方法得到最短路径树。通过仿真实验,不仅能帮助掌握OSPF协议中路由的选择方法,更能加深对Dijkstra算法的理解。OSPF protocol is a commonly used routing protocol in computer network,and it adopts Dijkstra's Algorithm.The Dijkstra's Algorithm has a wide range of applications in variousfields,and it is necessary to master its principle.Therefore,using the triple-loop to realize algorithm simulation is proposed in MATLAB.Firstly,this paper determines the cost matrix,identifies the starting router,and puts the router into the S set.Secondly,the outermost loop is used to determine whether to traverse all the routers,the middle loop traverses the routers in the S set,and the inner loop traverses the routers in the U set tofind the router with the smallest cost from the starting router in each outer loop.It moves this router out of the U set and puts it into the S set.Finally,the shortest path tree can be obtained by the backtracking method.The simulation experiments can not only help master the route selection method in OSPF protocol,but also deepen the understanding of Dijkstra's Algorithm.
关 键 词:OSPF协议 DIJKSTRA算法 三重循环仿真
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:18.119.126.21