Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not accounting for 'z' cones in NC-ADMM yields ValueError: The cones must match the number of rows of A #23

Open
ShashvatJK opened this issue May 26, 2022 · 0 comments

Comments

@ShashvatJK
Copy link

ShashvatJK commented May 26, 2022

Hello,

So I have been trying to implement tsp.py with NC-ADMM method. However I kept getting the error "ValueError: The cones must match the number of rows of A". I investigated further and printed the cone dictionary that is being passed through cyscs.Workspace() and got this for n = 60 (TSP number of cities parameter):

cone {'l': 10800, 'q': [3602], 'ep': 0, 's': [], 'p': [], 'z': 60}

Initially I thought this can be corrected by making edits to "cyscs/_utils.py" by:

  1. Including an extra if condition in cone_len(cone) function to find a 'z' key in the cone dictionary and update the cone count with the value of cone['z'] (i.e. include an additional condition: if 'z' in cone: total += cone['z'])
  2. by incorporating 'z' key in the format_and_copy_cone(cone) function's first for loop. (i.e. change for key in 'f', 'l', 'ep', 'ed': to for key in 'f', 'l', 'ep', 'ed', 'z':)

However, this did not make the cut. That is when I noticed the problem is deeper than that. In "scsprox/scs_mapping.py" we define the following:
@property def cone_dims_for_scs(self): return dims_to_solver_dict(self._data['dims'])
and that is where the problem seems to lie. Because, the self._data['dims'] returns (zero: 60, nonneg: 10800, exp: 0, soc: [3602], psd: [], p3d: []) where I assume p3d corresponds to 'z' (Is this true?). If so, p3d must be equal to 'n' (the TSP number of cities parameter), but it is empty! And that's why the example is not functional still. Any ideas on how this can be resolved?

Also, the weird part is, if p3d is infact empty, then the extra 'n' cones must not be accounted for in the size of A = problem_data.data['A']. But, the whole problem started from there. A.shape[0] = 14462 while cone_len(cone) = 14402 (without including the 'z' counts). I checked for multiple values of 'n' and observed that cone_len(cone) is always less than A.shape[0] by 'n'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant