CN102880739A - Network minimum path set determination method based on adjacency list - Google Patents

Network minimum path set determination method based on adjacency list Download PDF

Info

Publication number
CN102880739A
CN102880739A CN 201210279183 CN201210279183A CN102880739A CN 102880739 A CN102880739 A CN 102880739A CN 201210279183 CN201210279183 CN 201210279183 CN 201210279183 A CN201210279183 A CN 201210279183A CN 102880739 A CN102880739 A CN 102880739A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
network
node
path
minimum
adjacency list
Prior art date
Application number
CN 201210279183
Other languages
Chinese (zh)
Inventor
钱云鹏
姬广振
涂宏茂
刘勤
朱正福
Original Assignee
中国兵器科学研究院
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date

Links

Abstract

The invention provides a network minimum path set determination method based on an adjacency list and aims to solve the problems about design simulation and performance evaluation of a large complex network system. The method mainly comprises the following two steps of: establishing a novel adjacency list according to a topological structure of a network; and traversing the adjacency list by using a depth-first search and backtracking combination method to determine all minimum paths. Nodes and links are not quantitatively restricted. The network minimum path set determination method based on the adjacency list is applicable to a directed network, an undirected network and a mixed network and has a wide application prospect in the large complex network systems such as power, communication, traffic, computers and municipal pipe networks.

Description

一种基于邻接表的网络最小路集确定方法 A method of determining the adjacency list based network minimal path sets

技术领域 FIELD

[0001] 本发明涉及一种网络系统的最小路集确定方法,属于网络系统设计仿真领域。 The invention relates to a network system minimal path set [0001] This determination method, belonging to the field of network system design and simulation.

背景技术 Background technique

[0002] 网络系统可用一个图G表示,图I即为一个表示网络的图,图中顶点表示网络中的节点,边表示网络中连接节点的链路,节点之间无并联链路。 [0002] The network system is available showing a graph G, Figure I shows a diagram of a network that is, vertices in the graph represents the nodes in the network, no parallel edges represent links between a link connecting nodes in the network, node. 如果G中所有的边都是有向的,称为有向网络;如果G中所有的边都是无向的,称为无向网络;如果G中既存在有向边,也存在无向边,称为混合网络。 If G is in all edges are directed and have referred to the network; G if all the edges are undirected, undirected network is called; if G in the presence of both sides, there is no edge to called hybrid network. 图I即为混合网络。 Figure I is the hybrid network. 设起点为I,终点为L,最小路径是指从起点I到终点L所含链路数目最少的路径,最小路径中没有重复节点和链路。 I set the starting point is, end point L, the minimum path from the start point I refers to the minimum number of links included in the end of the path L, a minimum path no duplicate nodes and links. 所有最小路径组成的集合称为最小路集。 The set of all minimum path consisting referred minimal path set.

[0003] 电力网络、交通网络、通信网络、计算机网络等复杂网络系统进行设计仿真和性能评估,往往需要确定最小路集。 [0003] electricity network, network traffic, communication networks, computer networks and other systems complex network design simulation and performance evaluation, often need to determine the minimal path set. 该问题是典型的NP-困难问题,主要体现在当节点和链路的数量增加时最小路径的数量出现组合爆炸式增长。 The problem is a typical NP- difficult problem, mainly in when the number of nodes and links appear minimum number of paths of a combination of explosive growth. 现有的最小路集确定方法,如基于邻接矩阵或联络矩阵的确定方法存在需要大容量存储的缺陷,因为矩阵规模往往很大且是稀疏矩阵,不适用于大型复杂网络系统。 Determining a minimal path set conventional method, such as a large-capacity storage defect determination method adjacency matrix or connection matrix-based, and tend to be large because the size of the matrix is ​​sparse, not applicable to large, complex networks.

发明内容 SUMMARY

[0004] 本发明的目的是提供一种适用于大型复杂网络系统的最小路集确定方法,解决大型复杂网络系统的设计仿真和性能评估问题,主要包括2个步骤: [0004] The object of the present invention is to provide a network system suitable for large complex set of minimal path determination method, design and performance evaluation simulation problem solving large complex network system, comprising two main steps:

[0005] I根据网络的拓扑结构,构造一种新型的邻接表; [0005] I according to the network topology, configuration of a new adjacency table;

[0006] 2采用深度优先搜索和回溯相结合的方法遍历邻接表确定所有最小路径。 [0006] 2 and a method using depth-first search traversal back combining all table to determine the minimum contiguous paths.

[0007] 本发明的优点是:方法简单易行,效率高,对节点和链路无数量限制,且能同时处理有向网络、无向网络和混合网络。 Advantages [0007] of the present invention are: the method is simple, high efficiency, no restrictions on the number of nodes and links, and can simultaneously process the network has no network and to the hybrid network. 在电力网络、通信网络、交通网络、计算机网络以及市政管网等大型复杂网络系统具有广泛的应用前景。 It has a wide range of applications in large, complex networks of power networks, communication networks, transportation networks, computer networks as well as municipal pipe network.

附图说明 BRIEF DESCRIPTION

[0008] 图I :混合网络。 [0008] FIG. I: hybrid network.

[0009] 图2 :169个节点、312条链路的大型有向网络。 [0009] FIG. 2: 169 nodes, with a large link to the network 312.

[0010] 图3:本发明的流程。 [0010] Figure 3: Process of the present invention.

具体实施方式 Detailed ways

[0011] 本发明的流程图如图3所示,包括以下步骤: [0011] The flowchart shown in Figure 3 of the present invention, comprising the steps of:

[0012] I根据网络的拓扑结构,构造一种新型的邻接表。 [0012] I a new adjacency list according to network topology, configuration.

[0013] 该邻接表是一种链式存储结构,每行由节点和邻接项组成,邻接项由节点可以到达的节点和是否访问过该节点两个数据项组成。 [0013] The adjacency list is a chain storage structure, each row consisting of nodes and neighboring entries adjacent entry node and a node that can be reached through the access node whether two data items. 以图I所示的网络为例,其邻接表如表I所示。 In the network shown in Figure I as an example, which abuts As shown in Table I. 表中第i行代表第i个节点可以达到的节点。 I-th row in the table represents the node i can reach node. 例如第5行代表节点5可达节点4和7,由于节点6到节点5为有向链路,故节点6不在节点5的邻接项中。 For example, line 5 represents a node 7 and node 4 up to 5, since the node 6 to node 5 a directed link, so that the node is not the node 6 adjacent to the 5 items.

[0014] 邻接项中的另一数据项用于记录是否访问过该节点,用visited表示,visited =O代表未访问过,visited = I代表访问过。 [0014] Another items adjacent items for recording whether the node is visited, represented by visited, visited = O represents an visited, visited = I representatives visited. 默认情况下所有邻接项的visited属性为O。 By default, all items in the case of the adjacent property is visited O.

[0015]表I: [0015] Table I:

Figure CN102880739AD00041

[0017] 2采用深度优先搜索和回溯相结合的方法遍历邻接表确定所有最小路径。 [0017] 2 and a method using depth-first search traversal back combining all table to determine the minimum contiguous paths.

[0018] 设起点为I,终点为L,并定义堆栈Path记录遍历过程已走过的节点,则遍历邻接表确定所有最小路径的步骤如下: [0018] The starting point for the set I, end point L, and define the node stack recording Path already traveled traversal, the traversal adjacency list all the steps of determining the minimum path is as follows:

[0019] I)将起点I压入堆栈Path ; [0019] I) The starting point for the Path I onto the stack;

[0020] 2)如果Path为空,说明找到了所有的最小路径,停止; [0020] 2) If the Path is empty, all the instructions to locate the minimum path is stopped;

[0021] 3)获得Path的顶点K,检查节点K的邻接项是否包含未访问过的节点; Vertex [0021] 3) The Path obtained K, K check nodes adjacent to the node key contains unvisited;

[0022] 4)如果未找到节点K未访问过的节点,则节点K出栈,并置节点K的所有邻接项为未访问过,然后转步骤2); [0022] 4) If node K unvisited not found, then the stack node K, node K all juxtaposed as unvisited neighboring entries, then go to step 2);

[0023] 5)如果找到了节点K未访问过的节点J,则检查Path中是否包含节点J ; [0023] 5) If the node K through node J unvisited found, it is checked whether to include the node J Path;

[0024] 6)如果Path包含节点J,则转步骤2); [0024] 6) If the Path contains the node J, then go to step 2);

[0025] 7)如果Path不包含节点J,则将节点K的邻接项中节点J的visited属性置为1,节点J入栈,并检查节点J是否终点L : [0025] 7) If the node does not contain J Path, then the node K neighboring entries in node J visited attribute is set to 1, the node J stack, and checks whether the end node J L:

[0026] a、如果节点J是终点L,则找到一条最小路径,从Path输出最小路径,节点J出栈,并置节点J的所有邻接项为未访问过,然后转步骤2); [0026] a, if the end node J is L, then find a shortest path, minimum path outputted from the Path, the stack node J, node J and opposed to all unvisited neighboring entries, then go to step 2);

[0027] b、如果节点J不是终点L,转步骤2)。 [0027] b, if not the end node J L, go to step 2).

[0028] 下面举2个本发明的应用实例。 [0028] For the following two application examples of the present invention. [0029] 表I列出了图I的邻接表。 [0029] Table I lists the adjacent table I in FIG. 设起点为节点1,终点为节点7,利用本方法的主要步骤如下: Node 1 is set the start point, end point node 7, the method using the following main steps:

[0030] I)节点I入栈; [0030] I) I stack node;

[0031] 2)堆栈不为空,堆栈顶部节点为节点1,从节点I的邻接项中找到未访问过的节点2,节点2入栈,节点I的邻接项中节点2标记为访问过; [0031] 2) the stack is not empty, stack top node is node 1, node found unvisited neighboring entries from node I 2, the stack node 2, node I in neighboring entries marked as visited node 2;

[0032] 3)堆栈不为空,堆栈顶部节点为节点2,从节点2的邻接项中找到未访问过的节点6,节点6入栈,节点2的邻接项中节点6标记为访问过; [0032] 3) the stack is not empty, stack top node of the node 2, node found unvisited neighboring entries from node 6 2, 6 stack node, node 2 neighboring entries marked as visited node 6;

[0033] 4)堆栈不为空,堆栈顶部节点为节点6,从节点6的邻接项中找到未访问过的节点 [0033] 4) the stack is not empty, stack top node of node 6, node is found unvisited neighboring entries from node 6

7,节点7入栈,节点6的邻接项中节点7标记为访问过; 7, the stack node 7, node 6 adjacent items marked as visited node 7;

[0034] 5)节点7为终点,找到一条最小路径,输出最小路径为1-2-6-7,节点7出栈,并置节点7的所有邻接项为未访问过; [0034] 5) as the end point node 7, to find a shortest path, minimum output path 1-2-6-7, the stack node 7, and node 7 is set to all unvisited neighboring entries;

[0035] 6)堆栈不为空,堆栈顶部节点为节点6,从节点6的邻接项中找到未访问过的节点5,节点5入栈,节点6的邻接项中节点5标记为访问过; [0035] 6) the stack is not empty, stack top node of node 6, to find unvisited neighboring entries node 5 from the node 6, the node stack 5, 6 in the node adjacent to the node 5 items marked as visited;

[0036] 不断重复上述的遍历过程,最终找到20条最小路径:1-2-6-7,1-2-6-5-7,1-2-6-4-5-7,1-2-4-5-7,1-2-4-6-7,1-2-4-6-5-7,1-2-3-4-5-7,1-2-3-4-6-7,1-2-3-4-6-5-7,1-3-2-6-7,1-3-2-6-5-7,1-3-2-6-4-5-7,1-3-2-4-5-7,1-3-2-4-6-7,1-3-2-4-6-5-7,1-3-4-5-7,1-3-4-6-7,1-3-4-6-5-7,1-3-4-2-6-7,1-3-4-2-6-5-7。 [0036] The above-described repeated traversal, eventually find a minimum path 20: 1-2-6-7,1-2-6-5-7,1-2-6-4-5-7,1-2 -4-5-7,1-2-4-6-7,1-2-4-6-5-7,1-2-3-4-5-7,1-2-3-4-6 -7,1-2-3-4-6-5-7,1-3-2-6-7,1-3-2-6-5-7,1-3-2-6-4-5 -7,1-3-2-4-5-7,1-3-2-4-6-7,1-3-2-4-6-5-7,1-3-4-5-7 , 1-3-4-6-7,1-3-4-6-5-7,1-3-4-2-6-7,1-3-4-2-6-5-7. 利用本发明编制的程序表明该例确定最小路集的时间约为O. I秒。 Prepared using the procedure of the present invention show that Example minimal path set determination time is about O. I second.

[0037] 对于图2所示的包含169个节点、312条链路的大型网络,起点为节点1,终点为节点169,利用本发明编制的程序共计搜索到2704156条最小路径(具体路径略),确定时间约为78秒,这充分说明了本方法的高效性。 [0037] For Figure 169 contains nodes in FIG. 2, a large network link 312, a start point node, end node 169, using the preparation procedure of the present invention to a total of 2,704,156 shortest path search (path specifically omitted) , determining a time of about 78 seconds, which fully illustrate the efficiency of the method.

[0038] 对于节点数更大的网络,由于本方法中每次搜索到的最小路径可以单独输出,不影响后续最小路径的搜索,在计算机内存有限的情况下,可将每次搜索到的最小路径写入文件来实现超大型网络系统最小路集的确定。 [0038] For larger network nodes, since this process each searched route may be output separately a minimum, does not affect the subsequent search of the shortest path, in the case of computer memory is limited, you may be searched every time a minimum write the file to determine the path to achieve minimal path sets of large network systems.

Claims (1)

  1. 1. 一种基于邻接表的网络最小路集确定方法,其特征在于: 1)采用了一种新型的邻接表结构。 1. A method of determining minimal path set based on the network of the adjacent table, wherein: 1) A new adjacency list. 该邻接表由节点和邻接项组成,每个邻接项由节点可以到达的节点和是否访问过该节点两个数据项组成。 The adjacent nodes and adjacent table entries, each entry node from the adjacent nodes that can be reached through the access node and whether two data items. 这种结构与邻接矩阵或联络矩阵相比有效节约了存储空间,且能同时处理有向网络、无向网络和混合网络。 This structure adjacency matrix or connection matrix compared to effectively save storage space, and can simultaneously process directed networks, mixed networks and undirected network. 2)采用深度优先搜索和回溯相结合的方法遍历邻接表确定所有最小路径。 2) and a method using depth-first search traversal back combining all table to determine the minimum contiguous paths. 遍历过程中不会重复搜索相同的最小路径,每次搜索到的最小路径可单独输出,不影响后续最小路径的搜索,故不需要一次性保存所有最小路径,有效节约了内存空间。 Repeat the search process does not traverse the same minimal path, each path can be searched minimum output alone, does not affect the subsequent search of the shortest path, it is unnecessary to save all minimum path-time, effectively saving memory space. 这种方法对网络节点和链路的数量无限制,适用于大型复杂网络系统最小路集的确定。 This method of the number of network nodes and links unrestricted, adapted to determine the minimum path set large, complex networks.
CN 201210279183 2012-07-31 2012-07-31 Network minimum path set determination method based on adjacency list CN102880739A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201210279183 CN102880739A (en) 2012-07-31 2012-07-31 Network minimum path set determination method based on adjacency list

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201210279183 CN102880739A (en) 2012-07-31 2012-07-31 Network minimum path set determination method based on adjacency list

Publications (1)

Publication Number Publication Date
CN102880739A true true CN102880739A (en) 2013-01-16

Family

ID=47482062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201210279183 CN102880739A (en) 2012-07-31 2012-07-31 Network minimum path set determination method based on adjacency list

Country Status (1)

Country Link
CN (1) CN102880739A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1514603A (en) * 2002-12-11 2004-07-21 日本电信电话株式会社 Group broadcasting transfer path calculating method, calculating apparatus and program thereof
CN101965715A (en) * 2007-12-26 2011-02-02 北方电讯网络有限公司 Tie-Breaking in Shortest Path Determination
CN102004839A (en) * 2010-12-17 2011-04-06 北京优纳科技有限公司 Method for optimizing full-node traversal path
CN102210128A (en) * 2008-11-19 2011-10-05 日本电信电话株式会社 Path calculation order deciding method, program and calculating apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1514603A (en) * 2002-12-11 2004-07-21 日本电信电话株式会社 Group broadcasting transfer path calculating method, calculating apparatus and program thereof
CN101965715A (en) * 2007-12-26 2011-02-02 北方电讯网络有限公司 Tie-Breaking in Shortest Path Determination
CN102210128A (en) * 2008-11-19 2011-10-05 日本电信电话株式会社 Path calculation order deciding method, program and calculating apparatus
CN102004839A (en) * 2010-12-17 2011-04-06 北京优纳科技有限公司 Method for optimizing full-node traversal path

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李科迪: "智能汽车宏观路径规划方法研究", 《中国优秀硕士学位论文全文数据库(工程科技II辑)》, 15 September 2011 (2011-09-15) *
黄一华: "城市轨道交通客流分配模型与算法的研究", 《中国优秀硕士学位论文全文数据库(工程科技II辑)》, 15 December 2010 (2010-12-15) *

Similar Documents

Publication Publication Date Title
Gkantsidis et al. Random walks in peer-to-peer networks
Loguinov et al. Graph-theoretic analysis of structured peer-to-peer systems: routing distances and fault resilience
Fang et al. Landmark-based information storage and retrieval in sensor networks
Khan et al. Neighborhood based fast graph search in large networks
Gandhi et al. Approximation algorithms for partial covering problems
Siganos et al. Jellyfish: A conceptual model for the as internet topology
Avin et al. How to explore a fast-changing world (cover time of a simple random walk on evolving graphs)
Loguinov et al. Graph-theoretic analysis of structured peer-to-peer systems: routing distances and fault resilience
Raack et al. On cut‐based inequalities for capacitated network design polyhedra
Khadivi et al. Multi-constraint QoS routing using a new single mixed metrics
Abraham et al. A generic scheme for building overlay networks in adversarial scenarios
Han et al. Fault-tolerant relay node placement in heterogeneous wireless sensor networks
Del Chiappa et al. Knowledge transfer in smart tourism destinations: Analyzing the effects of a network structure
Marzolla et al. Resource discovery in a dynamic grid environment
CN101035131A (en) Protocol recognition method and device
Fomin et al. New upper bounds on the decomposability of planar graphs
CN101815003A (en) Uniform resource model of full service converged network
Shen et al. On the discovery of critical links and nodes for assessing network vulnerability
Czyzowicz et al. Complexity of searching for a black hole
Dolev et al. Internet resiliency to attacks and failures under BGP policy routing
Yuan et al. Efficiently answering probability threshold-based shortest path queries over uncertain graphs
Feng et al. An O (n log n) algorithm for obstacle-avoiding routing tree construction in the λ-geometry plane
CN101588263A (en) Method for evaluating reliability of electric force communication network
Chen et al. Constrained skyline query processing against distributed data sites
Brady et al. Compact routing on power law graphs with additive stretch

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
C05 Deemed withdrawal (patent law before 1993)