{'fraction_non_alphanumeric': 0.031073446327683617, 'fraction_numerical': 0.01977401129943503, 'mean_word_length': 4.496124031007752, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Average distance in colored graphs

For a graph G where the vertices are colored, the colored distance of G is defined as the sum of the distances between all unordered pairs of vertices having different colors. Then for a fixed supply s of colors, ds(G) is defined as the minimum colored distance over all colorings with s. This generalizes the concepts of median and average distance. In this paper we explore bounds on this parameter, especially a natural lower bound and the particular case of balanced 2‐colorings (equal numbers of red and blue). We show that the general problem is NP‐hard but there is a polynomial‐time algorithm for trees. © 2001 John Wiley & Sons, Inc. J Graph Theory 38: 1–17, 2001