I'm aware of the general k-center approximation algorithm, but my professor (this is a question from a CS class) says that in a one-dimensional space, the problem can be solved (optimal solution found, not an approximation) in O(n^2) polynomial time without depending on k or using dynamic programming.

A general description of the k-center problem: Given a set of nodes in an n-dimensional space, cluster them into k clusters such that the "radius" of each cluster (distance from furthest node to its center node) is minimized. A more formal and detailed description can be found at http://en.wikipedia.org/wiki/Metric_k-center

As you might expect, I can't figure out how this is possible. The part currently causing me problems is how the runtime can not rely on k.

The nature of the problem causes me to try to step through the nodes on a sort of number line and try to find points to put boundaries, marking off the edges of each cluster that way. But this would require a runtime based on k.

The O(n^2) runtime though makes me think it might involve filling out an nxn array with the distance between two nodes in each entry.

Any explanation on how this is works or tips on how to figure it out would be very helpful.


Question: Does "so far, so good" carry a negative connotation?
Answer: The difference between &ldquo;so far, so good&rdquo; and simply &ldquo;good&rdquo; is that the former implies a lack of guarantees about the future.  &ldquo;So far, so good&rdquo; connotes that things can go wrong later, but not that they will go wrong later &mdash; unless used in an ironic or humorous context such as &ldquo;I plan to live forever; so far, so good.&rdquo;