A seen neighbour
transcript
Two analysts worked on the same case, so they conflict. They can sit in different teams, one north and one south. Yet the code says false. Can you see why?
The code colours the first analyst with colour zero. It walks to the neighbour and gives it colour one. And then it looks back at the first analyst, and stops.
If the neighbour is new, colour it. Otherwise, compare the colours. Return false only on a clash.
Node zero was seen before. But its colour is different.
The node you came from is always seen. Its colour is always the opposite. Only equal colours clash.
A ring of four links can be split. A ring of three links cannot.
A ring of four is fine. A triangle always clashes.
Compare the colours of both ends of a link. Seen is not a clash. Equal colours are. Test a single link. Full breakdown in the lecture.