Added is_connected method to Graph