Skip to content

'NoneType' object has no attribute 'key' error in decrease_key #3

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

Open
gracejenkins opened this issue Apr 6, 2018 · 0 comments
Open

Comments

@gracejenkins
Copy link

I'm using fibonacci heaps for a priority queue in a min cut algorithm. I've been able to successfully implement it with a couple of test graphs, but suddenly for one of my tests I'm getting this issue in decrease_key:

Traceback (most recent call last):
File "TSPSolver.py", line 248, in
main('test2.txt')
File "TSPSolver.py", line 244, in main
tsp = remove_subtours(tsp,G)
File "TSPSolver.py", line 200, in remove_subtours
constraint_edges, min_cut_nodes = find_subtour(G, model.X)
File "TSPSolver.py", line 182, in find_subtour
min_cut_nodes, min_cut_value = min_cut(G_x)
File "TSPSolver.py", line 156, in min_cut
cut_of_phase, cut_nodes, G = min_cut_phase(G)
File "TSPSolver.py", line 144, in min_cut_phase
to_search = update_fibheap(G,to_search, heap_nodes, a.value)
File "TSPSolver.py", line 124, in update_fibheap
fibheap.decrease_key(node,node.key - change_in_weight)
File "/Users/ArluahsMAC/Desktop/CAAM471PTSD/fib_heap.py", line 76, in decrease_key
if x.key < self.min_node.key:
AttributeError: 'NoneType' object has no attribute 'key'

Any idea why this might be happening?
Thanks!

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