def pathToString(path, everyRowNum):
  """
  将最优路径列表转为字符串
  :param path: 最优路径列表 list
  :param: everyRowNum 每行打印的路径数,除去头尾 int
  :return: 路径字符串 str
  """
  min_path_str = ""
  for i in range(len(path)):
    min_path_str += str(path[i]) + ("\n--> " if i != 0 and i % everyRowNum == 0 else " --> ")
  min_path_str += "0" # 单独输出起点编号
  return min_path_str