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

get_all_solutions crash #84

Open
parmentelat opened this issue Mar 18, 2024 · 1 comment
Open

get_all_solutions crash #84

parmentelat opened this issue Mar 18, 2024 · 1 comment

Comments

@parmentelat
Copy link
Contributor

hi, just ran into this crash

I can provide more details on the input - hopefully I can get this library of problems to solve in the near future
but in the meanwhile maybe this is enough for you to spot the problem ?

Traceback (most recent call last):
  File "~/git/exact-cover-py/benchmark/benchmark.py", line 130, in <module>
    main()
  File "~/git/exact-cover-py/benchmark/benchmark.py", line 127, in main
    run_once(run_index, args.full)
  File "~/git/exact-cover-py/benchmark/benchmark.py", line 112, in run_once
    [run_exact_cover(name, problem, run_index, size) for size in sizes])
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/git/exact-cover-py/benchmark/benchmark.py", line 47, in run_exact_cover
    solutions = [get_exact_covers(problem["data"], max_count=max_count)]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/miniconda3/envs/exact-cover-py/lib/python3.12/site-packages/exact_cover/wrapper.py", line 62, in get_all_solutions
    return _solutions_array_to_set(result)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/miniconda3/envs/exact-cover-py/lib/python3.12/site-packages/exact_cover/wrapper.py", line 45, in _solutions_array_to_set
    return set([tuple(truncate(row)) for row in a])
                      ^^^^^^^^^^^^^
  File "~/miniconda3/envs/exact-cover-py/lib/python3.12/site-packages/exact_cover/wrapper.py", line 41, in truncate
    return truncate(row[:-1])
           ^^^^^^^^^^^^^^^^^^
  File "~/miniconda3/envs/exact-cover-py/lib/python3.12/site-packages/exact_cover/wrapper.py", line 41, in truncate
    return truncate(row[:-1])
           ^^^^^^^^^^^^^^^^^^
  File "~/miniconda3/envs/exact-cover-py/lib/python3.12/site-packages/exact_cover/wrapper.py", line 41, in truncate
    return truncate(row[:-1])
           ^^^^^^^^^^^^^^^^^^
  [Previous line repeated 990 more times]
  File "~/miniconda3/envs/exact-cover-py/lib/python3.12/site-packages/exact_cover/wrapper.py", line 37, in truncate
    if all(x == 0 for x in row):
          ^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded
@jwg4 jwg4 mentioned this issue Mar 31, 2024
@jwg4
Copy link
Owner

jwg4 commented Mar 31, 2024

Thanks for reporting! Makes sense even without the input details. I think it's fixed here #85

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

2 participants