def get_path_locations(sg, path_order_grid):
  """Given a solved grid and path order variables, return the path as points."""
  model = sg.solver.model()
  path = []
  for p, po_var in path_order_grid.items():
    po = model.eval(po_var).as_long()
    if po >= 0:
      path.append((po, p))
  path.sort()
  return [t[1] for t in path]