Please read the new rule regarding the restriction on the use of AI tools. ×

Minimum cost subtree

Revision en3, by olivergrant, 2024-02-03 22:00:40

Hi! I have the following problem regarding MSTs.

Given a complete undirected graph $$$G = (V,E)$$$ of edges only costing either 1 or 2, find a subset of the edges $$$|E'|=k$$$ for some $$$k$$$ and vertices $$$V'$$$ such that $$$(V', E')$$$ form a tree, is connected, and is of minimum cost.

The bounds for this problem is that $$$1 \le n \le 10^3$$$ and $$$1 \le k \le n - 1$$$

To me, this is very similar to an MST problem, but running a classic MST algorithm would be slow and I'm trying to do this in $$$O(|E|)$$$ time by making use of the complete graph property.

Tags graphs, mst, minimum spanning tree, graph theory

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English olivergrant 2024-02-03 22:57:58 19 Tiny change: 'a **tree**, is **connected**, and is of' -> 'a **tree** and is of'
en3 English olivergrant 2024-02-03 22:00:40 7
en2 English olivergrant 2024-02-03 21:16:44 2
en1 English olivergrant 2024-02-03 20:55:20 592 Initial revision (published)