For fun I'm learning about graph theory and I came across this problem. Given a set of vertices V, a set of edges E, and a weight for each edge in E, how can I efficiently construct a graph G such that:
- G is connected (all vertices are connected via some path)
- the sum of the weights of the edges is minimized
Cheers!
Edit: the edges in E are directed, when all edges in E are present there can be cycles