  With the rapid development of social network applications, social network has
become an important medium for people to interact. For the minimum distance
computation of all pairs in networks, Alon N[4] proposed an algorithm with
matrix multiplication, combining with distance product association law and
block matrix multiplication, all pairs shortest path length algorithm on
networks has time bound O((2n^3)/B logn). In practical applications,
considering the scale-free characteristics of social networks and the precision
limitations of floating-point operations on computer hardware, I found that the
shortest path algorithm has an improved time bound O((14n^3)/B). Based on the
above theory, I propose an all pairs shortest path algorithm that combines
sparseness judgment and convergence judgment, leveraging the distance product
algorithm with matrix multiplication, distance product association law, block
matrix multiplication, scale-free characteristics of social networks, and
limitation of floating-point operations on hardware. Testing on a social
network dataset with 8508 actors, compared to Alon N algorithm, proposed
algorithm has a performance improvement of 39% to 36.2 times on CPU and GPU.
