Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
SciPy Batteries solution in 3rd party category for Connect Stars by flpo
import numpy as np
from scipy.sparse.csgraph import minimum_spanning_tree
from scipy.spatial import distance_matrix
def connect_stars(coords):
graph = distance_matrix(coords, coords)
covered = minimum_spanning_tree(graph)
return np.argwhere(covered != 0).tolist()
June 5, 2020
Comments: