摘 要: 针对结构复杂、联通算法难以实现的层级结构联通性问题,提出了利用树结构的最长路径算法解决层级结构型数据的方法。本研究以传统城堡防护问题为例,找出中间相隔的城墙数量最多的两个点,即层级结构的联通厚度。通过数据结构分析,将城堡各区域转化为树结构,验证了树结构的最长路径即为层级结构的联通厚度,最终巧妙实现将层级结构转换为树结构,并利用树结构的遍历分析寻找到树的最长路径递归算法,解决了树节点到节点的最长路径,最终实现层级结构各层的联通路径建设规划,为层级结构问题的解决找到突破口与参考性。 |
关键词: 层级结构;生成树结构;联通算法;最长路径 |
中图分类号: TP399
文献标识码: A
|
基金项目: 2021年陇南市科技计划项目《乡村振兴视角下农村青年电商创业研究——以陇南地区为例》阶段性研究成果;2019校级教改项目《“1+X 证书制度”背景下网店运营推广人才培养模式研究与实践》阶段性研究成果(JXGG2019006). |
|
Research on the Connectivity of Hierarchical Structured Data |
HE Junzhong
|
(Longnan Teachers College, Chengxian 742500, China)
lnszhjztg@163.com
|
Abstract: Aiming at the problem of hierarchical structure connectivity that is difficult to achieve with the complex structure, this paper, proposes a method of using the longest path algorithm of the tree structure to solve the problem of hierarchical structure data. This research takes traditional castle protection problem as an example. It is necessary to find the two points, between which there is the largest number of walls, namely the connectivity thickness of the hierarchical structure. Through data structure analysis, each area of the castle is transformed into a tree structure to verify that the longest path of the tree structure is the connectivity thickness of the hierarchical structure. Finally, hierarchical structure is ingeniously transformed into tree structure, and the traversal of the tree structure is used to analyze and find the longest path recursive algorithm of the tree. It solves the longest path from the tree node to the node. Finally, the proposed method realizes the connection path construction planning of each layer in the hierarchical structure, and makes breakthroughs and provides references for solving hierarchical structure problems. |
Keywords: hierarchical structure; spanning tree structure; connectivity algorithm; longest path |