For example, in a connected weighted graph, it is interesting to know how to find a subgraph which is a tree and which maximizes or minimizes the total weight of the subgraph. A subgraph of a graph $G$ which is a tree that touches all nodes of $G$ is called a spanning tree for $G$.