1. Field of the Invention
This invention is related to a network path finding apparatus, method and program, in particular, a network path finding apparatus, method and program based on a new data configuration for representing networks and is furthermore related to a method for making the new data configuration that represents network.
2. Description of Related Art
Physical networks such as road networks, telecommunications networks, and piping networks are being represented by logical networks on computers and optimal paths are being sought for and transportation costs are being computed. An apparatus for reproducing map information that applies art related to networks is disclosed in Patent Reference 1 below.
As depicted in table 1 and table 2 of patent reference 1, a logical network (hereinbelow simply called a network) of conventional type can be seen to be defined respectively by the nodes and the links connecting those nodes as network elements. Then networks are represented by data related to the attributes of the nodes and the links and, based on that network representation, path finds and other such processes are done.
Referencing
The intersection table 111 relates nodes, which are the intersections, with links, which are the roads that connect the intersections; and the links linked to a node in node. ID 112 are stored in link ID 114. The example in the drawing shows that link ID L1 is associated with node ID N1 and link IDs L1, L2, and L3 are associated with node ID N2. In the same way, below that, L2, L4, and L5 are stored for N3; L3, L4, L6, and L7 are stored for N4; L5, L6, and L7 are stored for N5; and L7 and L8 are stored for N6. Also, it is clear that what is kept in memory is the parts from the line with N1 to the line with N6. The same applies to the other tables described below.
Link table 121 shows the relationship between a link and the nodes on both sides of the link, and for the links in link ID 122, the node ID of the node on one side 123 and node ID of a node on the other side 124 holds the node IDs of the nodes linked to those links. In the example in the drawing, for link ID L1, node ID N1 and node ID N2 are stored in the column for the node ID on one side 123 and the column for the node ID on the other side 124, and node ID N2 and node ID N3 are stored in the corresponding entries for link ID L2. Below them, in the same way, N2 and N4 are stored for L3, N3 and N4 are stored for L4, N3 and N5 are stored for L5, N4 and N5 are stored for L6, N4 and N6 are stored for L7, and N5 and N6 are stored for L8.
Node table 131 consists of the entries for node ID 132 and node information 133, and it holds node information such as information on the node position and so forth for each node for the nodes with node IDs N1 to N6. Concrete examples of node information are omitted.
Patent Document: JP 1995-146155 A
In the conventional representation of networks, both nodes and links are taken as network configurational elements and a plurality of tables are prepared and because it becomes necessary to reference successively this plurality of tables when a path finding is performed, this representation has the disadvantage of having a high processing cost when a path finding is performed.
Thus this invention intends to solve this problem by providing a data configuration that represents networks and presents a small processing load during path finds and by providing a path finding method using that data configuration.
In accordance with this invention, a link destination table is provided as a data configuration representing a network that, for the link ID of each link in the network, contains the node ID of a node on one side of the link (hereinafter, this may be called the A-side node), the A-side destination link IDs, which are the link IDs of other links connected to that A-side node, the node ID of the node on the other side of the link (hereinafter, this may be called the B-side node), and the B-side destination link IDs, which are the link IDs of other links connected to that B-side node.
The link destination table also the cost from the A-side node to the B-side node and the cost from the B-side node to the A-side node, in other words, has linkage costs. Also, in accordance with a preferred embodiment of this invention, the link destination table can contain, for each link, the cost of connecting to the links with the link IDs stored in the destination link IDs for the A-side and B-side nodes. By traversing the links stored in the link destination table and their destination links, paths are sought for from an origin point to a destination point, and the cost of each path is computed, and an optimal path finding is performed.
In other words, when the node on the origin point side is made to be the A-side node, the path finding starts from the link related to the node on the origin point side, and a branch is made to the links in the destination link IDs for the B-side node stored in the line with that link ID in the link destination table and furthermore the branch process of branching to the links in the destination link IDs for the B-side node stored the line with that branched link ID is repeated while computing the costs until the B-side node is the destination point node. Then, of the paths from the origin point to the destination point, the optimal path is made'the find results and is output.
In accordance with the data configuration for representing networks in this invention, the processing cost can be made small because path finds can be done by merely using the link destination table and referencing only link IDs in path branching.
Hereinbelow a best mode for embodying this invention is described referencing drawings.
Path finding processing and the processing to generate a data configuration representing a network are implemented with the network path finding apparatus of the present invention by a data processing apparatus 301 having at least a central processing unit 302 and a cache memory 303, and a data storage apparatus 308. The data storage device 308, which has a link connection table 309, can be implemented by a main memory 305 or an external storage device 306, or alternatively, by using a remotely disposed apparatus connected via communication device 307.
Each function block in the data configuration reading means 201 and so forth described referencing
In the example shown in
Also, although it is not particularly illustrated, a temporary memory area can of course be used to enable various values obtained during processing to be used in subsequent processing. In the descriptions below, the values set or stored in a temporary memory area may be called by the name of that temporary memory area.
The values in each column are those corresponding to the values illustrated in the network configuration shown in
For L2 in link ID 232, N2 is stored in the node ID 234 for a node on one side, L1 and L3 are stored in destination link IDs 235 for a node on one side, N3 is stored in the node ID 237 for the node on the other side, and L4 and L5 are stored in destination link IDs 238 for the node on the other side.
Hereinbelow, in the same way, for each of L3, L4, L5, L6, L7, and L8 in link ID 232 respectively, the node ID 234 for a node on one side contains N2, N3, N3, N4, N4, and N5, the destination link IDs 235 for a node on one side contains L1 and L2, L2 and L5, L2 and L4, L3 and L4 and L7, L3 and L4 and L6, and L5 and L6, the node ID 237 for a node on the other side contains N4, N4, N5, N5, N6, and N6, and the destination link IDs 238 for a node on the other side contains L4 and L6 and L7, L3 and L6 and L7, L6 and L8, L5 and L8, L8, and L7.
The data configuration 200, in one preferred embodiment of this invention, is the row whose link ID 232 is L2 in link connection table 309a shown in
As shown by arrow 404, the line whose node ID 123 for a node on one side in conventional data configuration 100 contains N2 is extracted from the intersection table 111, and the N2 in node ID 112a, as shown by the dotted-line arrow (B), and, of the link IDs 114a, L1 and L3, which are not the same as the link in link ID 122, as shown by the dotted-line arrow (D), are respectively set in the node ID 234 for a node on one side and in the destination link IDs 235 for a node on one side, in the data configuration 200 of one preferred embodiment of this invention.
In the same way, as shown by the arrow 405, the line whose node ID 124 for a node on the other side in conventional data configuration 100 contains N3 is extracted from the intersection table 111, and the N3 in node ID 112b, as shown by the dotted-line arrow (C), and, of the link IDs 114b, L4 and L5, which are not the same as the link in link ID 122, as shown by the dotted-line arrow (E), are respectively set in the node ID 237 for a node on the other side and in the destination link IDs 238 for the node on the other side, in the data configuration 200 of one preferred embodiment of this invention.
First, at step S501, the link destination table start position is set in the link destination table write position. In the example shown in
Next, at step S502, the link table start position is set in the link table read-out position. In the example shown in
Next, proceeding to step S503, the link ID is extracted from the link table entry pointed to by the link table read-out position and is set in link ID, which is a temporary memory area (called A in the description for
Next, proceeding to step S504, the node ID on one side is read out from the link table entry pointed to by the link table read-out position and is set in the node ID on one side, which is a temporary memory area (called B in the description for
Next, proceeding to step S505, the node ID of the other node is read out from the link table entry pointed to by the link table read-out position and is set in node ID on the other side, which is a temporary memory area (called C in the description for
Next, proceeding to step S506, the link IDs other than A are read out from the intersection table entry pointed to by B and are set in the link IDs connected to a node on one side, which is a temporary memory area (called D in the description for
Next, proceeding to step S507, the link IDs other than A are read out from the intersection table entry pointed to by C and are set in the link IDs connected to a node on the other side, which is a temporary memory area (called E in the description for
Next, in step S508, for the link destination table entry pointed to by the link destination table write position, A is set in the link ID, B is set in the node ID on one side, C is set in the node ID on the other side, D is set in the destination link IDs for the node on one side, and E is set in the destination link IDs for the node on the other side, respectively. In the example shown in
Next, in step S509, a determination is made whether link table read-out position is the last position in the link table. If it is not the last position, at step S510, the next write position is set in the link destination table write position, and at step S511, the next read-out position is set in the link table read-out position, processing returns to step S503, and the processing of steps S503 to S509 is repeated.
Conversely, when the determination at step S509 is that the link table read-out position is the last position in the link table, processing is terminated because the link destination table has been completed. Of the processing flow noted above, steps S502 to S511 can be executed by the data configuration reading means 201 shown in
Although the data used to generate the link destination table can be deleted because the link destination table is generated in the above processing, in the path finding processing described next, for convenient search processing of the links connected to the path finding origin point, it is preferable to keep the intersection table.
Hereinbelow an example is described of cost setting in a network search in one preferred embodiment of this invention, referencing
As shown in
In one embodiment of this invention, in addition to this interval cost, the connection costs of the links to the A-side and to the B-side are defined. The description below of the preferred embodiment assumes the definition of connection costs. As shown in the drawing, the connection cost 236a from the link whose link ID 232 is L2 to the destination link whose destination link ID 235a for the node on one side is L1, and the connection cost 236b to the destination link whose destination link ID 235b for the node on one side is L3 is defined on the A-side. In the same way, the connection cost 239a to the destination link whose destination link ID 238a for the node on the other side is L4, and the connection cost 239b to the destination link whose destination link ID 238b for the node on the other side is L5 is defined on the B-side.
Also, the connection cost 236a to link 235a, the connection cost 236b to link 235b, and the connection cost 236c to link 235c are set as the destination link information for the A-side node. In the same way, the connection cost 239a to link 238a, the connection cost 239b to link 238b, and the connection cost 239c to link 238c are set as the destination link information for the B-side node.
However, because N1, which is the A-side node of link L1, is a destination point on one side of the connections in the network, nothing is set in the destination link IDs 235 of the node on one side for link L1 in the link destination table 309a shown in
As for link L2, 2 is set in the connection cost to link L1, and 1 is set in the connection cost to link L3 as the destination link information for its A-side nodes; and 1 is set in the connection cost to link L4, and 1 is set in the connection cost to link L5 as the destination link information for its B-side nodes.
As for link L3, 3 is set in the connection cost to link L1, and 2 is set in the connection cost to link L2 as the destination link information for its A-side nodes; and 2 is set in the connection cost to link L4, 2 is set in the connection cost to link L6, and 2 is set in the connection cost to link L7 as the destination link information for its B-side nodes.
As for link L4, 1 is set in the connection cost to link L2, and 1 is set in the connection cost to link L5 as the destination link information for its A-side nodes; and 2 is set in the connection cost to link L3, 3 is set in the connection cost to link L6, and 3 is set in the connection cost to link L7 as the destination link information for its B-side nodes.
As for link L5, 2 is set in the connection cost to link L2, and 2 is set in the connection cost to link L4 as the destination link information for its A-side nodes; and 1 is set in the connection cost to link L6, and 2 is set in the connection cost to link L8 as the destination link information for its B-side nodes.
As for link L6, 2 is set in the connection cost to link L3, 3 is set in the connection cost to link L4, and 2 is set in the connection cost to link L7 as the destination link information for its A-side nodes; and 2 is set in the connection cost to link L5, and 3 is set in the connection cost to link L8 as the destination link information for its B-side nodes.
As for link L7, 3 is set in the connection cost to link L3, 4 is set in the connection cost to link L4, and 1 is set in the connection cost to link L6 as the destination link information for its A-side nodes; and 1 is set in the connection cost to link L8 as the destination link information for its B-side nodes.
As for link L8, 2 is set in the connection cost to link L5, and 2 is set in the connection cost to link L6 as the destination link information for its A-side nodes; and 2 is set in the connection cost to link L7 as the destination link information for its B-side nodes.
As was noted above, by enabling costs to be separated into interval costs and connection costs, an actual, more detailed physical network can be simulated.
For example if a road network is being modeled, conditions relatively unique to roads themselves such as road lane width or speed restrictions can be reflected in the interval cost and traffic conditions between two roads such as right-turn interdiction or the existence of right-turn signals and so forth can be reflected in the connection cost, and so forth.
Hereinbelow the concept of a network path finding in one preferred embodiment of this invention is described, referencing
Because the paths from the origin point node to the destination point node can be expressed as the string of links connecting those two nodes, path expansion can be expressed in a tree form with the first link, L1, as its root and its destination links as lower level nodes. When this tree is made into a path expansion tree,
As shown in
Next, 1 is read out as the connection cost 239a to link L2 from the start of the B-side node destination link information in the link destination table 309b entry pointed to by the link ID L1, and a path expansion branch with connection cost L2 (1) appended is generated, as shown by the solid-line arrow. Then N2 is read out as the A-side node ID 234 from the link destination table 309b entry pointed to by link. ID L2 and 2 is read out as the cost to the B-side 234a, and furthermore N3 is read out as B-side node ID 237, (1, 4) is computed as the path cost 242b to N3, and the path expansion node corresponding to link L2 is generated. Here, the accumulated cost 4 is that wherein the connection cost 1 from link L1 to link L2 and the interval cost 2 for link 2 are added to the accumulated cost 1 for node N2.
Also, in the same way, 1 is read out as the connection cost 239b to link L3 from the B-side node next destination link information in the link destination table 309b entry pointed to by link ID L1, and 3 is extracted from the link destination table 309b entry pointed to by link ID L3 as the cost 234a to the B-side, and N4 is read out as the node ID 237 of the B-side node, and (1, 5) is computed as the path cost 242c to N4.
In the path on the link L2 side, 1 is read out as the connection cost 239a to link L4 from the B-side node destination link information in the link destination table 309b entry pointed to by the link ID L2, and 1 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by the link ID L4, and N4 is read out as the node ID 237 of the B-side node, and (2, 6) is computed as the path cost 242d to N4.
Also, in the same way, in the path on the link L2 side, 1 is read out as the connection cost 239b to link L5 from the B-side node destination link information in the link destination table 309b entry pointed to by link ID L2, and 2 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by link ID L5, and N5 is read out as the node ID 237 of the B-side node, and (2, 7) is computed as the path cost 242e to N5.
Also, in the path on the link L3 side, 2 is read out as the connection cost 239a to link L4 from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L3, and 1 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by link ID L4, and N4 is read out as the node ID 237 of the B-side node.
Regarding this connection to link L4, because the node ID set in B-side node ID 237 for the link destination table 309b entry pointed to by link ID L4 is N4 and the path returns again to the B-side node N4 for connection source link L3 and thus it is clear that this path is an unnecessary path for computing the minimum path, so at this point path expansion is aborted, as shown by the dotted-line arrow 244a that indicates no further path expansion. Also, because either the A-side node or the B-side node of the destination link coincides with the B-side node of the link that is the source of the connection and the A-side node and the B-side node in the same link cannot match, the determination to abort path expansion can be made when the A-side node of the destination link does not coincide with the B-side node of the link that is the source of the connection.
In the same way, in the paths on the link L3 side, 2 is read out as the connection cost 239b to link L6 from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L3, and 2 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by link ID L6, and N5 is readout as the node ID 237 of the B-side node, and [2, 9] is computed as the path cost 242f to N5.
Also, in the same way, in the paths on the link L3 side, 2 is read out as the connection cost 239c to link L7 from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L3, and 3 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by link ID L7, and N6 is readout as the node ID 237 of the B-side node, and (2, 10) is computed as the path cost 242g to N6. As shown in the drawing, node N6 is the destination point 247g based on the path links L1, L3, and L7.
Also, in the link L2-L4 paths, 2 is read out as the connection cost 239a to link L3 from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L4, and 3 is read out as the cost 234a to the B-side from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L3, and N4 is readout as the node ID 237 of the B-side node. Thus, because the path returns to the B-side node N4 of link L4, the computation of the path cost is not made and the expansion of the path is aborted.
In the same way, in the link L2-L4 paths, 3 is read out as the connection cost 239b to link L6 from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L4, and 2 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by link ID L6, and N5 is readout as the node ID 237 of the B-side node, and (3, 11) is computed as the path cost 242h to N5.
Also, in the same way, in the link L2-L4 paths, 3 is read out as the connection cost 239c to link L7 from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L4, and 3 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by link ID L7, and N6 is readout as the node ID 237 of the B-side node, and (3, 12) is computed as the path cost 242i to N6.
As shown in the drawing, node N6 is the destination point 247i based on the path links L1, L2, L4, and L7.
Also, in the link L2-L5 paths, 1 is read out as the connection cost 239a to link L6 from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L5, and 2 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by link ID L6, and N5 is readout as the node ID 237 of the B-side node. Thus because the path returns to the B-side node N5 of link L5, the computation of the path cost is not made and the expansion of the path is aborted.
In the same way, in the link L2-L5 paths, 2 is read out as the connection cost 239b to link L8 from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L4, and 1 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by link ID L8, and N6 is readout as the node ID 237 of the B-side node, and (3, 10) is computed as the path cost 242j to N6. As shown in the drawing, node N6 is the destination point 247j based on the path links L1, L2, L5, and L8.
Also, in the link L3-L6 paths, 2 is read out as the connection cost 239a to link L5 from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L6, and 2 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by link ID L5, and N5 is readout as the node ID 237 of the B-side node. Thus because the path returns to the B-side node N5 of link L6, the computation of the path cost is not made and the expansion of the path is aborted.
In the same way, in the link L3-L6 paths, 3 is read out as the connection cost 239b to link L8 from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L8, and 1 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by link ID L8, and N6 is readout as the node ID 237 of the B-side node, and (3, 13) is computed as the path cost 242k to N6. As shown in the drawing, node N6 is the destination point 247k based on the path links L1, L3, L6, and L8.
Also, in the link L2-L4-L6 paths, 2 is read out as the connection cost 239a to link L5 from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L6, and 2 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by link ID L5, and N5 is readout as the node ID 237 of the B-side node. Thus because the path returns to the B-side node N5 of link L6, the computation of the path cost is not made and the expansion of the path is aborted.
In the same way, in the link L2-L4-L6 paths, 3 is read out as the connection cost 239b to link L8 from the node destination link information for the B-side in the link destination table 309b entry pointed to by link ID L6, and 1 is extracted as the cost 234a to the B-side from the link destination table 309b entry pointed to by link ID L8, and N6 is readout as the node ID 237 of the B-side node, and (4, 15) is computed as the path cost 242m to N6. As shown in the drawing, node N6 is the destination point 247m based on the path links L1, L2, L4, L6, and L8.
By the above processing, all of the paths from node N1 to node N6 are expanded, and their number of connections, accumulated cost, and path list are stored in the path information table 281 shown in
Also, in the above description of path expansion, although the paths through the path expansion tree are described, layer by layer, from each of the higher level layers to the lower level layers, the path expansion tree can also be generated by giving priority to destination link information stored in link destination table 309b for B-side nodes with positions on the upper right side in the path expansion tree. The path information stored in the path information table shown in
Hereinbelow, the processing to search for an optimal network path in one preferred embodiment of this invention is described referencing
First, in step S801, the link destination table, the path finding origin point node ID, the origin point link ID, and the destination point node ID are set up. In the setup of the link destination table, its start address and size can be set, for example, by specifying the name of a link destination table from outside a system. Also, in the setting of the origin point link ID, the link ID of the link connected to the origin point node may even be set from the intersection table, as was noted above. In the concrete example, N1 is set in the origin point node ID, L1 is set in the origin point link ID, N6 is set in the destination point node ID, and link destination table 309b is set in the link destination table.
Next, in step S802, in the path information, the value “−1” is set in the number of connections and the value “0” is set in the accumulated cost, the start position is set in the write position for a path list, and at step S803, the origin point node ID is set in the next node ID.
Furthermore, at step S804, the origin point link ID is set in the destination link ID and the value “0” is set in the connection cost, and at step S804a, the read-out position of the link information is initialized and processing proceeds to step S805. In the concrete example, N1 is set in the next node ID and L1 is set in the destination link ID.
At step S805, a path finding is made based on the link destination table entry pointed to by destination link ID, and processing proceeds to step S806. Details of the processing in step S805 is described later referencing
At step S806, the optimal path is output from the search results obtained in step S805, and processing is terminated. Details of the processing in step S806 is described later referencing
Also, if there are a plurality of links connected to the origin point node, the above processing obtains optimal paths using each of those links as the origin point link, and it is clear to one skilled in the art that the optimal path can be obtained from among those paths.
As shown in the drawing, in step S810, path information and link information are pushed into a stack. Here, what is meant by path information is the number of connections, the accumulated cost, the path list, and their write position; and what is meant by link information is the next node ID, the destination link ID, the connection cost, the contents of the link destination table pointed to by the destination link ID, and the read-out position of the link information in the link destination table. In the first processing of step S810, the contents set in steps S801 to S804a shown in
Next, at step S811, the contents of the link destination table entry pointed to by the destination link ID are read out as a destination link information. In the initial processing of the concrete example, the contents of the line whose link ID 232 is L1, which line is the first in link destination table 309b are read out because L1, which is the origin point link ID, is set in the destination link ID in step S804 shown in
Next, in step S812, a determination is made whether the next node ID coincides with the A-side node ID of the link destination table entry read-out at step S811. If they coincide, processing proceeds to step S813 and if they do not coincide processing branches to step S821. In the initial processing of the concrete example, because the A-side node ID 234 is N1 and because N1, which is the origin point node ID set at step S803 shown in
At step S813, 1 is added to the connection number in the path information, and the connection cost and the cost to the node on the B-side in the link destination table read out at step S811 are added to the accumulated cost, and the next node ID and the destination link ID are written in the write position in the path list in the path information, and the write position is updated. The connection cost at this point is either that initially set at step S804 shown in
Next, proceeding to step S814, a determination is made whether the node ID on the B-side in the link destination table read-out at step S811 coincides with the destination point node ID and when the determination is that the B-side node ID does not coincide with the destination point node ID, processing branches to step S815. At step S815 a determination is made whether destination link information exists for the B-side node. The purpose of this determination is to enable a branch to step S821 described below when there is a dead-end link in the path because there is no destination link information for that B-side node and thus as was noted above the path cannot be expanded.
Conversely, when the determination at step S815 is that destination link information exists, processing proceeds to S816, wherein the node ID on the B-side is set in the next node ID, and in step S817 the start position of the destination link information for the B-side node in link destination table is set in the link information read-out position. The setting of this read-out position in the link information decides the direction priority for the path finding, and as was described for the path finding tree in the concrete example, paths are sought by prioritizing the [upper] right side of the tree.
Following step S817, at step S818, the destination link ID and the connection cost are extracted from the destination link information for the B-side node. In the initial processing of the concrete example, L2 and 1, stored therein as link 238a and cost 239a, are extracted from the destination link information of the B-side node and are set in the destination link ID and the destination cost, and processing returns to step S810.
The processing loop of the above steps S810 to S818 is repeated until the determination at step S812 is that the next node ID does not coincide with the A-side node ID (hereinbelow this may be called the pruning determination) or the determination at step S814 is that destination point node ID coincides with the B-side node ID (hereinbelow this may be called the destination point determination) or the determination at step S818 is that destination link information does not exist (hereinbelow this may be called a dead-end determination).
When the determination at step S814 is a destination point determination, processing proceeds to step S820 wherein the destination point node ID is written in the write position in the path list of the path information and path information is successively written in the path information table, and processing proceeds to step S821. Here, successively writing path information into the path information table means writing the path information up to a destination point node into the path information table while changing the table line successively for each destination point.
At step S821, path information and link information is popped from the stack and processing proceeds to step S822. In the processing loop of steps S810 to S818, the path information and link information is pushed into the stack at step S810. In other words, each time a path expansion node is generated for the path expansion tree the path information and link information for the generated path expansion node are pushed in the stack.
And in the above processing loop, the steps S811 and thereafter process a path expansion node lower than the path expansion node, whose path information and link information were pushed into the stack, and because the pruning determination, the destination point determination or the dead-end determination are also performed for the lower path expansion node, the path information and link information popped in the processing executed at step S821, reached by branching from the above noted processing loop, is related to the higher level path expansion node for the path expansion node for which pruning determination, destination point determination or dead-end determination was performed.
At step S822, a determination is made whether the stack is empty, and if it is empty, processing is terminated because path expansion has been completed, and if it is not empty, processing proceeds to step S823. In the example shown in
At step S823, a determination is made whether all the destination link information of the B-side node in the link destination table popped at step S821 is completely processed. If the information is completely processed, a return is made to step S821 and once more path information and link information for a path expansion node 1 level higher is popped from the stack. If the information is not completely processed, processing proceeds to step S824 and the next read-out position is set in the read-out position in the link information and proceeding to step S818, processing merges with the above noted processing loop.
By the above processing, all the paths are expanded from the origin point node to the destination point node and path information is generated up to the destination point node.
Also, although the above description took a node ID of an A-side node in the link destination table as the origin point node, it is clear that, if a node ID of a B-side node in the link destination table is taken as the origin point node, it is sufficient to replace the words “A-side” in the above description with “B-side” and to replace the words “B-side” in the above description with “A-side”.
Also, although path information and link information were described as being kept in a stack during path expansion, if the path information and link information during path expansion are stored in a format enabling identification of which level they are at, the keeping of path information and link information during path expansion is not restricted to a stack.
As shown in the drawing, at step S831, the maximum value (all 1's in the bit values) is set in the values for the minimum connection number and minimum accumulated cost. Also, at step S832, the start position for the path information table is set in the read-out position for the path information. Next, at step S833, the start position for the path information table is set in the read-out position for the optimal path information. In the example shown in
Next, proceeding to step S834, a determination is made whether the whole path information table has been processed. If it has been processed, in step S835, the connection number and accumulated cost are read out from the path information table entry pointed to by the read-out position for the path information. Next, at step S836, a magnitude comparison is made between the read-out accumulated cost and the minimum accumulated cost, and if the accumulated cost is smaller than the minimum accumulated cost a branch is made to step S837, wherein the accumulated cost read out at step S835 is set in the minimum accumulated cost. In the initial determination processing in step S836, because the maximum value has set in the minimum accumulated cost at step S831, a branch is made to step S837, and the accumulated cost for the start position in the path information table is set in the minimum accumulated cost, and processing proceeds to step S840.
Conversely, if the accumulated cost coincides with the minimum accumulated cost, processing proceeds from step S836 to step S838, wherein furthermore a determination is made whether the connection number is smaller than the minimum connection number. If the determination result in step S838 is “Yes”, at step S839, the connection number is set in the minimum connection number, and processing proceeds to step S840.
At step S840, the read-out position for the path information is set in the read-out position for the optimal path information, and processing proceeds to step S841.
If the determination result in step S838 is “No”, processing proceeds to step S841.
Also, at step S836, when a determination is made that the accumulated cost is larger than the minimum accumulated cost, processing proceeds to step S841.
At step S841, the read-out position for the path information is set in the next read-out position and a return is made to step S834.
At the above noted step S834, when the determination is made that the path information table has been completely processed, in step S842, the path information table entry pointed to by the read-out position for the optimal path information is read out and is output as the optimal path information and processing is terminated.
Although the foregoing is a detailed description of a preferred embodiment of the present invention, the embodiments of the present invention are not limited in this manner, and it will be clear to a person skilled in the art that a variety of modifications thereof are possible.
It is also clear that the network path finding apparatus of the present invention can be implemented on a computer by means of a program that executes on that computer the means for storing a link destination table and the processing shown in
Furthermore, it is clear that the data configuration generation method of this invention can be implemented by a program that a computer is caused to execute that generates the data configuration for a path finding shown in
Therefore, the above-noted programs, and a computer-readable storage medium into which the programs are stored are encompassed by the embodiments of the present invention.
Also, a computer-readable storage medium into which are stored the data configuration for a path finding in this invention and the data using that data configuration are encompassed by the embodiments of the present invention.
As was explained in the details above, when using a link destination table, which is a new data configuration provided by this invention, an efficient network path finding can be enabled.
Although this invention is not limited to such an application, it will have a major effect when it is applied to an optimal path finding in an appliance embedding a small computer like a car navigation appliance.
Number | Date | Country | Kind |
---|---|---|---|
2008-238539 | Sep 2008 | JP | national |
This application is a continuation of PCT/JP2009/003901 filed on Aug. 14, 2009, and is based on and claims the benefit of priority of the prior Japanese Patent Application No. 2008-238539, filed on Sep. 17, 2008, the entire contents of which are incorporated herein by reference. The contents of PCT/JP2009/003901 are incorporated herein by reference in their entity.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/JP2009/003901 | Aug 2009 | US |
Child | 13064304 | US |