THE APPLICATION OF ARTICLE k-th SHORTEST TIME PATH ALGORITHM

Similar documents
Generalized Edge Coloring for Channel Assignment in Wireless Networks

2-connected graphs with small 2-connected dominating sets

Particle Swarm Optimization Based on Smoothing Approach for Solving a Class of Bi-Level Multiobjective Programming Problem

Study of Network Optimization Method Based on ACL

arxiv: v2 [math.co] 5 Jun 2018

SURVIVABLE IP OVER WDM: GUARANTEEEING MINIMUM NETWORK BANDWIDTH

Generalized Edge Coloring for Channel Assignment in Wireless Networks

Classifying Facial Expression with Radial Basis Function Networks, using Gradient Descent and K-means

BIJECTIONS FOR PLANAR MAPS WITH BOUNDARIES

Loop Scheduling and Partitions for Hiding Memory Latencies

Image Segmentation using K-means clustering and Thresholding

Image compression predicated on recurrent iterated function systems

Computer Organization

A Neural Network Model Based on Graph Matching and Annealing :Application to Hand-Written Digits Recognition

A shortest path algorithm in multimodal networks: a case study with time varying costs

Comparison of Methods for Increasing the Performance of a DUA Computation

Fast Fractal Image Compression using PSO Based Optimization Techniques

The Reconstruction of Graphs. Dhananjay P. Mehendale Sir Parashurambhau College, Tilak Road, Pune , India. Abstract

Coupling the User Interfaces of a Multiuser Program

Lecture 1 September 4, 2013

Calculation on diffraction aperture of cube corner retroreflector

Random Clustering for Multiple Sampling Units to Speed Up Run-time Sample Generation

Kinematic Analysis of a Family of 3R Manipulators

A New Search Algorithm for Solving Symmetric Traveling Salesman Problem Based on Gravity

Disjoint Multipath Routing in Dual Homing Networks using Colored Trees

Physics INTERFERENCE OF LIGHT

An Adaptive Routing Algorithm for Communication Networks using Back Pressure Technique

6.854J / J Advanced Algorithms Fall 2008

Software Reliability Modeling and Cost Estimation Incorporating Testing-Effort and Efficiency

Online Appendix to: Generalizing Database Forensics

5th International Conference on Advanced Design and Manufacturing Engineering (ICADME 2015)

APPROXIMATION DISTANCE CALCULATION ON CONCEPT LATTICE

Skyline Community Search in Multi-valued Networks

Multilevel Linear Dimensionality Reduction using Hypergraphs for Data Analysis

Animated Surface Pasting

Data Mining: Clustering

Queueing Model and Optimization of Packet Dropping in Real-Time Wireless Sensor Networks

Design of Policy-Aware Differentially Private Algorithms

Distributed Line Graphs: A Universal Technique for Designing DHTs Based on Arbitrary Regular Graphs

Yet Another Parallel Hypothesis Search for Inverse Entailment Hiroyuki Nishiyama and Hayato Ohwada Faculty of Sci. and Tech. Tokyo University of Scien

Uninformed search methods

Socially-optimal ISP-aware P2P Content Distribution via a Primal-Dual Approach

Throughput Characterization of Node-based Scheduling in Multihop Wireless Networks: A Novel Application of the Gallai-Edmonds Structure Theorem

An Algorithm for Building an Enterprise Network Topology Using Widespread Data Sources

Classical Mechanics Examples (Lagrange Multipliers)

Non-homogeneous Generalization in Privacy Preserving Data Publishing

d 3 d 4 d d d d d d d d d d d 1 d d d d d d

Solution Representation for Job Shop Scheduling Problems in Ant Colony Optimisation

Estimating Velocity Fields on a Freeway from Low Resolution Video

Reformulation and Solution Algorithms for Absolute and Percentile Robust Shortest Path Problems

Algorithm for Intermodal Optimal Multidestination Tour with Dynamic Travel Times

Intensive Hypercube Communication: Prearranged Communication in Link-Bound Machines 1 2

10. WAVE OPTICS ONE MARK QUESTIONS

filtering LETTER An Improved Neighbor Selection Algorithm in Collaborative Taek-Hun KIM a), Student Member and Sung-Bong YANG b), Nonmember

Reconstructing the Nonlinear Filter Function of LILI-128 Stream Cipher Based on Complexity

NEW METHOD FOR FINDING A REFERENCE POINT IN FINGERPRINT IMAGES WITH THE USE OF THE IPAN99 ALGORITHM 1. INTRODUCTION 2.

Multi-camera tracking algorithm study based on information fusion

A multiple wavelength unwrapping algorithm for digital fringe profilometry based on spatial shift estimation

A PSO Optimized Layered Approach for Parametric Clustering on Weather Dataset

Cluster Center Initialization Method for K-means Algorithm Over Data Sets with Two Clusters

Dual Arm Robot Research Report

A Classification of 3R Orthogonal Manipulators by the Topology of their Workspace

6 Gradient Descent. 6.1 Functions

Message Transport With The User Datagram Protocol

Transient analysis of wave propagation in 3D soil by using the scaled boundary finite element method

Additional Divide and Conquer Algorithms. Skipping from chapter 4: Quicksort Binary Search Binary Tree Traversal Matrix Multiplication

Tight Wavelet Frame Decomposition and Its Application in Image Processing

A Revised Simplex Search Procedure for Stochastic Simulation Response Surface Optimization

APPLYING GENETIC ALGORITHM IN QUERY IMPROVEMENT PROBLEM. Abdelmgeid A. Aly

Non-Uniform Sensor Deployment in Mobile Wireless Sensor Networks

On Effectively Determining the Downlink-to-uplink Sub-frame Width Ratio for Mobile WiMAX Networks Using Spline Extrapolation

Learning convex bodies is hard

Almost Disjunct Codes in Large Scale Multihop Wireless Network Media Access Control

Short-term prediction of photovoltaic power based on GWPA - BP neural network model

Adjusted Probabilistic Packet Marking for IP Traceback

MORA: a Movement-Based Routing Algorithm for Vehicle Ad Hoc Networks

Average D-distance Between Edges of a Graph

Figure 1: 2D arm. Figure 2: 2D arm with labelled angles

FINDING OPTICAL DISPERSION OF A PRISM WITH APPLICATION OF MINIMUM DEVIATION ANGLE MEASUREMENT METHOD

A new fuzzy visual servoing with application to robot manipulator

On the Role of Multiply Sectioned Bayesian Networks to Cooperative Multiagent Systems

A Block-Based Blind Source Separation Approach With Equilateral Triangular Microphone Array

Advanced method of NC programming for 5-axis machining

Bends, Jogs, And Wiggles for Railroad Tracks and Vehicle Guide Ways

Using Vector and Raster-Based Techniques in Categorical Map Generalization

On the Placement of Internet Taps in Wireless Neighborhood Networks

Learning Subproblem Complexities in Distributed Branch and Bound

Research Article REALFLOW: Reliable Real-Time Flooding-Based Routing Protocol for Industrial Wireless Sensor Networks

Backpressure-based Packet-by-Packet Adaptive Routing in Communication Networks

Shift-map Image Registration

A Plane Tracker for AEC-automation Applications

Erdös-Gallai-type results for conflict-free connection of graphs

Depth Sizing of Surface Breaking Flaw on Its Open Side by Short Path of Diffraction Technique

Pairwise alignment using shortest path algorithms, Gunnar Klau, November 29, 2005, 11:

The Journal of Systems and Software

Petri Nets with Time and Cost (Tutorial)

Secure Network Coding for Distributed Secret Sharing with Low Communication Cost

NEWTON METHOD and HP-48G

PERFECT ONE-ERROR-CORRECTING CODES ON ITERATED COMPLETE GRAPHS: ENCODING AND DECODING FOR THE SF LABELING

Learning Polynomial Functions. by Feature Construction

Transcription:

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. THE APPLICATION OF ARTICLE k-th SHORTEST TIME PATH ALGORITHM Hua Mao an *Ming Shi Department of Mathematics an Information Science, Hebei University, Baoing 071002, China *Author for Corresponence ABSTRACT If a person wants to travel to a place by some kins of transportation, he (or she) will consier an optimal path, which costs a shortest time among all paths. However, when a situation is not expecte to happen, such as a heavy rain, the person will have to select the secon, the thir the k-th shortest path to continue his (or her) travel. In this paper, for searching the k-th path, we give an improve Floy algorithm by constructing the iterative matrix an orinal matrix for solving the shortest path in the irecte graph an unirecte graph. The k-th shortest path algorithm can not only calculate the shortest path weights more quickly, but also fin a shortest path more irectly. Our algorithm gives a more accurate time to juge a travel plan. We use our algorithm, the iteration spee, the amount of computation is reuce to a certain egree. Two examples are given to illustrate the superiority of our algorithm. Keywors: Directe Graph an Unirecte Graph, the Shortest Time Path, k-th Shortest Time Path Algorithm INTRODUCTION With the evelopment of society, people pay much more attention to the effective use of time. In orer to save the time on traveling by vehicles, it is necessary for a person to estimate the time spent on the roa an to choose the route that costs the least time (Yan an Liu, 2000). Generally, a plan has been given in avance, but weather isasters or other no expecte events always make the plan not run properly. Uner this case, how to choose the secon path, or the k-th path (k 2) that is a problem. Up to now, many algorithms have been provie for solving the shortest path, such as Dksta algorithm which propose by Dick Stella, a computer scientist from the Netherlans, in 1959. Classical Floy algorithm was propose by Floy in 1962. The reaers can refer to (Wang, 2009). In aition, many people have stuie k-th shortest path algorithm from ifferent angles. Eppstein (1999) gave an algorithm for choosing a path on the irecte graph which allowe the existence of rings. Li (2006) gave a new k-th shortest path algorithm in an unirecte graph. Classical Floy algorithm can easily fin the shortest path between any two vertexes on a graph, but not irectly reflect the sequence of the shortest path. Dai an Cheng (201) introuce an improve Floy algorithm, using C++ language programming technology, which reflects the relationship between any two vertices of the shortest path sequence. Even though, the classical Floy algorithm still nees to give new improvement. In orer to give a new improvement for the classical Floy algorithm, we nee to fin an overcome some efects in classical Floy algorithm. This paper will o these works. More etails are as follows: Copyright 2014 Centre for Info Bio Technology (CIBTech) 24

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. (1) We will give a weight for every vertex. This weight stans for resience time on this vertex. Travel staff knows their travel plan an the resience time neee by the site. It is very important to improve the effective use of time. (2) When we have obtaine a vertex, we nee to search the next vertices by classical Floy algorithm. During this time, we just provie an iea that shoul compare the values of the istance between the obtaine vertices an any of next vertices. The purpose of this improvement is to elete any of unnecessary vertices in orer to save the searching time. Repeating the process escribe in the above (2) with eleting some arcs which have not new vertices connecte with, we can fin the k-th optimal route which we hope to obtain. Preliminaries Accoring to the symbol given by Wang et al., (2010), some symbols use in the paper are given as follows: W represents irecte graph an unirecte graph weighte matrix; v 0 an vt represents an arbitrary source vertex an target vertex respectively; p is the shortest path to the source point vi to the target point v j (1 i n,1 j n); is the weight matrix of the shortest path; w represent the resience time of each vertex an w 0 (1 k n); p1 is the shortest time path of the reverse p; tt is changing of vertex on the path; Inf expresses. Some of the efinitions use in this paper are erive from (Bony an Murty, 2008). Definition 1 A graph G is an orere pair (V(G),E(G)) consisting of a set V(G) of vertices an a set E(G), isjoint from V(G), of eges, together with an incience functions that associates with each ege of G an unorere pair of (not necessarily istinct) vertices of G. If e is an ege an u an v are vertices such that, Then e is sai to join u an v, an the vertices u an v are calle the s of e. We enote the numbers of vertices an eges in G by v(g) an e(g), these two basic parameters are calle the orer an size of G, respectively. Definition 2 Let G be a graph, with vertex set V an ege set E. The incience matrix of G is the nm matrix M : m G ve, where ve m is the number of times (0, 1, or 2) that vertex v an ege e are incient. Clearly, the incience matrix is just another way of specifying a graph. Algorithm Iea This section will first point the flaws in classical Floy algorithm, an secon give our improvement iea for classical Floy algorithm. For the classical Floy algorithm, the reaer can refer to Bony an Murty, (2008). Floy Algorithm Defects We can fin the efects existe in the classical Floy algorithm. Copyright 2014 Centre for Info Bio Technology (CIBTech) 25

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. Defect 1 For travelers, it is necessary to calculate the accurate time require for their travels. But in the classical Floy algorithm, a traveler cannot fin the resience time at every vertex. Hence, classical Floy algorithm cannot reflect the shortest time path irectly. Defect 2 Using classical Floy algorithm to fin the k-th shortest path, a traveler nees to calculate the shortest path between two vertexes v i an v j each time to calculate the n (here n is the number of vertices in the irecte graph an unirecte graph.) aition, an the insertion of the mile vertex v k is obviously the length of the path is not be shortene, reucing the computational efficiency. Classical Floy algorithm is escribe in the reference (Xie an Li, 1995). When we calculate the large-scale path, the times for calculating becomes bigger. Improvement Iea In orer to overcome Defects 1 an 2, we will give the iea of our algorithm as follows. Accoring to the esigning a plan of a travel, the irecte graph an unirecte graph is set up. Base on this graph, the classical Floy algorithm can run. Hence, we will improve classical Floy algorithm with the irecte graph an unirecte graph. To improve Defect 1. Base on the irecte graph an unirecte graph, for each vertex, we give a weight w satisfying w 0, where w is the resience time on vertex k. It can be achieve in the jugment time accuracy. To improve Defect 2. When calculating the short path between two vertices v i an v j, we shoul treat the insertion of the vertex vk comparison the length of the path first. If t ik t or t kj t or w t, t 1,2,... n, then the length of vertex v i passes through the vertex v k to reach the vertex v j not shorter than the original. So, we no longer nee to calculate t t, an will fin the next vertex uring the search. This etermination ik kj will elete many unnecessary calculate vertices. All of these vertices are not involve in calculation. Thus, this improvement will greatly reuce the amount of calculation. Algorithm Process In the above section, we have introuce the iea of our algorithm. Firstly, this section will provie the process of our algorithm using Matlab language. Seconly, we will analyze the complexity of our algorithm. Thirly, we will compare the properties between our algorithm an classical Floy algorithm. First, we provie some notations use in Matlab. Copyright 2014 Centre for Info Bio Technology (CIBTech) 26

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. p represents the path matrix represents the shortest weight path matrix Secon, because our algorithm nees to call improve Floy algorithm (or say, prepare algorithm), so we present an algorithm as a prepare process for our algorithm. Prepare Algorithm Input: The irecte graph an unirecte graph matrix W; the source point v 0 ; the target point vt. Output: The source point v0 to the target point vt an the shortest path ( v0, vt ). With Matlab language, the concrete process is as follows: Matlab proceures are escribe as follows function floy(w,v0,vt) n=length(w); =w; k=1; for i=1:n (i,i)=0; while k<=n for i=1:n for j=1:n if (i,j)>(i,k)&&(i,j)>(k,j)&&(i,j)>w(k,k)&&i~=k&&k~=j %iterative shortest path (i,j) (i,j)=min((i,j),(i,k)+(k,j)+w(k,k)); k=k+1; k=1; p1(k)=vt; %shortest path target vertex vt tt=vt; %tt=v0the shortest path to the of the search while tt~=v0 for j=1:n if (v0,tt)==w(v0,j) k=k+1; p1(k)=v0; tt=v0; break; else if v0~=j&&(v0,j)==(v0,tt)-w(j,tt)-w(j,j) k=k+1; %the recor of the shortest path number (reverse) p1(k)=j; tt=j; break; Copyright 2014 Centre for Info Bio Technology (CIBTech) 27

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. k=1; r=fin(p1~=0); t=length(r); for j=t:(-1):1 %the recor of the shortest path number (positive) p(k)=p1(r(j)); k=k+1; isp() isp((v0,vt)) isp(p) The k-th Shortest Path Algorithm Our algorithm is to elete some arcs an call the prepare algorithm to calculate the k-th shortest path. Input: the irecte graph an unirecte graph weighte matrix W, the source point v 0, the target point vt. Output: Source point v0 to target point vt, shortest path k( v0, vt) an the shortest path pk. Matlab proceures are escribe as follows p1, p2, p, p4, p5, pk represent the first, secon, thir, fourth, fifth, the k-th shortest path respectively. 1, 2,, 4, 5, k represent the length of the p1, p2, p, p4, p5, pk respectively. a represents weighte graph matrix. Step 1: Calculation of the Secon Shortest Path Algorithm Secon path algorithm function [2,p2]=k2th(w,v0,vt) n=length(w); [1,p1]=floy(w,v0,vt);% for the most short circuit num1=length(p1); 2=inf; for i=1:(num1-1) a=w; a(p1(i),p1(i+1))=inf; % elete an ege on the shortest way a(p1(i+1),p1(i))=inf; [,path]=floy(a,v0,vt); % recalculate the short circuit if <2 2=; p2=path; Step 2: Calculation of the Thir Shortest Path Algorithm Matlab proceures are escribe as follows function [,p]=kth(w,v0,vt) [1,p1]=floy(w,v0,vt); [2,p2]=k2th(w,v0,vt); num1=length(p1); num2=length(p2); =inf; for i=1:(num1-1) for j=1:(num2-1) Copyright 2014 Centre for Info Bio Technology (CIBTech) 28

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. a=w; a(p1(i),p1(i+1))=inf; a(p1(i+1),p1(i))=inf; a(p2(j),p2(j+1))=inf; a(p2(j+1),p2(j))=inf; [,path]=floy(a,v0,vt); if < =; p=path; Step : Calculation of the Fourth Shortest Path Algorithm function [4,p4]=k4th(w,v0,vt) [1,p1]=floy(w,v0,vt); [2,p2]=k2th(w,v0,vt); [,p]=kth(w,v0,vt); num1=length(p1); num2=length(p2); num=length(p); 4=inf; for i=1:(num1-1) for j=1:(num2-1) for k=1:(num-1) a=w; a(p1(i),p1(i+1))=inf; a(p1(i+1),p1(i))=inf; a(p2(j),p2(j+1))=inf; a(p2(j+1),p2(j))=inf; a(p(k),p(k+1))=inf; a(p(k+1),p(k))=inf; [,path]=floy(a,v0,vt); if <4 4=; p4=path; Step 4: Calculation of the Fifth Shortest Path Algorithm function [5,p5]=k5th(w,v0,vt) [1,p1]=floy(w,v0,vt); [2,p2]=k2th(w,v0,vt); [,p]=kth(w,v0,vt); [4,p4]=k4th(w,v0,vt); num1=length(p1); num2=length(p2); Copyright 2014 Centre for Info Bio Technology (CIBTech) 29

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. num=length(p); num4=length(p4); 5=inf; for i=1:(num1-1) for j=1:(num2-1) for k=1:(num-1) for l=1:(num4-1) a=w; a(p1(i),p1(i+1))=inf; a(p1(i+1),p1(i))=inf; a(p2(j),p2(j+1))=inf; a(p2(j+1),p2(j))=inf; a(p(k),p(k+1))=inf; a(p(k+1),p(k))=inf; a(p4(l),p4(l+1))=inf; a(p4(l+1),p4(l))=inf; [,path]=floy(a,v0,vt); if <5 5=; p5=path; Step k-1. We will obtain the k-1-th shortest path as the similar process to the k-th shortest path algorithm in Step 1. Step k. Calculation of the k-th Shortest Path 1. Delete the k-1path, an get the weight graph w ( i, jl ) ; ( i, j ) 2. Calculate the shortest path weight L ( i, j ) an the shortest path L in the weight graph w ( i, jl ) ; ( i, jl ). Take k min{ }, an get the corresponent path pk. k Complexity Analysis This subsection will analyze the complexity for the above algorithms. For the prepare algorithm, we only nee to calculate the n-2 times in the calculation of the vertex v i to the vertex v j of the shortest path t because k i, j. Before the calculation of compare, that if t1 t1 ik, t1 t1 kj, t1 t1 w Copyright 2014 Centre for Info Bio Technology (CIBTech) 0 t k, every time you want to is without calculation t 1 t 1. Especially, when the i-th row or the j-th column element is greater than or equal to t 1,at this time, we obtain t t 1, aition calculation is 0. In the prepare algorithm, the computation of the shortest path t the vertex is a ranom variable, recore as X. Now, suppose that a ranom variable X value in 0 : n-2 is n 2 possible, resulting in ranom variable mathematical expectation is, namely in the calculation of the 2 ik kj

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. shortest t in the vertex v i to a vertex v j, aition amount of calculation for n 2 2 an istance matrix in 2 1 n elements, so the complexity of the algorithm is about O n. Because the weight of each matrix is 2 not the same, so a three jugments, the possible existence of two cases: when the three juge conitions cannot elete search vertices, as was the complexity of the algorithm an the classical Floy algorithm; when the three juge conitions can be elete to fin the vertex, the complexity of the algorithm will be far below the classical Floy algorithm. As a result of the three jugment conitions, we elete an unnecessary calculation vertex, resulting in a ecrease in the number of cycles. Using prepare algorithm, we can obtain the1st shortest path, the time complexity is about On. Using the k-th shortest path algorithm of Step 1, we can obtain the 2n shortest path, the time complexity is about On 1. Using the k-th shortest path algorithm of Step 2, we can obtain the r shortest path, the time complexity is about On 2. Using the k-th shortest path algorithm of Step k, we can obtain the k-th shortest path, the time complexity is about On. Thus, the complexity of obtaining the k-th shortest path is about O n k. Comparision This subsection will compare some properties between our algorithm provie above an classical Floy algorithm from the three facts: storage space, juging travel time in accuracy an the complexity of time algorithm. After that, we will use a table to sum up the two algorithms. 1) Storage Space In our algorithm, we give three conitions t t ik, Copyright 2014 Centre for Info Bio Technology (CIBTech) 1 t t w, t t kj for jugment. So, when looking for the weight time matrix, the computation time of our algorithm will be smaller. That is, m (m represents the number of vertices of the matrix after the eletion of the vertex, an n is the number of the matrix vertices) When three conitions are ae to elete the vertices, the number of cycles is obviously reuce. When the three conitions cannot be satisfie, namely m=n, the complexity of our algorithm an the classical Floy algorithm are the same; When three conitions can elete some vertexes, namely m<n. The time complexity of the algorithm is less than that the classical Floy algorithm. 2) Juging Travel Time in Accuracy Because peoples work scheule is very tight, the time for the expecte travel arrangements also require more accurate. It requires a precise time to juge a travel plan. In our algorithm, for each vertex k, we give a weight. This follows that our result is the closer to the peoples hope. Using classical Floy algorithm, travelers cannot achieve the accurate jugment. Classical Floy algorithm will not be more accurate to close to peoples travel time. ) Complexity of Time Algorithm Accoring to the subsection complexity analysis, we fin that the complexity of our algorithm is the same as that in classical Floy algorithm uner m=n, an is not the same uner m n.

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. From the above three points 1), 2) an ), we may obtain the following Table 1. Table 1: Comparison of the Algorithm in this Paper an Classical Floy Algorithm Property Algorithm in this Paper Classical Floy Algorithm Whether Juge Yes No Travel Time in Accuracy Storage Space m=n m<n m=n Complexity of Time Algorithm the Same Reuce the Same Om = On Om On Om = On Remark: In our algorithm, there are three conitions for eleting vertices. The first vertex cannot be connecte irectly to the vertex. The secon insert vertex cannot make the length of the path shorter. The thir vertex weight is longer than the istance of the two vertices. The vertices are not involve in calculation, thus reucing the amount of calculation greatly. Example We provie two examples to verify the feasibility of our algorithm in irecte graph an unirecte graph, respectively. Example 1 In this paper, we use the example as that in Zhang an Wu (2009) to calculate. Our algorithm is joine the weights of the vertex. Hence, for each vertex in the original graph, we give a weight as v1=, v2=4, v=, v4=4, v5=. A irecte graph is shown in Figure 1. We hope to calculate the shortest path among all vertexes. Figure 1 A Directe Graph Solution: 0 From Figure 1, we initial weighte istance matrix D an serial number matrix A 0 as the following. 1 0 0 0 4 1 2 5 0 0 0 0 0 D 2 4 0, A 0 0 0 ; 1 4 2 0 0 0 0 0 Copyright 2014 Centre for Info Bio Technology (CIBTech) 2

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. Matrix D 1 an serial number matrix A 1 are calculate by using initial weighte istance matrix D 0 an serial number matrix A 0 accoring to the Step 2 in prepare algorithm. For iterative matrix 1, since the first row in the iterative matrix D 0 elements are not less than iterative matrix 0 12 number matrix is 12 element, so o not calculate 1 A, an then 1 0 12 a12 a 0 0 1k k2, irectly get remains unchange. 1 0 12 12 1 Copyright 2014 Centre for Info Bio Technology (CIBTech). The corresponing serial For iterative matrix 1, because the value of the first element in the first row of the iterative matrix D 0 is smaller than the 1 1 12. 1 0 0 0 1 1 12 2 22 element, it is only Therefore, there is min, w min,1 1 1. At this time, we ecie v 1 v 2. The corresponing serial number matrix is A Similarly, the other elements in 1 D an 1 0 0 0 0 0 14 14 12 24 22 1 4 1, an there is a 1 v. 1 2 1 A are calculate as follows: 1 a15 v2 ; 1 a21 v ; min, w, w min,1 2 4, 4 7, a 1 0 0 0 15 15 12 25 2 min, w min,1 5 4 10, 1 0 0 0 21 21 2 1 min, w min,1 2 6, 1 0 0 2 2 1, a2 0 ; 1 0 1 24 24 2, a24 0 ; 1 0 0 0 0 0 2 2 1 12 11 4 42 44 min, w, w min,2 1,4 1 4 6, a 1 0 1 4 4 4, a4 0 ; 1 0 0 0 5 5 4 45 44 min, w min,4 2 4 10, a 1 0 1 41 41, a41 ; 1 0 1 42 42 1, a42 0 ; 1 0 0 0 4 4 42 2 22 min, w min,11 4 6, a 1 0 1 45 45 2, a45 ; 1 0 1 51 51, a51 ; 1 0 1 52 52, a52 0 ; 1 0 0 0 5 5 52 2 22 min, w min, 1 4 8, a 1 0 0 0 54 54 52 2 22 min, w min, 1 4 8, a So, we get the matrix D 1 1 D an A 1 are as follows. 0 1 7 10 0 0 v2 v2 v2 6 0 1 2 5 v 0 0 0 v 4 1 2 6 0 4 10, A 0 v1 0 0 v 4. 1 6 0 2 0 v2 0 0 8 8 0 0 v2 v2 0 1 5 v4 1 4 v2 ; ; 1 5 v2 ; 1 54 v2 ; 1 14 v2 ; 1 2 v1 ;

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. 1 0 Clearly, we have D D. This nees to continue iteration. Using the above metho, we get the matrix 2 D an A 2 are the following: 0 1 7 10 0 0 v2 v2 v2 6 0 1 2 5 v 0 0 0 v 4 2 2 D 2 6 0 4 10, A 0 v1 0 0 v 4. 11 1 6 0 2 v2, v 0 v2 0 0 1 8 9 0 v2, v 0 v2 v2 0 The comparison is not ifficult to fin D 2 D 1 2, an then it calculates D accoring to the D. 0 1 7 10 6 0 1 2 5 D 2 6 0 4 10. 11 1 6 0 2 1 8 9 0 By comparison, we can know D 2 D by algorithm termination. The corresponing element a 2 A is the shortest path between vertex v i an vertex v j. So the value of the corresponing element 2 D is the shortest path length between vertex v1 an vertex v5. For example, we seek the shortest path time an shortest path between vertex v1 an vertex v5. Look for the elements 2 15 an a 2 15 corresponing to the matrix 2 D an 2 Copyright 2014 Centre for Info Bio Technology (CIBTech) 4 A. 2 in 2 15 in When we encounter a path from vertex v1 to vertex v5, we cannot go, then we take this path to elete. We 0 make some of the elements in the matrix D into. Here we give the secon shortest time path. We can use the improve Floy algorithm to work out the first path. The first shortest time path is v1-v2- v5, the require time is 5. When the first path v2 to v5 in this roa cannot go, we make elements in the matrix 0 25. We initial weighte istance matrix D 0 an serial number matrix A 0 as follows. D 0 1 4 1 2 2 4, A 1 4 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Then use the improve Floy algorithm to calculate, you can get the secon shortest time path is v1-v2- v4-v5, the require time is 1; 0 0 Then we elete the shortest time path is v1-v2-v4-v5. We make elements in the matrix 24, 25. Then use the improve Floy algorithm to calculate, you can get the thir shortest time path is v1-v-v4- v5, the require time is 16; Then we elete the shortest time path is v1-v-v4-v5. We make elements in the matrix,, 0 1. 0 24 0 25

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. Then use the improve Floy algorithm to calculate, you can get the fourth shortest time path is v1-v2-v- v4-v5, the require time is 19; Then we elete the shortest time path is v1-v2-v-v4-v5. We make elements in the matrix, 0 45,, Then use the improve Floy algorithm to calculate, you can get the fifth shortest time path is v1-v-v4- v2-v5, the require time is 24. Example 2 We accoring to the reference (Wang et al., 2010, pp.2) case in 2.5, to the eitor gives a figure close to the actual circumstance of unirecte weighte time graph. Figure 2 shows the graph of a city s subway line. A traveler wants to travel by subway. Here we esign a travel plan, He (She) wants from the vertex v2 to vertex v11. However, when a path cannot travel, the next secon, thir, fourth, fifth of the shortest path how to go? What is the shortest time to the shortest path? 0 12 Figure 2: Unirecte Weighte Time Graph Using our algorithm, we calculate the accuracy of shortest time an the corresponing shortest path. Five kin of shortest time path are shown in the following: vertex v2 to vertex v11 The first shortest time path is v2-v5-v9-v11, the require time is 62; The secon shortest time path is v2-v5-v9-v8-v11, the require time is 87; The thir shortest time path is v2-v-v7-v10-v11, the require time is 92; The fourth shortest time path is v2-v5-v9-v10-v11, the require time is 92; The fifth shortest time path is v2-v-v5-v9-v11, the require time is 97. As can be seen from the above results, we can use our algorithm to fin the shortest path of any two vertices in the graph an the shortest time to sp. In aition, by using our algorithm, we can estimate more accurate travel time for travelers than using the classical Floy algorithm. So, our algorithm is more effective for travelers than the classical Floy algorithm. Base on the two examples above, we obtain the comparison of the cycle times of our algorithm an the classical Floy algorithm. Table 2: Cycle Times Cycle Times Our Algorithm Classic Floy Algorithm Vertices 5 17 125 11 186 11 Table 2 shows the number of cycle times of our algorithm an the classical Floy algorithm for searching the k-th shortest path. In this experiment, two examples of the cycle times are much lower than the classic Copyright 2014 Centre for Info Bio Technology (CIBTech) 5

International Journal of Physics an Mathematical Sciences ISSN: 2277-2111 (Online) 2016 Vol. 6 (1) January-March, pp. 24-6/Mao an Shi. Floy algorithm, an it means that the time efficiency of our algorithm is higher than that of the classical Floy algorithm. With the increasing of the number of vertices, the reuction of the number of cycles of our algorithm becomes more an more obviously. Conclusion In this paper, we improve the classical Floy algorithm, which cannot effectively improve the search efficiency of the problem. In our algorithm in the irecte graph an unirecte graph, there are three conitions ae to elete the vertex. The first vertex cannot be connecte irectly to the vertex. The secon insert vertex cannot make the length of the path shorter. The thir vertex weight is longer than the istance of the two vertices. The vertices are not involve in calculation, thus reucing the amount of calculation greatly. Therefore, our algorithm improves the search efficiency. The resience time is ae at each vertex of the improve algorithm, which is more convenient to calculate the travel time. When the roa cannot move, we nee the k-th shortest path. Our algorithm is to remove some arcs an call the preparation algorithm to calculate the k-th shortest path. Our algorithms give the traveler multiple choice. In the future, we hope to fin the k-th shortest path using much smaller time an faster running spee. ACKNOWLEDGMENTS This paper is grante by NSF of China (61572011) an NSF of Hebei province (A201201119, A20142010). REFERENCES Bony JA an Murty USR (2008). Graph Theory, (San Francisco: Springer Press, California). Dai XY an Cheng GZ (201). Improvement an optimization of Floy algorithm. Journal of Xichang College 26(1) 6-65. Eppstein D (1999). Fining the k shortest paths. SIAM Journal on Computing 28(2) 652-67. Li CJ (2006). A new algorithm to fin the k shortest paths. Journal of Shanong University 41(4) 41-42. Wang SH (2009). Graph Theory (Being: Being Science an Technology Press, China). Wang HY, Huang Q, Li CT an Chu BZ (2010). Graph Theory Algorithm an its MATLAB Implementation, (Being: Being Beihang University Press, China). Xie Z an Li JP (1995). Network Algorithm an Complexity Theory, (Being: Being National University of Defense Technology Press, China). Yan HB an Liu YC (2000). A new algorithm for fining short cut in a city s roa net base on GIS technology Chinese. Journal of Computers (in Chinese) 2(2) 210-215. Zhang DQ an Wu GL (2009). Optimize Floy Algorithm for Shortest Paths Problem. Journal of Xuchang University 28(2) 10-1. Copyright 2014 Centre for Info Bio Technology (CIBTech) 6