What algorithm should I use to find a minimal tree that include certain nodes within a graph? Assume we need to include a certain set of nodes in the tree within the whole graph, the generated tree can contain nodes other than the specified set of nodes. We also need the number of edges (or the total amount of edge weight) included in the tree is minimum.
This is the famous Steiner tree problem in graphs, which is known as NP-hard.