The paper proposes a new adjacent node algorithm,which is an optimization algorithm based on traditional Dijkstra algorithm. The proposed algorithm uses the connection relation of arcs in the network topology information to avoid using correlation matrix which contains substantial infinite values. The case study shows that the new algorithm is more suitable for analysing the network with massive spatial data and can save a large amount of computing memory. Therefore,the new algorithm can be applied in analysing network with a large number of nodes.