Interview Question
AnalystsCountry: India
I don't know the code, but the algorithm can be worked out. Assuming that each tower can generate only one frequency, 7 towers can be set up at a particular location. Thus considering it as the center, around the circle with radius 100km towers can be put up at the corners of a hexagon (7 towers at a corner) circumscribed by the circle. thus the towers will be at a distance of 100km from each other. Again, consider a corner point as a center and build the structure.
This sounds like an instance of difference constraints problem
- Manas May 06, 2012