WO2017045578A1 - Topological graph optimal path algorithm with constraint conditions - Google Patents

Topological graph optimal path algorithm with constraint conditions Download PDF

Info

Publication number
WO2017045578A1
WO2017045578A1 PCT/CN2016/098777 CN2016098777W WO2017045578A1 WO 2017045578 A1 WO2017045578 A1 WO 2017045578A1 CN 2016098777 W CN2016098777 W CN 2016098777W WO 2017045578 A1 WO2017045578 A1 WO 2017045578A1
Authority
WO
WIPO (PCT)
Prior art keywords
topology
node
list
nodes
topology node
Prior art date
Application number
PCT/CN2016/098777
Other languages
French (fr)
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
Application filed by 烽火通信科技股份有限公司 filed Critical 烽火通信科技股份有限公司
Priority to MYPI2018700200A priority Critical patent/MY194954A/en
Publication of WO2017045578A1 publication Critical patent/WO2017045578A1/en
Priority to PH12018500275A priority patent/PH12018500275A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation

Definitions

  • the invention relates to a topology map optimal path algorithm, in particular to a topology map optimal path algorithm with constraints.
  • the telecommunication device is a communication node of the network, and the optical fiber connects two telecommunication devices as communication channels, and many telecommunication devices are connected to form an entire communication network.
  • the telecommunication transmission network is abstracted into the form of a topology diagram, the telecommunication equipment is used as a topology node, and the optical fiber is used as a topology link; thus the problem is changed to how to find the optimal from the source topology node to the sink topology node in the topology map.
  • the deterministic algorithm for finding the optimal path between two topological nodes in the topology map is Dijkstra algorithm, but the algorithm has some shortcomings:
  • Defining the degree of the topology node is the number of topology links connected by the topology node.
  • the degree of the source topology node is large, the time for finding the optimal path is significantly increased, which cannot meet the time requirement of the engineering application.
  • the technical problem to be solved by the present invention is to find the optimal path between the source and sink topology nodes under specified constraints.
  • the technical solution adopted by the present invention provides a topology path optimal path algorithm with constraints, including the following steps:
  • Step S10 Abstracting all the telecommunication devices in the telecommunication transmission network to generate a topology node, and abstracting all the optical fiber connections between the telecommunication devices to generate a topology link to form a topology matrix;
  • Step S20 selecting a source topology node Ns and a sink topology node Nd;
  • Step S30 Select a topology node and a topology link that the path must pass, and establish a list of mandatory topology nodes and a list of necessary topology links in a preset order, and convert the necessary topology links into mandatory topology nodes, and sequentially add to Must pass through the list of topology nodes;
  • Step S40 establishing avoiding the topology node list and avoiding the topology link list, and updating the topology matrix
  • Step S50 Setting the starting topology node and the terminating topology node of the current path finding are respectively necessary topology nodes Nt and Ne, and determining whether the topology node Nt must be connected via the topology link L ⁇ t, e>, and if so, Step S60 is performed; otherwise, step S70 is performed;
  • Step S60 the necessary to join the topology node Nt, Ne and the necessary link L ⁇ t, e> into the overall path, step S80;
  • Step S70 searching for the optimal path between the necessary topological nodes Nt, Ne, adding to the overall path, performing step S80;
  • Step S80 determining whether the current termination topology node Ne is the sink topology node Nd, and if so, ending the program; otherwise, executing step S90;
  • Step S90 setting a topology node in the optimal path between the topological nodes Nt and Ne as a avoided topology node, and setting a topology link in the optimal path between the topological nodes Nt and Ne to be avoided.
  • the topology link is then performed in step S40.
  • the topology matrix is an adjacency matrix, and each topology node is numbered.
  • the sequence consists of a list of topology links starting with each topology node Nk as L ⁇ k,*>, where * is the topology node number associated with the topology node Nk; each item of the topology link list includes weights And the termination topology node corresponding to the topology link, each topology node Nk maintains a list of topology links associated with it.
  • step S40 to step S90 are iterated a plurality of times, starting from the source topology node Ns, sequentially searching for the next necessary topology node, until the sink topology node Nd, searching for two adjacent neighbors in turn Through the optimal path between the topological nodes, these optimal paths are sequentially connected to form an optimal overall path through all necessary topological nodes;
  • the i-th iteration must be routed through the topology node IncludeNodeList[i] to the necessary topology node IncludeNodeList[i+1], where 0 ⁇ i ⁇ m.
  • step S30 specifically includes the following steps:
  • Step S31 adding the source topology node Ns to the list of necessary topology nodes
  • Step S32 inserting the other necessary topological nodes into the list of necessary topology nodes in order according to the constraint condition order;
  • Step S33 The sequence takes a topology link L ⁇ i,j> in the topology link list
  • Step S34 determining whether the topology node Ni is in the list of necessary topology nodes, and if so, executing step S35; otherwise, executing step S38;
  • Step S35 inserting the topology node Nj into the list of necessary topology nodes, and the location is after the topology node Ni;
  • Step S36 it is determined whether the topology node Nj is in the list of necessary topology nodes, and if so, step S37 is performed; otherwise, step S38 is performed;
  • Step S37 the topology node Ni is inserted into the list of necessary topology nodes, the location is before the topology node Nj, and then step S39 is performed;
  • Step S38 inserting the topological nodes Ni and Nj sequentially into the list of mandatory topology nodes. At last;
  • Step S39 determining whether the topology link list has been traversed, if not traversed, proceeding to step S33; otherwise, executing step S310;
  • Step S310 Adding the sink topology node Nd to the last list of the necessary topology node, as the last element in the list of necessary topology nodes, ending the process.
  • step S40 specifically includes the following steps:
  • Step S41 sequentially avoiding a topology node Nk of the topology node list
  • Step S42 deleting the topology node Nk in the topology matrix and the topology link list associated therewith;
  • Step S43 traversing other topology nodes of the topology matrix, deleting the topology node Nk in the topology link list associated with other topology nodes;
  • Step S44 determining whether to avoid the topology node list traversal, if there is no traversal, proceed to step S41; otherwise, perform step S45;
  • Step S45 sequentially avoiding a topology link L ⁇ i, j> in the topology link list
  • Step S46 finding the topology node Ni in the topology matrix, traversing the topology link list associated with it, and deleting the topology node Nj therein;
  • Step S47 finding the topology node Nj in the topology matrix, traversing the topology link list associated with it, and deleting the topology node Ni therein;
  • Step S48 Determine whether to avoid the traversal of the topology link list. If the traversal is not completed, the process proceeds to S45. Otherwise, the program ends.
  • step 70 specifically includes the following steps:
  • Step S71 calculating the degree of the current starting topology node Nt and the termination topology node Ne, and comparing whether the degree of the topology node Nt is greater than the topology node Ne, if yes, proceeding to step S72; otherwise, executing step S73;
  • Step S72 setting the topology node Ne to start the topology node, and the topology node Nt is Currently terminating the topology node;
  • Step S73 Calculating an optimal path from the starting topology node Ne to the terminating topology node Nt using the Dijkstra algorithm
  • Step S74 determining whether the topology nodes Nt and Ne perform step S72, and if yes, executing step S75; otherwise, ending the program;
  • Step S75 inverting the optimal path, and ending the program.
  • the method of the present invention avoids the specified topology node and the topology link by deleting the topology node and the topology link in the topology matrix; and then passing the specified topology link L ⁇ i, j>
  • the topology nodes Ni and Nj are sequentially added to the method of the must-be-topological node list IncludeNodeList, so that the searched optimal path must pass through the topological link L ⁇ i, j>, thereby realizing the optimal path under the constraint condition;
  • the current starting topology node Nt and the terminating topology node Ne are selected as the starting of the pathfinding. Topology nodes, thereby improving the pathfinding efficiency when the source topology node has a large degree.
  • FIG. 1 is a flowchart of an optimal path algorithm for a topology map with constraints according to the present invention
  • FIG. 2 is a schematic diagram of a topology matrix in an optimal path algorithm with a constraint topology diagram according to the present invention
  • FIG. 3 is a schematic diagram of an optimal path structure in an optimal path algorithm with a constraint topology diagram according to the present invention
  • FIG. 4 is a flow chart of step S30 in the present invention.
  • FIG. 5 is a flow chart of step S40 in the present invention.
  • Figure 6 is a flow chart of step S70 in the present invention.
  • the invention is used to find an optimal path between source and sink topology nodes under specified constraints.
  • the constraints include: the topology node and the topology link through which the path must pass; the topology node and the topology link that the path must avoid.
  • Nk The topology node with sequence number k is represented as Nk;
  • Avoiding the topology node list is represented as an AlbumNodeList, where the nth element is denoted as AlbumNodeList[n];
  • the optimal path calculation of a topology map with constraints is provided by the present invention.
  • the method includes the following steps:
  • Step S10 Abstracting all the telecommunication devices in the telecommunication transmission network to generate a topology node, and abstracting all the fiber connections between the telecommunication devices to generate a topology link to form a topology matrix, so that the entire telecommunication transmission network is abstracted into a network topology diagram. Since most of the telecommunication devices have no fiber connection, the topology matrix can be organized by using an adjacency matrix. Each topology node is organized into a list in sequence order, and each topology node Nk is used as a starting topology link list.
  • each item of the topology link list includes a weight and a termination topology node of the corresponding topology link, and each topology node Nk maintains its association with
  • * is the topology node number associated with the topology node Nk
  • each item of the topology link list includes a weight and a termination topology node of the corresponding topology link
  • each topology node Nk maintains its association with
  • FIG. 2 there are two optical fibers connected to the telecommunication device N2 from the telecommunication device N1, and the weights of the two optical fibers are 1 and 2, respectively.
  • Step S20 selecting a source topology node Ns and a sink topology node Nd.
  • the circuit is the communication channel between the telecommunication devices.
  • the telecommunication device at the beginning of the circuit is the source, and the telecommunication device at the terminating end is the sink.
  • the source topology node in the topology matrix is the topology node starting from the path.
  • the sink topology node is the topology node of the path termination, and the pathfinding process is the process of finding the optimal path from the source topology node to the sink topology node, that is, the process of finding the telecommunication equipment and the optical fiber through which the circuit passes, as shown in FIG.
  • the optimal path is formed by the connection of the topology node and the topology link, that is, the channel through which the telecommunication device and the optical fiber are connected to each other to form a circuit.
  • it is necessary to bypass the topology link in the topology node list AvoidNodeList and the topology link in the topology link list VoiceLinkList, and the topology node in the necessary topology node list IncludeNodeList and the necessary topology link list IncludeLinkList Topological link in .
  • Step S30 selecting a topology node and a topology link that the path must pass, and establishing a mandatory topology node list IncludeNodeLis and a mandatory topology link list IncludeLinkList according to a preset order (the preset circuit must pass through the order of the telecommunication devices), and Must The topology link is converted into a mandatory topology node, which is sequentially added to the mandatory topology node list IncludeNodeList.
  • the routing constraint condition that is, the telecommunication equipment and the optical fiber that the designated circuit must pass, wherein the topology node list IncludeNodeList must follow the telecommunication equipment of the circuit.
  • the topology nodes are stored in sequence; the topology link list IncludeLinkList stores the topology links according to the order in which the circuits must pass; since the fibers are connected to two telecommunication devices, the necessary topology links can be converted into the necessary topology nodes. .
  • Step S40 Establish an avoidance topology node list AvoidNodeList and avoid the topology link list AvoidLinkList, and update the topology matrix according to the avoidance topology node list AvoidNodeList and avoid the topology link list AvoidLinkList, and delete the topology node and the topology link that need to be avoided.
  • the telecommunication equipment and the optical fiber that the circuit avoids do not need to pass through the pathfinding, so there is no need to have the corresponding topological node and the topological link in the topology matrix. In this case, updating the topology matrix is to remove these from the topology matrix. Open topology nodes and topology links.
  • the present invention will enter the iterative pathfinding process, and each iteration is completed. If the sinking telecommunication device (sink topology node) is not found, it will return to step S40 for the next iteration, and the pathfinding will be updated before the pathfinding starts.
  • the topology matrix used will delete the topology node corresponding to the telecommunication device that was last routed and the topology link corresponding to the fiber, ensuring that the path does not pass through the repeated telecommunication equipment and fiber.
  • Step S50 setting a starting topology node Nt and a terminating topology node Ne of the current path finding (Nt and Ne are two topological nodes in the list of necessary topology nodes IncludeNodeList), and determining whether the topology node Nt is connected with a necessary topology link L ⁇ t, e>, if Nt is connected to the topological link L ⁇ t, e>, step S60 is performed; otherwise, step S70 is performed, that is, if the telecommunication device of the current path finding is directly connected to the necessary optical fiber , then the path directly passes through the telecommunication equipment of the end of the fiber and fiber, otherwise you need to use Dijkstra The algorithm performs path finding.
  • step S50 is to determine how to find the optimal path between the two necessary topological nodes (Nt and Ne), and the judgment is based on whether the starting topology node Nt of the current path finding is associated with the topology link L ⁇ t , e>, the method of judging is to find Nt in the topology matrix, traverse its associated topology node list, and determine whether there is a topology node Ne in this list.
  • step S60 the topology node Nt, Ne and the necessary link L ⁇ t, e> are added to the overall path, and step S80 is performed.
  • step S30 since it is ensured in step S30 that the topological nodes at both ends of the necessary topological link are necessarily in the IncludeNodeList, it can be known from step S30 that if there is a necessary topological link L ⁇ t, e> on the Nt, then Ne Must be the necessary topological node of Nt; if the topological nodes Nt, Ne are the two necessary topological nodes, and there must be a topological link on Nt, then the topological link must be L ⁇ t,e >, so in step S60, the two necessary topological nodes Nt, Ne and the necessary topological links L ⁇ t, e> between them can be directly added to the overall path.
  • step S70 an optimal path is found between the topological nodes Nt and Ne, and is added to the overall path, and step S80 is performed.
  • the method of finding the optimal path between the two topological nodes Nt and Ne is to improve the original basic Dijkstra algorithm and solve the problem of low path finding efficiency caused by the large number of Nt degrees of the source topology node.
  • the method mainly uses the topology matrix established in step S10, uses the basic Dijkstra algorithm to find the path of the minimum weight between the topological nodes, and optimizes when the Dijkstra algorithm starts to select, so that each time starts from the minimum degree topological node. Find the way to ensure that time is minimized.
  • Step S80 Determine whether the current termination topology node Ne is the sink topology node Nd, and if yes, end the program; otherwise, execute step S90. This step is to determine whether the optimal path has reached the sink topology node, that is, the path of the circuit has arrived at the sink telecom equipment.
  • Step S90 setting a topology node in the optimal path between the topological nodes Nt and Ne as a avoided topology node, and setting a topology link in the optimal path between the topological nodes Nt and Ne to be avoided.
  • a topology link so that all the topology nodes in the optimal path of Nt to Ne of this iteration are added to the AvoidNodeList when performing step S40, and all the topological links are added to the AvoidLinkList to ensure that the path is not found in the next iteration pathfinding. It will be repeated with the path of the last iteration, and then step S40 is performed.
  • step S40 to step S90 are iterated a plurality of times, starting from the source topology node Ns, sequentially traversing the next necessary topology node until the sink topology node Nd; thus ensuring that each path is The optimal path, which is connected in turn to form an optimal overall path through all necessary topological nodes; and the purpose of each iteration is to find the optimal path between the two necessary topological nodes and join the overall path.
  • step S40 the steps from step S40 to step S90 will be the number of iterations m-1.
  • step S30 specifically includes the following steps:
  • Step S31 Add the source topology node Ns to the mandatory topology node list IncludeNodeList, and the telecommunication device at the source end of the circuit must first pass through the circuit.
  • step S32 the other necessary topological nodes are sequentially inserted into the mandatory topology node list IncludeNodeList according to the constraint condition order (the order of the telecommunication equipment that the circuit must pass) (the circuit must go through the process in the process of finding the telecommunication device to the sink end). Telecommunications equipment, inserted in order).
  • step S33 the sequence must pass through a topology link L ⁇ i,j> in the topology link list IncludeLinkList, and the necessary optical fiber (topological link) is sequentially converted into a necessary telecommunication device (topological node). .
  • Step S34 Determine whether the topology node Ni is in the mandatory topology node list IncludeNodeList, and if yes, execute step S35; otherwise, execute step S38. This step determines whether the topology node Ni is already in the list of necessary topology nodes. Since the topology node Ni is the starting telecommunications device of the optical fiber, the circuit must pass through the topology node Ni through the optical fiber.
  • Step S35 Insert the topology node Nj into the mandatory topology node list IncludeNodeList, and the location is after the topology node Ni.
  • the topology node Ni is already in the list of necessary topological nodes, it indicates that the telecommunications equipment at the beginning of the optical fiber must pass through the circuit. Therefore, the terminating telecommunication equipment of the optical fiber should also pass through the circuit, that is, the topology node Nj must Inserted after the Ni of the list of necessary topology nodes.
  • Step S36 Determine whether the topology node Nj is in the mandatory topology node list IncludeNodeList, and if yes, execute step S37; otherwise, perform step S38. Since the topology node Nj is the terminating telecommunication device of the optical fiber, the circuit must pass through the topology node Nj through the optical fiber. This step determines whether the topology node Nj is already in the list of necessary topology nodes, and selects different processing flows according to the judgment result. This step is to make a reverse judgment on the optical fiber to ensure that the circuit must pass through the topology node Ni when the topology node Nj is used as the starting topology node.
  • Step S37 Insert the topology node Ni into the mandatory topology node list IncludeNodeList, the position is before the topology node Nj, and then perform step S39. Since the topology node Nj is already in the list of necessary topology nodes, indicating that the terminating telecommunication device of the optical fiber must pass through the circuit, the telecommunication device at the beginning of the optical fiber should also pass through the circuit, that is, the topology node Ni must be inserted. It must be in the list of topological nodes and before the topology node Nj.
  • Step S38 inserting the topological nodes Ni and Nj sequentially into the last of the mandatory topology node list IncludeNodeList.
  • the topology node Ni or Nj is not in the necessary topology node
  • the list is included in the IncludeNodeList, it indicates that the telecommunication devices that must pass through the two ends of the fiber are not required by the circuit.
  • the optical fiber topological link
  • the topology node Ni is And Nj are inserted sequentially into the list of mandatory topology nodes IncludeNodeList last.
  • step S39 it is determined whether the topology link list IncludeLinkList has been traversed. If the traversal is not traversed, step S33 is performed; otherwise, step S310 is performed, which is used to ensure that all necessary topological links are converted into a necessary topology. node.
  • Step S310 adding the sink topology node Nd to the mandatory topology node list IncludeNodeList. Since the sink telecommunication device of the circuit is the termination point and the last topology node that must pass, the sink topology node is included in the list of necessary topology nodes IncludeNodeList. The last element ends the process.
  • step S40 specifically includes the following steps:
  • Step S41 sequentially avoiding a topology node Nk of the topology node list AviationNodeList, that is, starting to sequentially process each telecommunication device that needs to be avoided.
  • Step S42 deleting the topology node Nk in the topology matrix and the topology link list associated therewith.
  • the topology node Nk it is a topology node corresponding to the telecommunication device that needs to be avoided, and the topology node and its associated topology link list are deleted from the topology matrix, that is, the corresponding telecommunication device and the telecommunication device are started. The fibers are removed.
  • step S43 the other topology nodes of the topology matrix are traversed, and the topology node Nk is deleted in the topology link list associated with other topology nodes.
  • the starting fiber is traversed on other telecommunication devices. If the end of the fiber is the telecommunication device, the fiber is also deleted.
  • step S44 it is determined whether the topology node list AvoidAnode is traversed. If the traversal is not completed, step S41 is performed; otherwise, step S45 is performed.
  • Step S45 sequentially avoiding a topology extension in the topology link list.
  • the link L ⁇ i,j> that is, sequentially processing each fiber that needs to be avoided.
  • Step S46 Find the topology node Ni in the topology matrix, traverse the topology link list associated with the topology node, and delete the topology node Nj therein, that is, delete the topology link L ⁇ i,j in the topology link list associated with the topology node Ni. >.
  • the telecommunication device at the beginning of the fiber corresponds to the topology node Ni
  • the terminating telecommunication device corresponds to the topology node Nj
  • the topology node Nj associated with the topology node Ni is deleted from the topology matrix, that is, the fiber is deleted.
  • Step S47 Find the topology node Nj in the topology matrix, traverse the topology link list associated with the topology node, delete the topology node Ni therein, and delete the topology node Ni associated with the topology node Nj from the topology matrix, that is, delete the fiber in step S46. The reverse fiber.
  • Step S48 Determine whether to avoid the traversal of the topology link list VoiceLinkList. If the traversal is not completed, the process proceeds to S45. Otherwise, it indicates that all the avoidance topology links have been processed, and the program ends.
  • step 70 specifically includes the following steps:
  • Step S71 Calculate the degree of the current starting topology node Nt and the terminating topology node Ne, and compare whether the degree of the topology node Nt is greater than that of the topology node Ne. If yes, execute step S72; otherwise, execute step S73.
  • This step is to calculate the degree of the start topology node and the termination topology node of the pathfinding in this iteration, and select the next step according to the size of the two, that is, from a telecommunication device to the next telecommunication device in the telecommunication transmission network.
  • the connection point of the two telecommunication equipments with less fiber is selected as the starting point of path finding. The purpose of this is to reduce the number of Dijkstra algorithm search paths and improve the path finding efficiency.
  • Step S72 Interchanging the topology nodes Nt and Ne, that is, setting the current starting topology node of the topology node Ne, and the topology node Nt is the current ending topology node, thereby ensuring that the degree of the starting topology node is less than the degree of the terminating topology node.
  • Step S73 Calculate an optimal path from the starting topology node Ne to the terminating topology node Nt using the Dijkstra algorithm.
  • the topology matrix in step S30 using the standard The Dijkstra algorithm looks for the optimal path from the starting topology node to the terminating topology node. In this iteration, the optimal path between the two necessary telecommunication devices is found to ensure that the sum of the passed fiber weights is the smallest.
  • Step S74 it is judged whether the topology nodes Nt and Ne have performed step S72, and if so, step S75 is performed; otherwise, the program is ended.
  • Step S75 Invert the optimal path, obtain an optimal path starting from the topology node Nt and ending the topology node with the topology node Ne, and ending the program. Since the topology node starts the topology node and terminates the topology node in step S72, in this step, the optimal path needs to be reversed to obtain the path in the correct direction, that is, the direction and overall direction of the optimal path are calculated in step S73. The direction of the path is reversed and needs to be adjusted to a uniform direction when the optimal path is added to the overall path.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed is a topological graph optimal path algorithm with constraint conditions, comprising: generating topological nodes with telecommunication devices and generating topological links with fibre connections, so as to form a topological matrix; selecting a source and a destination topological node; establishing, according to the constraint conditions, a list of topological nodes and topological links, which must be passed through, converting the topological links, which must be passed through, into topological nodes, which must be passed through, and adding same to the list of topological nodes which must be passed through; establishing, according to the constraint conditions, a list of topological nodes and topological links to be avoided, and updating the topological matrix; setting a start and an end topological node during the current path-searching to be Nt and Ne; when Nt is connected with the topological link L<t,e>, adding Nt, Ne, and L<t,e> to the overall path; otherwise, searching for the optimal path between Nt and Ne and adding same to the overall path; and if Ne is the destination topological node, then ending; otherwise, updating the topological matrix according to the optimal path between Nt and Ne, and starting the next iteration. The present invention realizes searching for the optimal path under constraint conditions, and improves the path-searching efficiency in the case of a large source topological node degree by improving the Dijkstra algorithm.

Description

一种带约束条件的拓扑图最优路径算法A Topology Map Optimal Path Algorithm with Constraints 技术领域Technical field
本发明涉及拓扑图最优路径算法,具体涉及一种带约束条件的拓扑图最优路径算法。The invention relates to a topology map optimal path algorithm, in particular to a topology map optimal path algorithm with constraints.
背景技术Background technique
在电信传输网中,电信设备为网络的通信节点,光纤连接两台电信设备为通信通道,许多电信设备连接起来组成了整个通信网络。In the telecommunication transmission network, the telecommunication device is a communication node of the network, and the optical fiber connects two telecommunication devices as communication channels, and many telecommunication devices are connected to form an entire communication network.
在工程上,配置电信传输网电路时,需要寻找到从一台电信设备经过指定的电信设备和光纤到另一台电信设备的最优路径。为了方便解决问题,将电信传输网抽象成拓扑图的形式,电信设备作为拓扑节点,光纤作为拓扑链路;这样问题就转变为如何在拓扑图中寻找从源拓扑节点到宿拓扑节点的最优路径,并且满足指定的约束条件。In engineering, when configuring a telecommunication transmission network circuit, it is necessary to find an optimal path from a telecommunication device through a designated telecommunication device and an optical fiber to another telecommunication device. In order to solve the problem conveniently, the telecommunication transmission network is abstracted into the form of a topology diagram, the telecommunication equipment is used as a topology node, and the optical fiber is used as a topology link; thus the problem is changed to how to find the optimal from the source topology node to the sink topology node in the topology map. The path and meet the specified constraints.
目前,在拓扑图中寻找两拓扑节点间最优路径的确定性算法是Dijkstra算法,但是该算法存在一下不足:At present, the deterministic algorithm for finding the optimal path between two topological nodes in the topology map is Dijkstra algorithm, but the algorithm has some shortcomings:
(1)无法指定最优路径的约束条件,即无法指定最优路径必经的拓扑节点和拓扑链路,也无法指定最优路径避开的拓扑节点和拓扑链路;(1) The constraint condition of the optimal path cannot be specified, that is, the topology node and the topology link that the optimal path must pass cannot be specified, and the topology node and the topology link that the optimal path avoids cannot be specified;
(2)无法保证最优路径不重复经过某一拓扑节点或拓扑链路;(2) There is no guarantee that the optimal path does not repeat through a certain topology node or topology link;
(3)定义拓扑节点的度数为拓扑节点连接的拓扑链路的数目,当源拓扑节点的度数较大时,寻找最优路径的时间显著增加,无法满足工程应用对时间的要求。(3) Defining the degree of the topology node is the number of topology links connected by the topology node. When the degree of the source topology node is large, the time for finding the optimal path is significantly increased, which cannot meet the time requirement of the engineering application.
发明内容 Summary of the invention
本发明所要解决的技术问题是在指定约束条件下,寻找源、宿拓扑节点间的最优路径的问题。The technical problem to be solved by the present invention is to find the optimal path between the source and sink topology nodes under specified constraints.
为了解决上述技术问题,本发明所采用的技术方案是提供一种带约束条件的拓扑图最优路径算法,包括以下步骤:In order to solve the above technical problem, the technical solution adopted by the present invention provides a topology path optimal path algorithm with constraints, including the following steps:
步骤S10、将电信传输网中所有电信设备抽象生成拓扑节点,电信设备间的所有光纤连接抽象生成拓扑链路,组成拓扑矩阵;Step S10: Abstracting all the telecommunication devices in the telecommunication transmission network to generate a topology node, and abstracting all the optical fiber connections between the telecommunication devices to generate a topology link to form a topology matrix;
步骤S20、选择源拓扑节点Ns和宿拓扑节点Nd;Step S20, selecting a source topology node Ns and a sink topology node Nd;
步骤S30、选择路径必须经过的拓扑节点和拓扑链路,按预设顺序建立必经拓扑节点列表和必经拓扑链路列表,并将必经拓扑链路转化为必经拓扑节点,顺序添加到必经拓扑节点列表中;Step S30: Select a topology node and a topology link that the path must pass, and establish a list of mandatory topology nodes and a list of necessary topology links in a preset order, and convert the necessary topology links into mandatory topology nodes, and sequentially add to Must pass through the list of topology nodes;
步骤S40、建立避开拓扑节点列表和避开拓扑链路列表,并更新拓扑矩阵;Step S40, establishing avoiding the topology node list and avoiding the topology link list, and updating the topology matrix;
步骤S50、设置当前寻路的起始拓扑节点和终结拓扑节点分别为必经拓扑节点Nt和Ne,并判定必经拓扑节点Nt是否连接必经拓扑链路L<t,e>,如果是,执行步骤S60;否则,执行步骤S70;Step S50: Setting the starting topology node and the terminating topology node of the current path finding are respectively necessary topology nodes Nt and Ne, and determining whether the topology node Nt must be connected via the topology link L<t, e>, and if so, Step S60 is performed; otherwise, step S70 is performed;
步骤S60、将必经拓扑节点Nt、Ne和必经链路L<t,e>加入到整体路径中,执行步骤S80;Step S60, the necessary to join the topology node Nt, Ne and the necessary link L <t, e> into the overall path, step S80;
步骤S70、在必经拓扑节点Nt、Ne间寻找最优路径,加入到整体路径中,执行步骤S80;Step S70, searching for the optimal path between the necessary topological nodes Nt, Ne, adding to the overall path, performing step S80;
步骤S80、判断当前终结拓扑节点Ne是否为宿拓扑节点Nd,如果是,则结束程序;否则,执行步骤S90;Step S80, determining whether the current termination topology node Ne is the sink topology node Nd, and if so, ending the program; otherwise, executing step S90;
步骤S90、将必经拓扑节点Nt、Ne间最优路径中的拓扑节点设置为避开的拓扑节点,将必经拓扑节点Nt、Ne间的最优路径中的拓扑链路设置为避开的拓扑链路,然后执行步骤S40。Step S90: setting a topology node in the optimal path between the topological nodes Nt and Ne as a avoided topology node, and setting a topology link in the optimal path between the topological nodes Nt and Ne to be avoided. The topology link is then performed in step S40.
在上述方法中,所述拓扑矩阵为邻接矩阵,每个拓扑节点按序号 顺序组成列表,以每个拓扑节点Nk作为起始的拓扑链路列表为L<k,*>,其中,*为与拓扑节点Nk关联的拓扑节点序号;拓扑链路列表的每项包括权值和对应拓扑链路的终结拓扑节点,每个拓扑节点Nk维护与其关联的拓扑链路列表。In the above method, the topology matrix is an adjacency matrix, and each topology node is numbered. The sequence consists of a list of topology links starting with each topology node Nk as L<k,*>, where * is the topology node number associated with the topology node Nk; each item of the topology link list includes weights And the termination topology node corresponding to the topology link, each topology node Nk maintains a list of topology links associated with it.
在上述方法中,步骤S40到步骤S90的步骤会迭代多次,从源拓扑节点Ns开始,依次向后一个必经拓扑节点寻路,一直到宿拓扑节点Nd为止,依次寻找相邻两个必经拓扑节点间的最优路径,把这些最优路径依次连接组成经过所有必经拓扑节点的最优整体路径;In the above method, the steps from step S40 to step S90 are iterated a plurality of times, starting from the source topology node Ns, sequentially searching for the next necessary topology node, until the sink topology node Nd, searching for two adjacent neighbors in turn Through the optimal path between the topological nodes, these optimal paths are sequentially connected to form an optimal overall path through all necessary topological nodes;
如果必经拓扑节点列表中IncludeNodeList中的必经拓扑节点有m个,那么第i次迭代从必经拓扑节点IncludeNodeList[i]寻路到必经拓扑节点IncludeNodeList[i+1],其中0<i<m。If there are m necessary topological nodes in the IncludeNodeList in the list of topological nodes, then the i-th iteration must be routed through the topology node IncludeNodeList[i] to the necessary topology node IncludeNodeList[i+1], where 0<i <m.
在上述方法中,步骤S30具体包括以下步骤:In the above method, step S30 specifically includes the following steps:
步骤S31、将源拓扑节点Ns加入到必经拓扑节点列表中;Step S31, adding the source topology node Ns to the list of necessary topology nodes;
步骤S32、将其他必经拓扑节点按约束条件顺序要求依次***到必经拓扑节点列表中;Step S32, inserting the other necessary topological nodes into the list of necessary topology nodes in order according to the constraint condition order;
步骤S33、顺序取必经拓扑链路列表中的一条拓扑链路L<i,j>;Step S33: The sequence takes a topology link L<i,j> in the topology link list;
步骤S34、判断拓扑节点Ni是否在必经拓扑节点列表中,如果是,执行步骤S35;否则,执行步骤S38;Step S34, determining whether the topology node Ni is in the list of necessary topology nodes, and if so, executing step S35; otherwise, executing step S38;
步骤S35、将拓扑节点Nj***到必经拓扑节点列表中,位置在拓扑节点Ni之后;Step S35, inserting the topology node Nj into the list of necessary topology nodes, and the location is after the topology node Ni;
步骤S36、判断拓扑节点Nj是否在必经拓扑节点列表中,如果是,则执行步骤S37;否则执行步骤S38;Step S36, it is determined whether the topology node Nj is in the list of necessary topology nodes, and if so, step S37 is performed; otherwise, step S38 is performed;
步骤S37、将拓扑节点Ni***到必经拓扑节点列表中,位置在拓扑节点Nj之前,然后执行步骤S39;Step S37, the topology node Ni is inserted into the list of necessary topology nodes, the location is before the topology node Nj, and then step S39 is performed;
步骤S38、将拓扑节点Ni和Nj顺序***到必经拓扑节点列表的 最后;Step S38, inserting the topological nodes Ni and Nj sequentially into the list of mandatory topology nodes. At last;
步骤S39、判断必经拓扑链路列表是否已经遍历完,如果未遍历完,则执行步骤S33;否则,执行步骤S310;Step S39, determining whether the topology link list has been traversed, if not traversed, proceeding to step S33; otherwise, executing step S310;
步骤S310、将宿拓扑节点Nd加入到必经拓扑节点列表最后,作为必经拓扑节点列表中最后一个元素,结束流程。Step S310: Adding the sink topology node Nd to the last list of the necessary topology node, as the last element in the list of necessary topology nodes, ending the process.
在上述方法中,步骤S40具体包括以下步骤:In the above method, step S40 specifically includes the following steps:
步骤S41、顺序取避开拓扑节点列表的一个拓扑节点Nk;Step S41, sequentially avoiding a topology node Nk of the topology node list;
步骤S42、删除拓扑矩阵中的拓扑节点Nk以及与其关联的拓扑链路列表;Step S42, deleting the topology node Nk in the topology matrix and the topology link list associated therewith;
步骤S43、遍历拓扑矩阵的其他拓扑节点,在与其他拓扑节点关联的拓扑链路列表中删除拓扑节点Nk;Step S43, traversing other topology nodes of the topology matrix, deleting the topology node Nk in the topology link list associated with other topology nodes;
步骤S44、判断避开拓扑节点列表是否遍历完,如果没有遍历完,则执行步骤S41;否则,执行步骤S45;Step S44, determining whether to avoid the topology node list traversal, if there is no traversal, proceed to step S41; otherwise, perform step S45;
步骤S45、顺序取避开拓扑链路列表中的一条拓扑链路L<i,j>;Step S45, sequentially avoiding a topology link L<i, j> in the topology link list;
步骤S46、找到拓扑矩阵中的拓扑节点Ni,遍历与其关联的拓扑链路列表,删除其中的拓扑节点Nj;Step S46, finding the topology node Ni in the topology matrix, traversing the topology link list associated with it, and deleting the topology node Nj therein;
步骤S47、找到拓扑矩阵中的拓扑节点Nj,遍历与其关联的拓扑链路列表,删除其中的拓扑节点Ni;Step S47, finding the topology node Nj in the topology matrix, traversing the topology link list associated with it, and deleting the topology node Ni therein;
步骤S48、判断避开拓扑链路列表是否遍历完,如果没有遍历完,执行步骤则S45,否则,结束程序。Step S48: Determine whether to avoid the traversal of the topology link list. If the traversal is not completed, the process proceeds to S45. Otherwise, the program ends.
在上述方法中,步骤70具体包括以下步骤:In the above method, step 70 specifically includes the following steps:
步骤S71、计算当前起始拓扑节点Nt和终结拓扑节点Ne的度数,并比较拓扑节点Nt的度数是否比拓扑节点Ne的大,如果是,则执行步骤S72;否则,执行步骤S73;Step S71, calculating the degree of the current starting topology node Nt and the termination topology node Ne, and comparing whether the degree of the topology node Nt is greater than the topology node Ne, if yes, proceeding to step S72; otherwise, executing step S73;
步骤S72、设置拓扑节点Ne当前起始拓扑节点,拓扑节点Nt为 当前终结拓扑节点;Step S72, setting the topology node Ne to start the topology node, and the topology node Nt is Currently terminating the topology node;
步骤S73、使用Dijkstra算法计算从起始拓扑节点Ne到终结拓扑节点Nt的最优路径;Step S73: Calculating an optimal path from the starting topology node Ne to the terminating topology node Nt using the Dijkstra algorithm;
步骤S74、判断拓扑节点Nt和Ne是否执行了步骤S72,如果是,执行步骤S75;否则,结束程序;Step S74, determining whether the topology nodes Nt and Ne perform step S72, and if yes, executing step S75; otherwise, ending the program;
步骤S75、反转最优路径,结束程序。Step S75, inverting the optimal path, and ending the program.
本发明通过删除拓扑矩阵中的拓扑节点和拓扑链路的方法,使得寻路中避开了指定的拓扑节点和拓扑链路;再通过将指定的必经拓扑链路L<i,j>的拓扑节点Ni和Nj依次加入到必经拓扑节点列表IncludeNodeList的方法,使得寻得的最优路径一定经过拓扑链路L<i,j>,从而实现在约束条件下寻找最优路径;并且在必经拓扑节点列表IncludeNodeList中的拓扑节点IncludeNodeList[i]和IncludeNodeList[i+1]之间的寻路过程中,选择当前起始拓扑节点Nt和终结拓扑节点Ne中度数小的作为寻路的起始拓扑节点,从而提高源拓扑节点度数较大时的寻路效率。The method of the present invention avoids the specified topology node and the topology link by deleting the topology node and the topology link in the topology matrix; and then passing the specified topology link L<i, j> The topology nodes Ni and Nj are sequentially added to the method of the must-be-topological node list IncludeNodeList, so that the searched optimal path must pass through the topological link L<i, j>, thereby realizing the optimal path under the constraint condition; In the pathfinding process between the topology nodes IncludeNodeList[i] and IncludeNodeList[i+1] in the topology node list IncludeNodeList, the current starting topology node Nt and the terminating topology node Ne are selected as the starting of the pathfinding. Topology nodes, thereby improving the pathfinding efficiency when the source topology node has a large degree.
附图说明DRAWINGS
图1为本发明提供的一种带约束条件的拓扑图最优路径算法的流程图;1 is a flowchart of an optimal path algorithm for a topology map with constraints according to the present invention;
图2为本发明提供的一种带约束条件的拓扑图最优路径算法中拓扑矩阵示意图;2 is a schematic diagram of a topology matrix in an optimal path algorithm with a constraint topology diagram according to the present invention;
图3为本发明提供的一种带约束条件的拓扑图最优路径算法中最优路径结构示意图;3 is a schematic diagram of an optimal path structure in an optimal path algorithm with a constraint topology diagram according to the present invention;
图4为本发明中步骤S30的流程图;Figure 4 is a flow chart of step S30 in the present invention;
图5为本发明中步骤S40的流程图; Figure 5 is a flow chart of step S40 in the present invention;
图6为本发明中步骤S70的流程图。Figure 6 is a flow chart of step S70 in the present invention.
具体实施方式detailed description
本发明用于在指定约束条件下,寻找源、宿拓扑节点间的最优路径。其中约束条件包括:路径必须经过的拓扑节点和拓扑链路;路径必须避开的拓扑节点和拓扑链路。The invention is used to find an optimal path between source and sink topology nodes under specified constraints. The constraints include: the topology node and the topology link through which the path must pass; the topology node and the topology link that the path must avoid.
为方便下面叙述现作如下定义:For the convenience of the following description, the following definitions are made:
其中,设k,i,j,n都是自然数,*为与拓扑节点Ni或者Nj关联的拓扑节点序号;Wherein, let k, i, j, n be natural numbers, and * be the topology node number associated with the topology node Ni or Nj;
1)序号为k的拓扑节点表示为Nk;1) The topology node with sequence number k is represented as Nk;
2)顺序连接拓扑节点Ni和Nj的拓扑链路记作L<i,j>;2) The topological links of the sequential connection topology nodes Ni and Nj are denoted as L<i,j>;
3)以Ni为起始的链路列表记作L<i,*>,即从Ni出发的多条链路,;3) The list of links starting with Ni is denoted as L<i,*>, that is, multiple links starting from Ni;
4)以Nj为终结的链路列表记作L<*,j>,即在Nj终止的多条链路;4) The list of links ending with Nj is denoted as L<*, j>, that is, multiple links terminated at Nj;
5)必经拓扑节点列表记作IncludeNodeList,其中第n个元素记作IncludeNodeList[n];5) The list of topological nodes must be recorded as IncludeNodeList, where the nth element is recorded as IncludeNodeList[n];
6)必经拓扑链路列表记作IncludeLinkList,其中的第n个元素记作IncludeLinkList[n];6) The list of topological links must be recorded as IncludeLinkList, where the nth element is recorded as IncludeLinkList[n];
7)避开拓扑节点列表表示为AvoidNodeList,其中的第n个元素记作AvoidNodeList[n];7) Avoiding the topology node list is represented as an AlbumNodeList, where the nth element is denoted as AlbumNodeList[n];
8)避开拓扑链路列表表示为AvoidLinkList,其中的第n个元素记作AvoidLinkList[n]。8) Avoiding the topology link list is represented as an AlbumLinkList, where the nth element is recorded as OlympicLinkList[n].
下面结合说明书附图和具体实施例对本发明做出详细的说明。The present invention will be described in detail below with reference to the drawings and specific embodiments.
如图1所示,本发明提供的一种带约束条件的拓扑图最优路径算 法包括以下步骤:As shown in FIG. 1, the optimal path calculation of a topology map with constraints is provided by the present invention. The method includes the following steps:
步骤S10、将电信传输网中所有电信设备抽象生成拓扑节点,电信设备间的所有光纤连接抽象生成拓扑链路,组成拓扑矩阵,这样整个电信传输网网络就抽象成了网络拓扑图。由于大部分电信设备之间是没有光纤连接的,所以此拓扑矩阵可采用邻接矩阵的方式来组织,每个拓扑节点按序号顺序组成列表,以每个拓扑节点Nk作为起始的拓扑链路列表为L<k,*>,其中,*为与拓扑节点Nk关联的拓扑节点序号;拓扑链路列表的每项包括权值和对应拓扑链路的终结拓扑节点,每个拓扑节点Nk维护与其关联的拓扑链路列表;比如,如图2所示,从电信设备N1有两条光纤连接电信设备N2,两条光纤的权值分别是1和2。Step S10: Abstracting all the telecommunication devices in the telecommunication transmission network to generate a topology node, and abstracting all the fiber connections between the telecommunication devices to generate a topology link to form a topology matrix, so that the entire telecommunication transmission network is abstracted into a network topology diagram. Since most of the telecommunication devices have no fiber connection, the topology matrix can be organized by using an adjacency matrix. Each topology node is organized into a list in sequence order, and each topology node Nk is used as a starting topology link list. L<k,*>, where * is the topology node number associated with the topology node Nk; each item of the topology link list includes a weight and a termination topology node of the corresponding topology link, and each topology node Nk maintains its association with For example, as shown in FIG. 2, there are two optical fibers connected to the telecommunication device N2 from the telecommunication device N1, and the weights of the two optical fibers are 1 and 2, respectively.
步骤S20、选择源拓扑节点Ns和宿拓扑节点Nd。在电信传输网中,电路是电信设备间通信的通道,电路的起始端电信设备即是源,终结端电信设备即是宿,可见,在拓扑矩阵中源拓扑节点就是路径起始的拓扑节点,宿拓扑节点是路径终结的拓扑节点,而寻路的过程,就是从源拓扑节点开始向宿拓扑节点寻找最优路径的过程,即找电路经过的电信设备和光纤的过程,如图3所示,最优路径由拓扑节点和拓扑链路相间连接而成,即表示电信设备和光纤相间连接形成电路经过的通道。在此过程中,需要绕过避开拓扑节点列表AvoidNodeList中的拓扑节点与拓扑链路列表AvoidLinkList中的拓扑链路,需要经过必经拓扑节点列表IncludeNodeList中的拓扑节点与必经拓扑链路列表IncludeLinkList中的拓扑链路。Step S20, selecting a source topology node Ns and a sink topology node Nd. In the telecommunication transmission network, the circuit is the communication channel between the telecommunication devices. The telecommunication device at the beginning of the circuit is the source, and the telecommunication device at the terminating end is the sink. It can be seen that the source topology node in the topology matrix is the topology node starting from the path. The sink topology node is the topology node of the path termination, and the pathfinding process is the process of finding the optimal path from the source topology node to the sink topology node, that is, the process of finding the telecommunication equipment and the optical fiber through which the circuit passes, as shown in FIG. The optimal path is formed by the connection of the topology node and the topology link, that is, the channel through which the telecommunication device and the optical fiber are connected to each other to form a circuit. In this process, it is necessary to bypass the topology link in the topology node list AvoidNodeList and the topology link in the topology link list VoiceLinkList, and the topology node in the necessary topology node list IncludeNodeList and the necessary topology link list IncludeLinkList Topological link in .
步骤S30、选择路径必须经过的拓扑节点和拓扑链路,按预设顺序(预设的电路必须经过电信设备的先后顺序)建立必经拓扑节点列表IncludeNodeLis和必经拓扑链路列表IncludeLinkList,并将必 经拓扑链路转化为必经拓扑节点,顺序添加到必经拓扑节点列表IncludeNodeList中。在寻找源拓扑节点和宿拓扑节点之间最优路径前,首先指定路由约束条件,即指定电路必须经过的电信设备和光纤,其中,必经拓扑节点列表IncludeNodeList按电路必须经过的电信设备的先后顺序存放拓扑节点;必经拓扑链路列表IncludeLinkList按照电路必须经过的光纤的先后顺序存放拓扑链路;由于光纤连接两台电信设备,因此可以将必经的拓扑链路转换成必经的拓扑节点。Step S30, selecting a topology node and a topology link that the path must pass, and establishing a mandatory topology node list IncludeNodeLis and a mandatory topology link list IncludeLinkList according to a preset order (the preset circuit must pass through the order of the telecommunication devices), and Must The topology link is converted into a mandatory topology node, which is sequentially added to the mandatory topology node list IncludeNodeList. Before finding the optimal path between the source topology node and the sink topology node, first specify the routing constraint condition, that is, the telecommunication equipment and the optical fiber that the designated circuit must pass, wherein the topology node list IncludeNodeList must follow the telecommunication equipment of the circuit. The topology nodes are stored in sequence; the topology link list IncludeLinkList stores the topology links according to the order in which the circuits must pass; since the fibers are connected to two telecommunication devices, the necessary topology links can be converted into the necessary topology nodes. .
步骤S40、建立避开拓扑节点列表AvoidNodeList和避开拓扑链路列表AvoidLinkList,并根据避开拓扑节点列表AvoidNodeList和避开拓扑链路列表AvoidLinkList更新拓扑矩阵,删除需要避开的拓扑节点和拓扑链路。电路避开的电信设备和光纤是不需要在寻路中经过的,因此在拓扑矩阵中不需要出现与其对应的拓扑节点和拓扑链路,在此更新拓扑矩阵就是从拓扑矩阵中删除这些需要避开的拓扑节点和拓扑链路。Step S40: Establish an avoidance topology node list AvoidNodeList and avoid the topology link list AvoidLinkList, and update the topology matrix according to the avoidance topology node list AvoidNodeList and avoid the topology link list AvoidLinkList, and delete the topology node and the topology link that need to be avoided. . The telecommunication equipment and the optical fiber that the circuit avoids do not need to pass through the pathfinding, so there is no need to have the corresponding topological node and the topological link in the topology matrix. In this case, updating the topology matrix is to remove these from the topology matrix. Open topology nodes and topology links.
从此步骤开始,本发明将进入了迭代寻路的过程,每次迭代完成,如果未找到宿电信设备(宿拓扑节点)都会返回步骤S40进行下一轮迭代,在寻路开始前,更新寻路使用的拓扑矩阵,都会将上次寻路经过的电信设备对应的拓扑节点和光纤对应的拓扑链路删除,保证路径不经过重复的电信设备和光纤。Starting from this step, the present invention will enter the iterative pathfinding process, and each iteration is completed. If the sinking telecommunication device (sink topology node) is not found, it will return to step S40 for the next iteration, and the pathfinding will be updated before the pathfinding starts. The topology matrix used will delete the topology node corresponding to the telecommunication device that was last routed and the topology link corresponding to the fiber, ensuring that the path does not pass through the repeated telecommunication equipment and fiber.
步骤S50、设置当前寻路的起始拓扑节点Nt和终结拓扑节点Ne(Nt和Ne为必经拓扑节点列表IncludeNodeList中的两个拓扑节点),并判定拓扑节点Nt是否连接了必经拓扑链路L<t,e>,如果Nt连接了必经拓扑链路L<t,e>,执行步骤S60;否则,执行步骤S70,即如果当前寻路起始的电信设备直接连接了必经的光纤,那么路径直接经过此光纤和光纤的终结端的电信设备,否则就需要使用Dijkstra 算法进行寻路。Step S50, setting a starting topology node Nt and a terminating topology node Ne of the current path finding (Nt and Ne are two topological nodes in the list of necessary topology nodes IncludeNodeList), and determining whether the topology node Nt is connected with a necessary topology link L<t, e>, if Nt is connected to the topological link L<t, e>, step S60 is performed; otherwise, step S70 is performed, that is, if the telecommunication device of the current path finding is directly connected to the necessary optical fiber , then the path directly passes through the telecommunication equipment of the end of the fiber and fiber, otherwise you need to use Dijkstra The algorithm performs path finding.
在本发明中,步骤S50是判断如何寻找两个必经拓扑节点(Nt和Ne)间的最优路径,判断依据是当前寻路的起始拓扑节点Nt是否关联必经拓扑链路L<t,e>,判断的方法是在拓扑矩阵中找到Nt,遍历其关联的拓扑节点列表,判断是否有拓扑节点Ne存在此列表中。In the present invention, step S50 is to determine how to find the optimal path between the two necessary topological nodes (Nt and Ne), and the judgment is based on whether the starting topology node Nt of the current path finding is associated with the topology link L<t , e>, the method of judging is to find Nt in the topology matrix, traverse its associated topology node list, and determine whether there is a topology node Ne in this list.
步骤S60、将必经拓扑节点Nt、Ne和必经链路L<t,e>加入到整体路径中,执行步骤S80。In step S60, the topology node Nt, Ne and the necessary link L<t, e> are added to the overall path, and step S80 is performed.
在本发明中,由于在步骤S30中保证了必经的拓扑链路两端的拓扑节点一定在IncludeNodeList中,由步骤S30可知:如果Nt上存在必经拓扑链路L<t,e>,那么Ne必定是紧接Nt的必经拓扑节点;如果拓扑节点Nt、Ne是紧接的两个必经拓扑节点,且Nt上存在必经拓扑链路,那么此拓扑链路必是L<t,e>,所以在步骤S60可以直接将两个必经拓扑节点Nt、Ne和它们之间的必经拓扑链路L<t,e>加入到整体路径中。In the present invention, since it is ensured in step S30 that the topological nodes at both ends of the necessary topological link are necessarily in the IncludeNodeList, it can be known from step S30 that if there is a necessary topological link L<t, e> on the Nt, then Ne Must be the necessary topological node of Nt; if the topological nodes Nt, Ne are the two necessary topological nodes, and there must be a topological link on Nt, then the topological link must be L<t,e >, so in step S60, the two necessary topological nodes Nt, Ne and the necessary topological links L<t, e> between them can be directly added to the overall path.
步骤S70、在必经拓扑节点Nt、Ne间寻找最优路径,加入到整体路径中,执行步骤S80。In step S70, an optimal path is found between the topological nodes Nt and Ne, and is added to the overall path, and step S80 is performed.
此步骤中,寻找两个必经拓扑节点Nt、Ne间的最优路径的方法是对原有的基本Dijkstra算法进行了改进,解决源拓扑节点Nt度数大导致的寻路效率低的问题。该方法主要是利用步骤S10建立的拓扑矩阵,使用基本的Dijkstra算法找到必经拓扑节点间最小权值的路径,在Dijkstra算法起始点选择时进行优化,使得每次都从最小度数的拓扑节点开始寻路,以保证时间的最小化。In this step, the method of finding the optimal path between the two topological nodes Nt and Ne is to improve the original basic Dijkstra algorithm and solve the problem of low path finding efficiency caused by the large number of Nt degrees of the source topology node. The method mainly uses the topology matrix established in step S10, uses the basic Dijkstra algorithm to find the path of the minimum weight between the topological nodes, and optimizes when the Dijkstra algorithm starts to select, so that each time starts from the minimum degree topological node. Find the way to ensure that time is minimized.
步骤S80、判断当前终结拓扑节点Ne是否为宿拓扑节点Nd,如果是,则结束程序;否则,执行步骤S90。此步骤是判断最优路径是否已经到达宿拓扑节点,即电路的路径已经到达宿端电信设备上。 Step S80: Determine whether the current termination topology node Ne is the sink topology node Nd, and if yes, end the program; otherwise, execute step S90. This step is to determine whether the optimal path has reached the sink topology node, that is, the path of the circuit has arrived at the sink telecom equipment.
步骤S90、将必经拓扑节点Nt、Ne间最优路径中的拓扑节点设置为避开的拓扑节点,将必经拓扑节点Nt、Ne间的最优路径中的拓扑链路设置为避开的拓扑链路,以便在执行步骤S40时将此次迭代的Nt到Ne的最优路径中的所有拓扑节点加入到AvoidNodeList,所有拓扑链路加入到AvoidLinkList中,保证在下一迭代寻路时,路径不会与上次迭代的路径重复,然后执行步骤S40。Step S90: setting a topology node in the optimal path between the topological nodes Nt and Ne as a avoided topology node, and setting a topology link in the optimal path between the topological nodes Nt and Ne to be avoided. a topology link, so that all the topology nodes in the optimal path of Nt to Ne of this iteration are added to the AvoidNodeList when performing step S40, and all the topological links are added to the AvoidLinkList to ensure that the path is not found in the next iteration pathfinding. It will be repeated with the path of the last iteration, and then step S40 is performed.
在本发明中,步骤S40到步骤S90的步骤会迭代多次,从源拓扑节点Ns开始,依次向后一个必经拓扑节点寻路,一直到宿拓扑节点Nd为止;这样保证每段路径都是最优路径,把这些路径依次连接就组成了经过所有必经拓扑节点的最优的整体路径;而每次迭代的目的是在两个必经拓扑节点间寻找最优路径并加入到整体路径中,假设必经拓扑节点列表中IncludeNodeList中的必经拓扑节点有m个,那么第i次迭代从必经拓扑节点IncludeNodeList[i]寻路到必经拓扑节点IncludeNodeList[i+1],其中0<i<m;步骤S40到步骤S90的步骤会迭代次数为m-1。In the present invention, the steps from step S40 to step S90 are iterated a plurality of times, starting from the source topology node Ns, sequentially traversing the next necessary topology node until the sink topology node Nd; thus ensuring that each path is The optimal path, which is connected in turn to form an optimal overall path through all necessary topological nodes; and the purpose of each iteration is to find the optimal path between the two necessary topological nodes and join the overall path. Assuming that there must be m necessary topological nodes in the IncludeNodeList in the list of topological nodes, then the i-th iteration must be routed through the topology node IncludeNodeList[i] to the necessary topological node IncludeNodeList[i+1], where 0< i<m; the steps from step S40 to step S90 will be the number of iterations m-1.
如图4所示,步骤S30具体包括以下步骤:As shown in FIG. 4, step S30 specifically includes the following steps:
步骤S31、将源拓扑节点Ns加入到必经拓扑节点列表IncludeNodeList中,电路源端的电信设备是电路首先必须经过的。Step S31: Add the source topology node Ns to the mandatory topology node list IncludeNodeList, and the telecommunication device at the source end of the circuit must first pass through the circuit.
步骤S32、将其他必经拓扑节点按约束条件顺序要求(电路必须经过的电信设备先后顺序)依次***到必经拓扑节点列表IncludeNodeList中(电路在寻找到宿端的电信设备过程中,依次必须经过的电信设备,按顺序***)。In step S32, the other necessary topological nodes are sequentially inserted into the mandatory topology node list IncludeNodeList according to the constraint condition order (the order of the telecommunication equipment that the circuit must pass) (the circuit must go through the process in the process of finding the telecommunication device to the sink end). Telecommunications equipment, inserted in order).
步骤S33、顺序取必经拓扑链路列表IncludeLinkList中的一条拓扑链路L<i,j>,从此步骤开始依次将必经的光纤(拓扑链路)转换成必经的电信设备(拓扑节点)。 In step S33, the sequence must pass through a topology link L<i,j> in the topology link list IncludeLinkList, and the necessary optical fiber (topological link) is sequentially converted into a necessary telecommunication device (topological node). .
步骤S34、判断拓扑节点Ni是否在必经拓扑节点列表IncludeNodeList中,如果是,执行步骤S35;否则,执行步骤S38。此步骤判断拓扑节点Ni是否已经在必经的拓扑节点列表中了,由于拓扑节点Ni是电路必经光纤的起始端电信设备,电路经过此光纤必定会经过拓扑节点Ni。Step S34: Determine whether the topology node Ni is in the mandatory topology node list IncludeNodeList, and if yes, execute step S35; otherwise, execute step S38. This step determines whether the topology node Ni is already in the list of necessary topology nodes. Since the topology node Ni is the starting telecommunications device of the optical fiber, the circuit must pass through the topology node Ni through the optical fiber.
步骤S35、将拓扑节点Nj***到必经拓扑节点列表IncludeNodeList中,位置在拓扑节点Ni之后。当拓扑节点Ni已经在必经的拓扑节点列表中,表示此必经光纤的起始端电信设备是电路必须经过的,因此光纤的终结端电信设备也应该是电路必须经过的,即拓扑节点Nj必须***到必经的拓扑节点列表的Ni之后。Step S35: Insert the topology node Nj into the mandatory topology node list IncludeNodeList, and the location is after the topology node Ni. When the topology node Ni is already in the list of necessary topological nodes, it indicates that the telecommunications equipment at the beginning of the optical fiber must pass through the circuit. Therefore, the terminating telecommunication equipment of the optical fiber should also pass through the circuit, that is, the topology node Nj must Inserted after the Ni of the list of necessary topology nodes.
步骤S36、判断拓扑节点Nj是否在必经拓扑节点列表IncludeNodeList中,如果是,则执行步骤S37;否则执行步骤S38。由于拓扑节点Nj是电路必经光纤的终结端电信设备,电路经过此光纤必定会经过拓扑节点Nj,该步骤判断拓扑节点Nj是否已经在必经拓扑节点列表中,根据判断结果选择不同的处理流程,此步骤是对光纤作反向的判断,以保证电路当以拓扑节点Nj作为起始拓扑节点经过此光纤时必经过拓扑节点Ni。Step S36: Determine whether the topology node Nj is in the mandatory topology node list IncludeNodeList, and if yes, execute step S37; otherwise, perform step S38. Since the topology node Nj is the terminating telecommunication device of the optical fiber, the circuit must pass through the topology node Nj through the optical fiber. This step determines whether the topology node Nj is already in the list of necessary topology nodes, and selects different processing flows according to the judgment result. This step is to make a reverse judgment on the optical fiber to ensure that the circuit must pass through the topology node Ni when the topology node Nj is used as the starting topology node.
步骤S37、将拓扑节点Ni***到必经拓扑节点列表IncludeNodeList中,位置在拓扑节点Nj之前,然后执行步骤S39。由于拓扑节点Nj已经在必经拓扑节点列表中,表示此必经光纤的终结端电信设备是电路必须经过的,因此光纤的起始端电信设备也应该是电路必须经过的,即拓扑节点Ni必须***到必经拓扑节点列表中,并在拓扑节点Nj之前。Step S37: Insert the topology node Ni into the mandatory topology node list IncludeNodeList, the position is before the topology node Nj, and then perform step S39. Since the topology node Nj is already in the list of necessary topology nodes, indicating that the terminating telecommunication device of the optical fiber must pass through the circuit, the telecommunication device at the beginning of the optical fiber should also pass through the circuit, that is, the topology node Ni must be inserted. It must be in the list of topological nodes and before the topology node Nj.
步骤S38、将拓扑节点Ni和Nj顺序***到必经拓扑节点列表IncludeNodeList的最后。当拓扑节点Ni或者Nj不在必经拓扑节点 列表IncludeNodeList中时,说明必经光纤两端的电信设备都不是电路必须经过的,在此情况下,需要在经过所有必经拓扑节点电路后再经过此光纤(拓扑链路),所以将拓扑节点Ni和Nj顺序***到必经拓扑节点列表IncludeNodeList最后。Step S38, inserting the topological nodes Ni and Nj sequentially into the last of the mandatory topology node list IncludeNodeList. When the topology node Ni or Nj is not in the necessary topology node When the list is included in the IncludeNodeList, it indicates that the telecommunication devices that must pass through the two ends of the fiber are not required by the circuit. In this case, the optical fiber (topological link) needs to pass through all the necessary topological node circuits, so the topology node Ni is And Nj are inserted sequentially into the list of mandatory topology nodes IncludeNodeList last.
步骤S39、判断必经拓扑链路列表IncludeLinkList是否已经遍历完,如果未遍历完,则执行步骤S33;否则,执行步骤S310,此步骤用来保证将所有必经拓扑链路都转成必经拓扑节点。In step S39, it is determined whether the topology link list IncludeLinkList has been traversed. If the traversal is not traversed, step S33 is performed; otherwise, step S310 is performed, which is used to ensure that all necessary topological links are converted into a necessary topology. node.
步骤S310、将宿拓扑节点Nd加到必经拓扑节点列表IncludeNodeList最后,由于电路的宿端电信设备是终结点,也是必经的最后一个拓扑节点,所以宿拓扑节点作为必经拓扑节点列表IncludeNodeList中最后一个元素,结束流程。Step S310, adding the sink topology node Nd to the mandatory topology node list IncludeNodeList. Since the sink telecommunication device of the circuit is the termination point and the last topology node that must pass, the sink topology node is included in the list of necessary topology nodes IncludeNodeList. The last element ends the process.
如图5所示,步骤S40具体包括以下步骤:As shown in FIG. 5, step S40 specifically includes the following steps:
步骤S41、顺序取避开拓扑节点列表AvoidNodeList的一个拓扑节点Nk,即开始顺序处理每一个需要避开的电信设备。Step S41: sequentially avoiding a topology node Nk of the topology node list AviationNodeList, that is, starting to sequentially process each telecommunication device that needs to be avoided.
步骤S42、删除拓扑矩阵中的拓扑节点Nk以及与其关联的拓扑链路列表。对于拓扑节点Nk,它是需要避开的电信设备对应的拓扑节点,将该拓扑节点及其关联的拓扑链路列表从拓扑矩阵中删除也就是将其对应的电信设备和以该电信设备起始的光纤都删除。Step S42, deleting the topology node Nk in the topology matrix and the topology link list associated therewith. For the topology node Nk, it is a topology node corresponding to the telecommunication device that needs to be avoided, and the topology node and its associated topology link list are deleted from the topology matrix, that is, the corresponding telecommunication device and the telecommunication device are started. The fibers are removed.
步骤S43、遍历拓扑矩阵的其他拓扑节点,在与其他拓扑节点关联的拓扑链路列表中删除拓扑节点Nk。对于Nk对应的电信设备,在其他的电信设备上遍历起始的光纤,如果光纤的终结是该电信设备,那么此光纤也被删除掉。In step S43, the other topology nodes of the topology matrix are traversed, and the topology node Nk is deleted in the topology link list associated with other topology nodes. For the telecommunication device corresponding to Nk, the starting fiber is traversed on other telecommunication devices. If the end of the fiber is the telecommunication device, the fiber is also deleted.
步骤S44、判断避开拓扑节点列表AvoidNodeList是否遍历完,如果没有遍历完,则执行步骤S41;否则,执行步骤S45。In step S44, it is determined whether the topology node list AvoidAnode is traversed. If the traversal is not completed, step S41 is performed; otherwise, step S45 is performed.
步骤S45、顺序取避开拓扑链路列表AvoidLinkList中的一条拓 扑链路L<i,j>,即顺序处理每条需要避开的光纤。Step S45, sequentially avoiding a topology extension in the topology link list. The link L<i,j>, that is, sequentially processing each fiber that needs to be avoided.
步骤S46、找到拓扑矩阵中的拓扑节点Ni,遍历与其关联的拓扑链路列表,删除其中的拓扑节点Nj,即在与拓扑节点Ni关联的拓扑链路列表中删除拓扑链路L<i,j>。光纤的起始端电信设备对应拓扑节点Ni,终结端电信设备对应拓扑节点Nj,从拓扑矩阵中删除与拓扑节点Ni关联的拓扑节点Nj,即删除了此条光纤。Step S46: Find the topology node Ni in the topology matrix, traverse the topology link list associated with the topology node, and delete the topology node Nj therein, that is, delete the topology link L<i,j in the topology link list associated with the topology node Ni. >. The telecommunication device at the beginning of the fiber corresponds to the topology node Ni, and the terminating telecommunication device corresponds to the topology node Nj, and the topology node Nj associated with the topology node Ni is deleted from the topology matrix, that is, the fiber is deleted.
步骤S47、找到拓扑矩阵中的拓扑节点Nj,遍历与其关联的拓扑链路列表,删除其中的拓扑节点Ni;从拓扑矩阵中删除与拓扑节点Nj关联的拓扑节点Ni,即删除了步骤S46删除光纤的反向的光纤。Step S47: Find the topology node Nj in the topology matrix, traverse the topology link list associated with the topology node, delete the topology node Ni therein, and delete the topology node Ni associated with the topology node Nj from the topology matrix, that is, delete the fiber in step S46. The reverse fiber.
步骤S48、判断避开拓扑链路列表AvoidLinkList是否遍历完,如果没有遍历完,执行步骤则S45,否则,表明已经处理完所有避开拓扑链路,结束程序。Step S48: Determine whether to avoid the traversal of the topology link list VoiceLinkList. If the traversal is not completed, the process proceeds to S45. Otherwise, it indicates that all the avoidance topology links have been processed, and the program ends.
如图6所示,步骤70具体包括以下步骤:As shown in FIG. 6, step 70 specifically includes the following steps:
步骤S71、计算当前起始拓扑节点Nt和终结拓扑节点Ne的度数,并比较拓扑节点Nt的度数是否比拓扑节点Ne的大,如果是,则执行步骤S72;否则,执行步骤S73。此步骤是计算此次迭代中寻路的起始拓扑节点和终结拓扑节点的度数,并根据两者大小选择下一步骤,即在电信传输网中从一台电信设备到下一台电信设备寻路时,选择两台电信设备中连接光纤较少的作为寻路的起始点,这样做的目的是降低Dijkstra算法搜索路径的次数,提高寻路效率。Step S71: Calculate the degree of the current starting topology node Nt and the terminating topology node Ne, and compare whether the degree of the topology node Nt is greater than that of the topology node Ne. If yes, execute step S72; otherwise, execute step S73. This step is to calculate the degree of the start topology node and the termination topology node of the pathfinding in this iteration, and select the next step according to the size of the two, that is, from a telecommunication device to the next telecommunication device in the telecommunication transmission network. When the road is selected, the connection point of the two telecommunication equipments with less fiber is selected as the starting point of path finding. The purpose of this is to reduce the number of Dijkstra algorithm search paths and improve the path finding efficiency.
步骤S72、互换拓扑节点Nt和Ne,即设置拓扑节点Ne当前起始拓扑节点,拓扑节点Nt为当前终结拓扑节点,从而保证起始拓扑节点的度数小于终结拓扑节点的度数。Step S72: Interchanging the topology nodes Nt and Ne, that is, setting the current starting topology node of the topology node Ne, and the topology node Nt is the current ending topology node, thereby ensuring that the degree of the starting topology node is less than the degree of the terminating topology node.
步骤S73、使用Dijkstra算法计算从起始拓扑节点Ne到终结拓扑节点Nt的最优路径。这里利用步骤S30中的拓扑矩阵,使用标准 的Dijkstra算法寻找从起始拓扑节点到终结拓扑节点的最优路径,即在这一迭代中,找到两个必经的电信设备间的最优路径,以保证经过的光纤权值之和最小。Step S73: Calculate an optimal path from the starting topology node Ne to the terminating topology node Nt using the Dijkstra algorithm. Here, using the topology matrix in step S30, using the standard The Dijkstra algorithm looks for the optimal path from the starting topology node to the terminating topology node. In this iteration, the optimal path between the two necessary telecommunication devices is found to ensure that the sum of the passed fiber weights is the smallest.
步骤S74、判断拓扑节点Nt和Ne是否执行了步骤S72,如果是,执行步骤S75;否则,结束程序。Step S74, it is judged whether the topology nodes Nt and Ne have performed step S72, and if so, step S75 is performed; otherwise, the program is ended.
步骤S75、反转最优路径,获得以拓扑节点Nt为起始拓扑节点、以拓扑节点Ne为终结拓扑节点的最优路径,结束程序。由于步骤S72互换了拓扑节点起始拓扑节点和终结拓扑节点,因此在该步骤中需要对最优路径进行反转,从而得到正确方向的路径,即步骤S73中计算最优路径的方向和整体路径的方向是相反的,需要在最优路径加入到整体路径中时调整成一致的方向。Step S75: Invert the optimal path, obtain an optimal path starting from the topology node Nt and ending the topology node with the topology node Ne, and ending the program. Since the topology node starts the topology node and terminates the topology node in step S72, in this step, the optimal path needs to be reversed to obtain the path in the correct direction, that is, the direction and overall direction of the optimal path are calculated in step S73. The direction of the path is reversed and needs to be adjusted to a uniform direction when the optimal path is added to the overall path.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。 It is apparent that those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the invention

Claims (6)

  1. 一种带约束条件的拓扑图最优路径算法,其特征在于,包括以下步骤:A topological map optimal path algorithm with constraints, characterized in that it comprises the following steps:
    步骤S10、将电信传输网中所有电信设备抽象生成拓扑节点,电信设备间的所有光纤连接抽象生成拓扑链路,组成拓扑矩阵;Step S10: Abstracting all the telecommunication devices in the telecommunication transmission network to generate a topology node, and abstracting all the optical fiber connections between the telecommunication devices to generate a topology link to form a topology matrix;
    步骤S20、选择源拓扑节点Ns和宿拓扑节点Nd;Step S20, selecting a source topology node Ns and a sink topology node Nd;
    步骤S30、选择路径必须经过的拓扑节点和拓扑链路,按预设顺序建立必经拓扑节点列表和必经拓扑链路列表,并将必经拓扑链路转化为必经拓扑节点,顺序添加到必经拓扑节点列表中;Step S30: Select a topology node and a topology link that the path must pass, and establish a list of mandatory topology nodes and a list of necessary topology links in a preset order, and convert the necessary topology links into mandatory topology nodes, and sequentially add to Must pass through the list of topology nodes;
    步骤S40、建立避开拓扑节点列表和避开拓扑链路列表,并更新拓扑矩阵;Step S40, establishing avoiding the topology node list and avoiding the topology link list, and updating the topology matrix;
    步骤S50、设置当前寻路的起始拓扑节点和终结拓扑节点分别为必经拓扑节点Nt和Ne,并判定必经拓扑节点Nt是否连接必经拓扑链路L<t,e>,如果是,执行步骤S60;否则,执行步骤S70;Step S50: Setting the starting topology node and the terminating topology node of the current path finding are respectively necessary topology nodes Nt and Ne, and determining whether the topology node Nt must be connected via the topology link L<t, e>, and if so, Step S60 is performed; otherwise, step S70 is performed;
    步骤S60、将必经拓扑节点Nt、Ne和必经链路L<t,e>加入到整体路径中,执行步骤S80;Step S60, the necessary to join the topology node Nt, Ne and the necessary link L <t, e> into the overall path, step S80;
    步骤S70、在必经拓扑节点Nt、Ne间寻找最优路径,加入到整体路径中,执行步骤S80;Step S70, searching for the optimal path between the necessary topological nodes Nt, Ne, adding to the overall path, performing step S80;
    步骤S80、判断当前终结拓扑节点Ne是否为宿拓扑节点Nd,如果是,则结束程序;否则,执行步骤S90;Step S80, determining whether the current termination topology node Ne is the sink topology node Nd, and if so, ending the program; otherwise, executing step S90;
    步骤S90、将必经拓扑节点Nt、Ne间最优路径中的拓扑节点设置为避开的拓扑节点,将必经拓扑节点Nt、Ne间的最优路径中的拓扑链路设置为避开的拓扑链路,然后执行步骤S40。Step S90: setting a topology node in the optimal path between the topological nodes Nt and Ne as a avoided topology node, and setting a topology link in the optimal path between the topological nodes Nt and Ne to be avoided. The topology link is then performed in step S40.
  2. 如权利要求1所述的方法,其特征在于,所述拓扑矩阵为邻接矩阵,每个拓扑节点按序号顺序组成列表,以每个拓扑节点Nk作 为起始的拓扑链路列表为L<k,*>,其中,*为与拓扑节点Nk关联的拓扑节点序号;拓扑链路列表的每项包括权值和对应拓扑链路的终结拓扑节点,每个拓扑节点Nk维护与其关联的拓扑链路列表。The method according to claim 1, wherein the topology matrix is an adjacency matrix, and each topology node is formed into a list by sequence number, and each topology node Nk is used. The list of starting topology links is L<k,*>, where * is the topology node number associated with the topology node Nk; each item of the topology link list includes a weight and a termination topology node of the corresponding topology link, Each topology node Nk maintains a list of topology links associated with it.
  3. 如权利要求1所述的方法,其特征在于,步骤S40到步骤S90的步骤会迭代多次,从源拓扑节点Ns开始,依次向后一个必经拓扑节点寻路,一直到宿拓扑节点Nd为止,依次寻找相邻两个必经拓扑节点间的最优路径,把这些最优路径依次连接组成经过所有必经拓扑节点的最优整体路径;The method according to claim 1, wherein the steps from step S40 to step S90 are iterated a plurality of times, starting from the source topology node Ns, and sequentially searching for the next necessary topology node until the sink topology node Nd. And sequentially searching for the optimal paths between two adjacent topological nodes, and sequentially connecting the optimal paths to form an optimal overall path through all necessary topological nodes;
    如果必经拓扑节点列表中IncludeNodeList中的必经拓扑节点有m个,那么第i次迭代从必经拓扑节点IncludeNodeList[i]寻路到必经拓扑节点IncludeNodeList[i+1],其中0<i<m。If there are m necessary topological nodes in the IncludeNodeList in the list of topological nodes, then the i-th iteration must be routed through the topology node IncludeNodeList[i] to the necessary topology node IncludeNodeList[i+1], where 0<i <m.
  4. 如权利要求1所述的方法,其特征在于,步骤S30具体包括以下步骤:The method of claim 1 wherein step S30 comprises the following steps:
    步骤S31、将源拓扑节点Ns加入到必经拓扑节点列表中;Step S31, adding the source topology node Ns to the list of necessary topology nodes;
    步骤S32、将其他必经拓扑节点按约束条件顺序要求依次***到必经拓扑节点列表中;Step S32, inserting the other necessary topological nodes into the list of necessary topology nodes in order according to the constraint condition order;
    步骤S33、顺序取必经拓扑链路列表中的一条拓扑链路L<i,j>;Step S33: The sequence takes a topology link L<i,j> in the topology link list;
    步骤S34、判断拓扑节点Ni是否在必经拓扑节点列表中,如果是,执行步骤S35;否则,执行步骤S38;Step S34, determining whether the topology node Ni is in the list of necessary topology nodes, and if so, executing step S35; otherwise, executing step S38;
    步骤S35、将拓扑节点Nj***到必经拓扑节点列表中,位置在拓扑节点Ni之后;Step S35, inserting the topology node Nj into the list of necessary topology nodes, and the location is after the topology node Ni;
    步骤S36、判断拓扑节点Nj是否在必经拓扑节点列表中,如果是,则执行步骤S37;否则执行步骤S38;Step S36, it is determined whether the topology node Nj is in the list of necessary topology nodes, and if so, step S37 is performed; otherwise, step S38 is performed;
    步骤S37、将拓扑节点Ni***到必经拓扑节点列表中,位置在拓扑节点Nj之前,然后执行步骤S39; Step S37, the topology node Ni is inserted into the list of necessary topology nodes, the location is before the topology node Nj, and then step S39 is performed;
    步骤S38、将拓扑节点Ni和Nj顺序***到必经拓扑节点列表的最后;Step S38, inserting the topology nodes Ni and Nj sequentially into the last list of the list of necessary topology nodes;
    步骤S39、判断必经拓扑链路列表是否已经遍历完,如果未遍历完,则执行步骤S33;否则,执行步骤S310;Step S39, determining whether the topology link list has been traversed, if not traversed, proceeding to step S33; otherwise, executing step S310;
    步骤S310、将宿拓扑节点Nd加入到必经拓扑节点列表最后,作为必经拓扑节点列表中最后一个元素,结束流程。Step S310: Adding the sink topology node Nd to the last list of the necessary topology node, as the last element in the list of necessary topology nodes, ending the process.
  5. 如权利要求2所述的方法,其特征在于,步骤S40具体包括以下步骤:The method of claim 2, wherein the step S40 comprises the following steps:
    步骤S41、顺序取避开拓扑节点列表的一个拓扑节点Nk;Step S41, sequentially avoiding a topology node Nk of the topology node list;
    步骤S42、删除拓扑矩阵中的拓扑节点Nk以及与其关联的拓扑链路列表;Step S42, deleting the topology node Nk in the topology matrix and the topology link list associated therewith;
    步骤S43、遍历拓扑矩阵的其他拓扑节点,在与其他拓扑节点关联的拓扑链路列表中删除拓扑节点Nk;Step S43, traversing other topology nodes of the topology matrix, deleting the topology node Nk in the topology link list associated with other topology nodes;
    步骤S44、判断避开拓扑节点列表是否遍历完,如果没有遍历完,则执行步骤S41;否则,执行步骤S45;Step S44, determining whether to avoid the topology node list traversal, if there is no traversal, proceed to step S41; otherwise, perform step S45;
    步骤S45、顺序取避开拓扑链路列表中的一条拓扑链路L<i,j>;Step S45, sequentially avoiding a topology link L<i, j> in the topology link list;
    步骤S46、找到拓扑矩阵中的拓扑节点Ni,遍历与其关联的拓扑链路列表,删除其中的拓扑节点Nj;Step S46, finding the topology node Ni in the topology matrix, traversing the topology link list associated with it, and deleting the topology node Nj therein;
    步骤S47、找到拓扑矩阵中的拓扑节点Nj,遍历与其关联的拓扑链路列表,删除其中的拓扑节点Ni;Step S47, finding the topology node Nj in the topology matrix, traversing the topology link list associated with it, and deleting the topology node Ni therein;
    步骤S48、判断避开拓扑链路列表是否遍历完,如果没有遍历完,执行步骤则S45,否则,结束程序。Step S48: Determine whether to avoid the traversal of the topology link list. If the traversal is not completed, the process proceeds to S45. Otherwise, the program ends.
  6. 如权利要求1所述的方法,其特征在于,步骤70具体包括以下步骤:The method of claim 1 wherein step 70 comprises the steps of:
    步骤S71、计算当前起始拓扑节点Nt和终结拓扑节点Ne的度数, 并比较拓扑节点Nt的度数是否比拓扑节点Ne的大,如果是,则执行步骤S72;否则,执行步骤S73;Step S71, calculating the degrees of the current starting topology node Nt and the terminating topology node Ne, And comparing whether the degree of the topology node Nt is greater than the topology node Ne, if yes, proceed to step S72; otherwise, perform step S73;
    步骤S72、设置拓扑节点Ne当前起始拓扑节点,拓扑节点Nt为当前终结拓扑节点;Step S72, setting the topology node Ne to start the topology node, and the topology node Nt is the current termination topology node;
    步骤S73、使用Dijkstra算法计算从起始拓扑节点Ne到终结拓扑节点Nt的最优路径;Step S73: Calculating an optimal path from the starting topology node Ne to the terminating topology node Nt using the Dijkstra algorithm;
    步骤S74、判断拓扑节点Nt和Ne是否执行了步骤S72,如果是,执行步骤S75;否则,结束程序;Step S74, determining whether the topology nodes Nt and Ne perform step S72, and if yes, executing step S75; otherwise, ending the program;
    步骤S75、反转最优路径,结束程序。 Step S75, inverting the optimal path, and ending the program.
PCT/CN2016/098777 2015-09-16 2016-09-13 Topological graph optimal path algorithm with constraint conditions WO2017045578A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
MYPI2018700200A MY194954A (en) 2015-09-16 2016-09-13 Topological graph optimal path algorithm with constraint conditions
PH12018500275A PH12018500275A1 (en) 2015-09-16 2018-02-06 Topological graph optimal path algorithm with constraint conditions

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510589652.8A CN105141524B (en) 2015-09-16 2015-09-16 A kind of topological diagram optimal path algorithm of Problem with Some Constrained Conditions
CN201510589652.8 2015-09-16

Publications (1)

Publication Number Publication Date
WO2017045578A1 true WO2017045578A1 (en) 2017-03-23

Family

ID=54726737

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/098777 WO2017045578A1 (en) 2015-09-16 2016-09-13 Topological graph optimal path algorithm with constraint conditions

Country Status (4)

Country Link
CN (1) CN105141524B (en)
MY (1) MY194954A (en)
PH (1) PH12018500275A1 (en)
WO (1) WO2017045578A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111787436A (en) * 2020-07-02 2020-10-16 中国电子科技集团公司第三十四研究所 Method for automatic searching and planning of optical network communication path
CN112115567A (en) * 2020-08-01 2020-12-22 富盛科技股份有限公司 Optical fiber minimum consumption path planning method
CN112511230A (en) * 2020-11-20 2021-03-16 国网浙江省电力有限公司宁波供电公司 Optimal optical fiber path selection method and device
CN113297822A (en) * 2021-04-26 2021-08-24 阳光新能源开发有限公司 Photovoltaic power station current collection circuit determination method and device and storage medium
CN114928569A (en) * 2022-04-28 2022-08-19 烽火通信科技股份有限公司 Method and system for realizing shortest path containing multiple must-pass resources
CN115242702A (en) * 2022-09-22 2022-10-25 广州优刻谷科技有限公司 Internet of things node optimal path planning method and system

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105141524B (en) * 2015-09-16 2018-06-01 武汉烽火技术服务有限公司 A kind of topological diagram optimal path algorithm of Problem with Some Constrained Conditions
CN109412954A (en) * 2017-08-18 2019-03-01 中国电信股份有限公司 Route determining methods, device and storage medium based on unordered joint constraint
CN108680163B (en) * 2018-04-25 2022-03-01 武汉理工大学 Unmanned ship path searching system and method based on topological map
CN109195192B (en) * 2018-08-16 2022-04-01 全球能源互联网研究院有限公司 Energy balance scheduling method, device and system for wireless sensor network and storage medium
CN109238296B (en) * 2018-08-16 2022-03-22 佛山科学技术学院 High-precision indoor navigation method and device
CN109361604A (en) * 2018-12-18 2019-02-19 北京格林威尔科技发展有限公司 The most short service path of Dominator and link determines method and apparatus in IPRAN or PTN
CN111865627B (en) * 2019-04-25 2023-07-25 ***通信集团河北有限公司 Transmission networking evaluation method, device, computing equipment and computer storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101001102A (en) * 2007-01-10 2007-07-18 北京航空航天大学 Route device and method for raising service quality of space information network
CN101621721A (en) * 2009-08-06 2010-01-06 中兴通讯股份有限公司 K-shortest path computing method and device
CN104468356A (en) * 2014-12-05 2015-03-25 苏州沃斯麦机电科技有限公司 Multi-destination-node message forwarding method
CN105141524A (en) * 2015-09-16 2015-12-09 武汉烽火技术服务有限公司 Topological graph optimal route algorithm with constraint conditions

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6377551B1 (en) * 1998-08-17 2002-04-23 Nortel Networks Limited QoS based route determination method for communications networks
US6542469B1 (en) * 1998-12-10 2003-04-01 Sprint Communications Company, L.P. Communications network system and method for routing based on disjoint pairs of path
US6996065B2 (en) * 2000-07-06 2006-02-07 Lucent Technologies Inc. Dynamic backup routing of network tunnel paths for local restoration in a packet network
CN100387026C (en) * 2004-12-24 2008-05-07 华为技术有限公司 Method for searching connected routes with target node set of pointed service routes
CN101459468B (en) * 2007-12-10 2012-06-06 华为技术有限公司 Optical layer wavelength end-to-end scheduling method and apparatus
CN101888572B (en) * 2009-05-11 2014-08-13 中兴通讯股份有限公司 Realization method and system of alternative route of WSON optical transport network
CN101788999A (en) * 2009-12-30 2010-07-28 安徽大学 Binary chop tracking method of shortest paths in network map
CN103051533B (en) * 2011-10-11 2017-09-12 中兴通讯股份有限公司 A kind of band protects the route computing method and device of business
US9083484B2 (en) * 2012-02-13 2015-07-14 Ciena Corporation Software defined networking photonic routing systems and methods
CN103248571A (en) * 2013-05-16 2013-08-14 湖北邮电规划设计有限公司 Computing method of optimal second route

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101001102A (en) * 2007-01-10 2007-07-18 北京航空航天大学 Route device and method for raising service quality of space information network
CN101621721A (en) * 2009-08-06 2010-01-06 中兴通讯股份有限公司 K-shortest path computing method and device
CN104468356A (en) * 2014-12-05 2015-03-25 苏州沃斯麦机电科技有限公司 Multi-destination-node message forwarding method
CN105141524A (en) * 2015-09-16 2015-12-09 武汉烽火技术服务有限公司 Topological graph optimal route algorithm with constraint conditions

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
QIAN, JIN ET AL.: "Breadth First Relax Algorithm for Multi-Constrained Optimal Pat", APPLICATION RESEARCH OF COMPUTERS, 31 January 2007 (2007-01-31), pages 90 - 93 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111787436A (en) * 2020-07-02 2020-10-16 中国电子科技集团公司第三十四研究所 Method for automatic searching and planning of optical network communication path
CN112115567A (en) * 2020-08-01 2020-12-22 富盛科技股份有限公司 Optical fiber minimum consumption path planning method
CN112115567B (en) * 2020-08-01 2024-04-16 富盛科技股份有限公司 Optical fiber minimum consumption path planning method
CN112511230A (en) * 2020-11-20 2021-03-16 国网浙江省电力有限公司宁波供电公司 Optimal optical fiber path selection method and device
CN113297822A (en) * 2021-04-26 2021-08-24 阳光新能源开发有限公司 Photovoltaic power station current collection circuit determination method and device and storage medium
CN114928569A (en) * 2022-04-28 2022-08-19 烽火通信科技股份有限公司 Method and system for realizing shortest path containing multiple must-pass resources
CN114928569B (en) * 2022-04-28 2023-06-09 烽火通信科技股份有限公司 Shortest path implementation method and system containing multiple necessary resources
CN115242702A (en) * 2022-09-22 2022-10-25 广州优刻谷科技有限公司 Internet of things node optimal path planning method and system
CN115242702B (en) * 2022-09-22 2022-12-13 广州优刻谷科技有限公司 Internet of things node optimal path planning method and system

Also Published As

Publication number Publication date
CN105141524B (en) 2018-06-01
CN105141524A (en) 2015-12-09
MY194954A (en) 2022-12-28
PH12018500275A1 (en) 2018-08-13

Similar Documents

Publication Publication Date Title
WO2017045578A1 (en) Topological graph optimal path algorithm with constraint conditions
JP2505064B2 (en) Route selection method
US10404576B2 (en) Constrained shortest path determination in a network
KR101347603B1 (en) Method for orinin based traffic assign model using shortest path
US20090316583A1 (en) Method and apparatus for calculating mpls traffic engineering paths
CN108183856B (en) Route establishing method and device
US20090228604A1 (en) Apparatus and method for calculating communication paths
WO2016086709A1 (en) Method and device for implementing capacity planning
CN107517155A (en) A kind of software defined network, node, path calculation method and device
CN103532861B (en) In territory based on spanning tree, Dynamic Multi-Pathing generates method
CN114417572A (en) Optical cable route planning method and device, terminal equipment and storage medium
CN102904753A (en) Method and system for rapidly establishing network topology
JP5140161B2 (en) COMPUTER DEVICE, ROUTE CALCULATION METHOD, AND PROGRAM
US7152113B2 (en) Efficient system and method of node and link insertion for deadlock-free routing on arbitrary topologies
CN110971521B (en) Routing path calculation method, system, device and computer readable storage medium
CN112637061B (en) Dynamic multi-factor path calculation method based on heuristic algorithm
CN113987995A (en) Wiring scheme determination method and device, electronic equipment and storage medium
CN105453494B (en) Virtual shortest path tree is established and the method and path-calculating element of processing
CN104202247B (en) Software defined network multiple constraint method for routing based on non-linear annealing
CN101986625B (en) Path calculation method and device
CN111800339A (en) Route optimization method with path number constraint in hybrid SDN scene
CN108667659B (en) Method and system for searching loop node in network topological graph
CN100518382C (en) Shortest path searching method and device under multi-restraint conditions in automatic switching optical network
US8649295B2 (en) Course searching method and node device
Ali et al. Multi-constrained QoS multicast routing optimization

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16845692

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 12018500275

Country of ref document: PH

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16845692

Country of ref document: EP

Kind code of ref document: A1