我有一个数据集,包含N
个节点 和K
个分布中心 .如果我知道它们各自的 (x,y) 坐标
What algorithm can I use to cluster these nodes keeping the balance between the distance node-center and number of nodes assigned to the centers?
例如,我可以使用作为标准,将节点分配到它们最近的分布中心,但这可能会产生具有许多节点的分布中心,我想避免这种情况。有帮助吗?
最佳答案
将其表述为优化问题。
例如平均距离,以及当太多 N 分配给同一个 K 时的惩罚因子。
然后使用标准优化技术找到解决方案。
不要期望开箱即用的任何东西都支持像您这样的模糊约束。您必须决定什么是好的解决方案,然后让优化器搜索好的解决方案。
关于algorithm - 具有 N 个节点和 K 个配送中心的集群,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44790791/