graph_is_forest 函数
判断每个连通分量是否都无环。
语法
GraphTheory:-IsForest(edges)graph_is_forest(edges)
参数与选项
edges | 形如 [[u, v], ...] 的边列表。 |
|---|
示例
- 森林判断
GraphTheory:-IsForest([[a, b], [c, d]])返回 true。
判断每个连通分量是否都无环。
GraphTheory:-IsForest(edges)graph_is_forest(edges)edges | 形如 [[u, v], ...] 的边列表。 |
|---|
GraphTheory:-IsForest([[a, b], [c, d]])返回 true。