The concept of two-dimensional element matrix is presented. For the weighted matrix corresponding to a weighted graph, the two-dimensional element initial weighted path matrix and general weighted path matrix are defined. Based on the general multiplication operation of the weighted matrices, the multiplication operation of the paths is de-fined, and then the multiplication operation of the general weighted path matrices is derived, by which all the minimum weights and all the shortest paths of all pairs can be found clearly in the final general weighted path matrix. This algo-rithm is easy to...