sketched out algo for creating directed trees from connected and disconnected graphs