0% found this document useful (0 votes)
9 views4 pages

Gu 2005

Uploaded by

kobojav957
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

Gu 2005

Uploaded by

kobojav957
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

IMPROVED VECTOR ROUTE ALGORITHM BASES ON RASTER

TOPOLOGICAL SPACE MODEL


Guomin GU Weihong WANG 2

1 College of Software, Zhejiang University of Technology, P.R.China, 310032


guguomingsohu.com
2College of Software, Zhejiang University of Technology, P.R.China, 310032
wwhgzjut.edu.cn

ABSTRACT Of all the current route analysis algorithms, the most


effective one is the Dijkstra algorithm, on which this
Net analysis is one of the most important space analysis paper is mainly based. This paper considers the
functions. Finding a route is the basic function of net optimization problem in terms of two aspects, the time
analysis in GIS, the kernel of which is to get the and the space, and proposes a more effective and widely
optimized route. This paper presents a topological space used shortest route algorithm. There are two steps in the
model, which saves all points in the vector-graph layer route: finding the infrastructure of space topology
based on a grid method and improves the classical structure; and applying an optimized route finding
Dijkstra algorithm bases on the raster topological space algorithm. The space topology structure plays a vitally
model. This improve efficiency in time of the route important role in the economization of the space, and
planning. At the same time, it decreases the memory directly influence the efficiency of the second step as
occupancy, so the new algorithm can be used on a small well. This paper states how to get a more effective
memory terminal. shortest route finding algorithm utilizing to the two
Keywords. optimum path analysis; raster; space aspects.
analysis, Dijkstra algorithm 1. THE BUILDING OF NET TOPOLOGY
BASED ON GRID ALGORITHM
0. INTRODUCTION
Space topology relation is an absolute definition of space
With the rapid development of computers information structure, and a vector structure with the topology
technology and Geography Information System (GIS), relation is just the topology structure. In general, when
GIS technology has been applied in scientific and the topology structure is decided, it is convenient to
industrial fields for its powerful functioning. The primary decide the space relation between the map entity and the
goal of the net analysis in GIS is to analyze the geographic entity. Considering the problem of automatic
geography and optimize the model of geographical net setting up of topology, the key point is how to improve
and city foundation establishment net. Net analysis is one the efficiency of the algorithm and the process.
of the most important space analysis functions. Route Each arc has two ends, called nodes. All nodes are
analysis is the basic function of net analysis in GIS, the disseminated before processing, so it is necessary to
kernel of which is to get the optimized route, not only the build the relation between node and node, and node and
minimum of route in geography but also minimizing the arc, by means of matching these nodes. Given N arcs and
amount of time and the cost. The main point of the above that is 2N nodes, it is easy to build the topology relation
is the algorithm of the shortest route. That is, getting a through two-two matching ,but the time complexity of
path between two or several points in a given model, this method is 2N*(2N-1),which can't be afforded by the
of which the block intensity is the lowest. process of quantity's of data. This paper employs the grid
With the rapid development of hardware, in shortest method to decrease the time complexity greatly.
route finding, the problem of space storage has no longer
been considered as the main factor, so that the ordinary 1.1. build the Space topology relation using grid
way is to sacrifice space for time. This could improve the
efficiency of the algorithm indeed. However, the The first step of griding method is to build the grid index
emergence of various terminals of new computers, such for the whole map and make each node be contained in
as terminals with little space capacity installed in cars, one grid.
makes it still important to take into account the space After building the grid index, the second step is to
efficiency of the algorithm. judge whether each grid contains a node or not. If there
is a node in this grid, then judge whether there is neighboring matrix as follows.
restricted difference node (a distance defined ) among V represents the set which includes all the nodes. Vn
this grid and its neighbor grid. If the restricted difference represents one node, <Vi,Vj> represents the arc from i to
node exists, that means the two nodes matched, and j, Cost[i,j] represents the weight of the arc <Vi,Vj>, if
merged the two nodes. there is no path from Vj to Vi, then Cost[i,j]=oo.
Then an auxiliary vectorial Dist is introduced, each
Dist[i] shows the minimum right value from the start
point to each terminal point Vi. Assuming the index of
the start point of a vectorial is m, and it's initial value is:
Dist[i] = Cost[m,i] Vi E V
Set S contains the ending points of every checked
route, R=V-S then
The first step: choose Vj, and make
Dist[j] = Min {Dist[i] Vi E RI Vi E V
Figure 1: Grid Index Vj is the ending point of the latest checked route.
Make
The index structure using in nodes match: S =S U {Vj}
struct FSRLineSEpt
CArray<CMapXPoint, CMapXPoint > A; //node
The second step: Modify the length of every route
coordinate
which from Vm to every Point of the R. if
CArray<int,int> LineIDA; Hrelated arc index of Dist[j]+Cost[j,k] < Dist[k]
node, if the node is start one, the index is The third step: Modify Dist[k], make
positive ,otherwise is negative Disk[k] = DistU] + Cost[j,k]
The second step and the third step will be repeated
3; N-I times. Thus we get all the shortest routes from Vm
to every point.
1.2. Building Space topology relationship and
optimization 2.2. Deficiency of the classical algorithm
Because in net analysis we just care about the
relationship of the arc, two nodes and the weight, we Dijkstra algorithm is a classical algorithm of route
employ the store structure described in table 1 to analysis in the GIS, but it is insufficient in following
decrease the storage space. aspects:
(I)By applying classical Dijkstra algorithm, we need
to compare and revise all the joints of R each time we
Table 1: Sides storage model check a node, which will waste a large amount of time. If
Side Start End weight that method is applied to deal with such large amounts of
ID node ID node ID data in GIS, the waiting time is beyond endurance;
1 VI VO 8 (2) All the joints need to be checked.
2 VO V5 2 (3) The space store way of neighboring matrix will
3 V5 V6 7 waste a large amount of space when looking for a route,
4 V3 V4 6 because it should write down the information of all
5 V2 V3 5 joints.
It can be described in advance language as follows: 3. IMPROVEMENT AND OPTIMIZATION
struct FSRTopologicalEdge{ OF THE ALGORITHM
int EdgeID; HSide ID
int StartID; HStart Node ID 3.1. Improvement of the algorithm
int StopID; HEnd Node ID
double Weight; }; HSide weight A model has been set up in the previous section which
could reduce a large number of memory space by storing
2. DIJKSTRA ALGORITHM USED IN side information. In order to further raise the inquiry
ROUTE PLANNING speed, we store node information instead of side
information, and write down the information of the
2.1. Description of the classical Dijkstra algorithm related side of each node at the same time. It's described
The Dijkstra algorithm can be used to get the optimum as following advanced language. As we use the suffix of
route according to weight. The algorithm can apply to the array to represent the serial number of the nodes, we
compute the optimum route from one node to another in needn't check all the nodes each time, and can find the
a direct chart. We described the algorithm using the exact node directly.
struct FSRTopologicalPoint{ from R, make Dist[Vk ] = min{ Dist[Vk ],
CArray<int,int> EdgeID; Vk+Cost(Vj ,Vk )}. Put it into M. Turn to the first step.
int falg; H Use in the second-time optimization,
which shows whether this joint is valid Because of two aspects as follows the algorithm can
3; improve the searching efficiency of the route finding and
As the relation of the point and it's neighbour side reduce the space consumption:
has been built, we just need to revise the weight value of (1) The computation can terminate when we get the
a few points, which greatly improved the efficiency of shortest route in the procedure of compute. And there is
the algorithm. no need to continue dealing with the joints which have
not been dealt with. So the efficiency is improved. The
principal is: when the ending joint and other joints are
put into the M at the same time, and fortunately the
ending joint is moved to C because of the Dist[ending
joint] is the smallest, then we know we have got the
shortest route.
(2) We just store the route index and its length of the
current joint and its related joints, thus reduce the use of
the space to as little as possible.
3.2. The Searching area optimization
As we can deduce from the algorithm above, most route
finding is manipulated in a relatively small zone. It is
unnecessary to load all nodes information to memory. We
Figure 2 description of the improvement of the algorithm can just check the points whose related arc is included or
partly included in a rectangle drawn on the map. It can
The algorithm can be described briefly as: (S improve the efficiency greatly in most conditions.
represents all the points that have already been dealt with; However, sometimes it is not helpful. So we need to
C E S, C includes the only point that is being dealt with; expand the rectangle to contain more points, and to find a
R represent all points that have not been dealt with ; M E shortest route again. The range of expanding the
R, the point in M links with the point in C. ) rectangle each time should not be too small, otherwise it
Figure 2 can simply describe this improved Dijkstra will increase the time of route finding and decrease
algorithm: Let's use the points from R to S, through efficiency.
R4M4C4S, we can find the optimum route finally.
We have already got the net topological structure of 4. EXPERIMENTAL RESULTS
joining several sides of each joint in the front. The step
of the algorithm is as follows: The algorithm is tested on the machine of P4 1.3 memory
1. All points have not been dealt with (put in R); 256M. It utilized the road layer(side of 6045 pieces) on
2. Put the start point into in C as the point that is Hangzhou city map. We copy all the road features and
being dealt with, while at the same time putting the add them to the same layer several times, and got a layer
neighbour points of the start point into M, as the point to of 12090 sides and a layer of 18135 sides. We choose the
be dealt with; same route in these layers in the test and compare the
3. Put the start point into S after it has been dealt processing time. The longest routes are chosen, as shown
with. in the following figure
4. Move the point which has the smallest weight We can conclude from the Table 2 to find a route of
value in M to C, as the dealing with point. And move the 2000 sides needs less than 5OOms, which is a very ideal
related points from R to M inquiry velocity and could meet the need of practical
5. Repeat the 4th step until finding a shortest route. inquiry.
To each checking joint, we need to store the current
Mathematical desscription of the algorithm: (The joint ID symbol(short type) and the route length (double
symbol definition could refer to the description of the type ) from starting joint to the current joint. And we
classical algorithm in chapter 1.2 ) should store the information of the current joint and its
The 0th step: Put start point Vs into M. {Dist[Vr] related joints at one time.Take the 2000 sides for
+oo, Vr ER} example, if there are 200 related sides and 10 related
The first step: Choose Vj from M make Dist ]
,
points, the memory we need is (2byte*200+8byte)*20_
=min {Dist[m] ME M If Vj = Terminal point, it is
}.
8k. In real test procedure, the necessary space is smaller
over. than 50k in the layer of 2000 sides.
The second step: Choose some Vk that links with Vj
Table 2: results of test modeling . Journal of Heilongjiang Institute of
Technology 2004.3 p22-24
Side ID 6045 sides 12090sides 18135 [4] Wangping. Setting-up and upgrading of the
topological relation in GIS. PLA Information
sides Engineering University,[ Master's thesis]2002
1->900 203 ms 281 ms 360 ms [5] Zhang fuhao, Liu jiping, Li qingyuan. A shortest
1->300 172 ms 250 ms 344 ms route algorithm base on Dijkstra Remote sensing
information 2004.2 P38-41
1->4000 187 ms 265 ms 359 ms [6] Sun qiang, Shen jianhua, Gu junzhong. An improved
1->200 219 ms 312 ms 390 ms algorithm of Dijkstra. Computer Engineering and
Applications, 2002,38(3) P99-101
1->400 204 ms 313 ms 407 ms [7] Jan Husdal. "Fastest path problems in dynamic
1->500 199 ms 281 ms 390 ms transportation networks". Part of coursework for the
M.Sc.in GIS. University of Leicester,UK. 1999-2000.
http://www.husdal.com/mscgis/research.htm

Figure 3: location of test sides

5. CONCLUSION
This paper put forward an algorithm of vector route
planning based on a raster method. This algorithm is
based on a space topological of raster , and it is
improved by using the characteristic of the adjoint joint.
Ideal efficiency is achieved in reducing the running time,
and great progress is also made on space efficiency. In
this way, route finding, which needs to deal with
magnanimity data, can be applied to light terminal
products.

Acknowledgements
This research was supported by the National Nature
Science Foundation of China under Grant No. 60473024.

REFERENCES
[1] Wu xincai. Principle and method of Geographical
Information System[M]. Beijing Electronic Industry
Press, 2002.
[2] Leyang, Gong jianya. Algorithm of Dijkstra the
shortest route is realized high-efficiently. Journal of
Wuhan University of Survey and drawing 1999,24(3)
p209-212
[3] Gaowei Zhangjianbo the analysis and realization of
the optimum route algorithm base on grid data

You might also like