LoginSign up
文档首页

网络分群 / 最大割

把网络节点分成两组,使「跨组连边」数量最多。社区发现、电路分区、图像分割、并行任务划分的核心模型。

请求参数

字段说明
problem"max_cut"
nodes节点数量,编号 0 ~ nodes-1
edges连边数组,如 [[0,1],[1,2]]

请求示例

{
  "problem": "max_cut",
  "engine": "gpu",
  "params": {
    "nodes": 6,
    "edges": [[0,1],[1,2],[2,3],[3,4],[4,5],[5,0],[0,3],[1,4]]
  }
}

返回示例

{
  "summary": {
    "groupA": [0, 2, 4],
    "groupB": [1, 3, 5],
    "cut": 8,
    "totalEdges": 8
  }
}

要点

  • cut / totalEdges 越接近 1 越好;二部图可达到全部割开。
  • 节点数大(数百以上)时建议用 GPU 引擎。