Given a graph of n nodes that are all interconnected on a coordinate plane, what's the best way to find a subtree of minimal distance that contains m nodes?
The only solution I've found to this problem is to generate all combinations of the nodes to connect and attempt to connect these nodes via either Kruskal's or Prim's algorithm while disregarding the rest, then compare all trees created and find the smallest one, but this isn't exactly efficient when it comes to larger trees.
Is there a faster, more efficient algorithm/method?