Spanning trees of a graph Spanning trees of a graph Definition A subgraph T of a undirected graph G is a spanning tree of G if it is a tree and contains every vertex of G…