You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
Initially I thought this can be corrected by making edits to "cyscs/_utils.py" by:
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'])
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'
The text was updated successfully, but these errors were encountered:
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 forn = 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:
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']
)format_and_copy_cone(cone)
function's first for loop. (i.e. changefor key in 'f', 'l', 'ep', 'ed':
tofor 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'
The text was updated successfully, but these errors were encountered: