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

Infinite recursion when adding MaxParents(1) constraint #64

Open
cmalinmayor opened this issue Aug 12, 2024 · 2 comments
Open

Infinite recursion when adding MaxParents(1) constraint #64

cmalinmayor opened this issue Aug 12, 2024 · 2 comments

Comments

@cmalinmayor
Copy link

@tlambert03 I assume there is something wrong with my candidate graph that is causing this issue. I tried to add "hyperedges" to model specific division costs. Any tips?

  File "/Users/malinmayorc/code/darts_experiments/src/darts_utils/tracking/solve_with_motile.py", line 17, in solve_with_motile
    solver.add_constraint(motile.constraints.MaxParents(1))
  File "/Users/malinmayorc/code/motile/motile/solver.py", line 110, in add_constraint
    self.constraints.add(constraint)
  File "ilpy/wrapper.pyx", line 234, in ilpy.wrapper.Constraints.add
  File "/Users/malinmayorc/miniconda3/envs/darts/lib/python3.10/site-packages/ilpy/expressions.py", line 27, in as_constraint
    l_coeffs, q_coeffs, value = _get_coeff_indices(self)
  File "/Users/malinmayorc/miniconda3/envs/darts/lib/python3.10/site-packages/ilpy/expressions.py", line 268, in _get_coeff_indices
    for var, coefficient in _get_coefficients(expr).items():
  File "/Users/malinmayorc/miniconda3/envs/darts/lib/python3.10/site-packages/ilpy/expressions.py", line 342, in _get_coefficients
    _get_coefficients(expr.left, coeffs, scale, var_scale)
  File "/Users/malinmayorc/miniconda3/envs/darts/lib/python3.10/site-packages/ilpy/expressions.py", line 350, in _get_coefficients
    _get_coefficients(expr.left, coeffs, scale, var_scale)
  File "/Users/malinmayorc/miniconda3/envs/darts/lib/python3.10/site-packages/ilpy/expressions.py", line 350, in _get_coefficients
    _get_coefficients(expr.left, coeffs, scale, var_scale)
  File "/Users/malinmayorc/miniconda3/envs/darts/lib/python3.10/site-packages/ilpy/expressions.py", line 350, in _get_coefficients
    _get_coefficients(expr.left, coeffs, scale, var_scale)
  [Previous line repeated 988 more times]
  File "/Users/malinmayorc/miniconda3/envs/darts/lib/python3.10/site-packages/ilpy/expressions.py", line 347, in _get_coefficients
    if isinstance(expr.op, (ast.Mult, ast.Div)):
RecursionError: maximum recursion depth exceeded in __instancecheck__
@cmalinmayor
Copy link
Author

Update: Actually, one of the nodes has 1002 previous edges (from my prints: Node 868 has 1002 prev_edges). This is larger than the max recursion depth set for the ilpy expressions. Is there an easy way to fix this?

@cmalinmayor
Copy link
Author

(other than reduce my number of edges... which I have now done 😄 )

@tlambert03 tlambert03 transferred this issue from funkelab/motile Aug 12, 2024
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