MathTop

graph_is_connected 函数

判断图中任意顶点是否彼此可达。

语法

  • GraphTheory:-IsConnected(edges)
  • graph_is_connected(edges)

参数与选项

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

示例

  1. 连通图GraphTheory:-IsConnected([[a, b], [b, c], [c, a], [c, d]])返回 true。