use the breadth first search workspace for the connected components code