# spanningForest -- constructs a spanning forest of a graph

## Synopsis

• Usage:
F = spanningForest G
• Inputs:
• G, an instance of the type Graph,
• Outputs:
• F, an instance of the type Graph, a forest spanning G

## Description

A graph is a forest if it is a disjoint collection of trees. A graph is a tree if any two vertices are connected by a unique path of edges. A spanning forest is a forest that spans all the vectors of G using edges of G.

 i1 : G = cycleGraph 5; i2 : spanningForest G o2 = Graph{0 => {1, 4}} 1 => {0, 2} 2 => {1, 3} 3 => {2} 4 => {0} o2 : Graph