https://projecteuler.net/problem=107 This is minimum spanning tree. Nice real world examples: "A company is planning a fiber network for a number of Chicago suburbs. It only has the right of way for its fiber along certain corridors. Some of those corridors might be more expensive. Find the subgraph of connection corridors that connect every suburb with the lowest total cost:" ( https://reference.wolfram.com/language/ref/FindSpanningTree.html ) "The first algorithm for finding a minimum spanning tree was developed by Czech scientist Otakar Borůvka in 1926 (see Borůvka's algorithm). Its purpose was an efficient electrical coverage of Moravia." ( https://en.wikipedia.org/wiki/Minimum_spanning_tree )