In this paper we consider the shortest path counting problem (SPCP): how many shortest paths contain each edge of the network N = (V, E) with the vertex set V and the edge set E? There are n(n – 1) shortest paths in the network with |V| = n, so among all these shortest paths the SPCP requires us to count the number of shortest paths passing each edge. Defining the weight of shortest paths for each edge in the network as the number of shortest paths contained, we can obtain theoretical results in the form of explicit expressions for special types of networks such as trees, grid type, circular type and so on. We apply these results to solve median and center location problems for special types of networks. Furthermore we consider the network connection problem asking how to connect two networks with a single edge or two edges from the viewpoint of minimizing the total weight of shortest paths in the newly combined network. Finally we summarize our theoretical results and show the correspondence between these theoretical results of the SPCP and their implication in the actual location problems.