Added root parameter to create_rooted_spanning_tree.