j is equal to the length of the longest common substring between. . Compute the maximum total weight of any spanning tree on this graph.A substring of a string can be obtained by removing some characters from the beginning and/or the end of that string. For example, "maca", "aca" and "cau" are all substrings of "macau", while "acu" is not.
Given a complete undirected graph of n n vertices and n n strings s_1, s_2, cdots, s_n s 1 ,s 2 ,⋯,s n , the weight of edge connecting vertices i i and j j is equal to the length of the longest common substring (LCS) between s_i s i and s_j s j . Compute the maximum total weight of any spanning tree on this graph. A substring of a string can be obtained by removing some (possibly zero) characters from the beginning and/or the end of that string. For example, "maca", "aca" and "cau" are all substrings of "macau", while "acu" is not.