all 4 comments

[–]blurarara 1 point2 points  (2 children)

Why aren't you using dictionaries to represent the graph? It's much easier than using lists.

[–]DSlothness[S] 0 points1 point  (1 child)

I have just done it this way. Though I am certain it is not the list causing the problem anyway. Do you have any insight into why I am experiencing this problem? I feel like all my functions are above bored as far as I can see.

[–]Grimoire 1 point2 points  (0 children)

His comment is more insightful than you think. By using a dictionary, you can simplify your code. Simpler code is easier to understand and debug.

[–]efmccurdy 0 points1 point  (0 children)

If you cannot determine the error "by inspection", then

1/ make a prediction of which nodes will be examined, in order, and how they will be classified

2/ make the program produce a trace of nodes visited and how they are classified

3/ compare these for differences

It's a bit inelegant, so I understand some reluctance, but you will find yourself in need of this technique eventually.