For a complete directed graph with vertex set , denote the length of edge from to by . Setting , its distance matrix is simply . In executing matrix multiplications, replace the ordinary multiplication between elements by the addition and replace the ordinary addition between elements by the operation taking the minimum among them. An example of is as follows: