Coloring problem in 1D

Can you give some more detail on the problem? Preferably post the actual text of the problem you're trying to solve. Some things I don't understand:
- what are neighbouring edges? Do you mean points where it changes from one color to another?

From what you've written, I think this would work:
- for each adjacent pair, pick a random color from among the choices.
- Then, for each internal point, if the color changes on either side, increment a counter.
- print the counter.

I suspect that picking a random color isn't want you want. How should we pick the color? What are we trying to achieve?
Topic archived. No new replies allowed.