Skip to content

Conversation

@LacyDraper
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lacy, this isn't quite working, but you are on the general path to a BFS approach. Take a look at my comments and let me know what questions you have.

Comment on lines +44 to +45
elif current in green:
green.add(current)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If current is in green add it to green? Is that what you wanted to do here?

red.add(current)

for neighbor in dislikes[node]:
if neighbor not in red or green:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In these if statements you're going to want to establish that:

If current is in red, that the neighbor is not in red
if the current is in green that the neighbor is not in green

Then if the neighbor is not in green or red add the neighbor to the opposite color of current and then append it to the queue.

If the neighbor is in the same color as current return false.


On an entirely different note, you can't do the or like you have it in if neighbor not in red or green:. it would have to be something like if neighbor not in red and neighbor not in green

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.

2 participants