Skip to content

Conversation

@pozorvlak
Copy link
Contributor

@pozorvlak pozorvlak commented Nov 1, 2019

Minor cleanup of Zach's code, and an attempt to make it faster and more memory-efficient using the bitsets library.

This produces the same output as Zach's version until the call to findbests, at which point it throws the following error:

 Traceback (most recent call last):
  File "./exitless_paths.py", line 178, in <module>
    get(Ts, moves, 13)
  File "./exitless_paths.py", line 85, in get
    findbests(done)
  File "./exitless_paths.py", line 93, in findbests
    best[cost] = max(best[cost], max(len(p) for p in done[end][cost]))
  File "./exitless_paths.py", line 93, in <genexpr>
    best[cost] = max(best[cost], max(len(p) for p in done[end][cost]))
TypeError: object of type 'int' has no len()

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

Successfully merging this pull request may close these issues.

1 participant