Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
So I've been reading a lot, and it seems like in an unweighted (or "sameweighted") undirect graph like I have, doing a BFS or a DFS will give you the MST (plus, any spanning tree is a minimum spanning tree) - cs.stackexchange.com/questions/23179/…