mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
LazyGraph.is_dag_full, with several starting vertices
This commit is contained in:
parent
856eacb8fc
commit
ffbe617c86
2 changed files with 10 additions and 0 deletions
|
|
@ -444,6 +444,13 @@ let is_dag graph v =
|
|||
| _ -> true)
|
||||
(Full.dfs_full graph (Gen.singleton v))
|
||||
|
||||
let is_dag_full graph vs =
|
||||
Gen.for_all
|
||||
(function
|
||||
| Full.MeetEdge (_, _, _, Full.EdgeBackward) -> false
|
||||
| _ -> true)
|
||||
(Full.dfs_full graph vs)
|
||||
|
||||
(** Reverse the path *)
|
||||
let rev_path p =
|
||||
let rec rev acc p = match p with
|
||||
|
|
|
|||
|
|
@ -161,6 +161,9 @@ val is_dag : ('id, _, _) t -> 'id -> bool
|
|||
(** Is the subgraph explorable from the given vertex, a Directed
|
||||
Acyclic Graph? *)
|
||||
|
||||
val is_dag_full : ('id, _, _) t -> 'id Gen.t -> bool
|
||||
(** Is the Graph reachable from the given vertices, a DAG? See {! is_dag} *)
|
||||
|
||||
val rev_path : ('id, 'e) path -> ('id, 'e) path
|
||||
(** Reverse the path *)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue