LazyGraph.is_dag_full, with several starting vertices

This commit is contained in:
Simon Cruanes 2013-03-31 21:28:40 +02:00
parent 856eacb8fc
commit ffbe617c86
2 changed files with 10 additions and 0 deletions

View file

@ -444,6 +444,13 @@ let is_dag graph v =
| _ -> true) | _ -> true)
(Full.dfs_full graph (Gen.singleton v)) (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 *) (** Reverse the path *)
let rev_path p = let rev_path p =
let rec rev acc p = match p with let rec rev acc p = match p with

View file

@ -161,6 +161,9 @@ val is_dag : ('id, _, _) t -> 'id -> bool
(** Is the subgraph explorable from the given vertex, a Directed (** Is the subgraph explorable from the given vertex, a Directed
Acyclic Graph? *) 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 val rev_path : ('id, 'e) path -> ('id, 'e) path
(** Reverse the path *) (** Reverse the path *)