I'm trying to solve a variation of the minimum spanning tree problem; I have a graph where there are certain key nodes and optional nodes. Each optional node has a weight and we need to find a subset of the nodes which spans all the key nodes while minimizing the total weight of the optional nodes. Since the key nodes are mandatory they don't have weights. The edges also don't have weights, they are in sense free as soon as both nodes it connects are selected. I made an example with the key nodes marked in red and the solution (I think) in green.
Edit: While I thought this might reduce to an MST I'm thinking it might actually be a steiner tree problem and therefore NP-hard. The use-case is for a video game, so a fast (and simple) approximate solution is much preferred.
