Minimizing * Similar * Node Pairs in a Weightless Graph

I am trying to reduce this question to programmable. I let each prisoner represent a color and each bottle a node. While there is no such pair (see below), it is possible to pinpoint the poisoned bottles (on the first day).

We have $ 1000 $ nodes. You have to wire them up using a different range color and you have only $ n $ colors. There cannot be 2 independent networks of the same color.

If Node A is connected to the red bar before Node B, and Node B is connected to Node C using a different red bar, Node A and Node C also said that it is connected through the red bar. Therefore, A, B and C belong to the red network.

Two pairs of nodes are called the same if they are connected by the same color stripes (no more, no less). For example, if A and B are connected through a red, green, and purple network (but there is no other network), and if C and D are connected through a red, green, and purple network (but there is no other network), AB and CD are a similar pair. A similar pair can share a node, so AB and AC can be valid a similar pair.

For a given value of $ n $, what is the minimum number of such pairs possible? Solve using an algorithm (or a math function if possible).

P. S.

  • Please don't close this as an HW question, it's not one. I don't know much about algorithms, so I'm only more interested in the last program, not its functioning.

  • Not just for me, there are a lot of people at Puzzling SE who would like to see this answered.

+3


source to share





All Articles