MathTop

graph_maximum_independent_set 函数

返回一组内部没有边相连的最大顶点集合。

语法

  • GraphTheory:-MaximumIndependentSet(edges)
  • graph_maximum_independent_set(edges)

参数与选项

edges形如 [[u, v], ...] 的无向边列表。

示例

  1. 最大独立集GraphTheory:-MaximumIndependentSet([[a, b], [b, c], [c, a], [c, d]])返回 [a, d]。