package containers-data

  1. Overview
  2. Docs

More detailed interface

type edge_kind = [
  1. | `Forward
  2. | `Back
  3. | `Cross
]
type ('v, 'e) t = [
  1. | `Enter of 'v * int * ('v, 'e) path
  2. | `Exit of 'v
  3. | `Edge of 'v * 'e * 'v * edge_kind
]

A traversal is a sequence of such events

val get_vertex : ('v, 'e) t -> ('v * [ `Enter | `Exit ]) option
val get_enter : ('v, 'e) t -> 'v option
val get_exit : ('v, 'e) t -> 'v option
val get_edge : ('v, 'e) t -> ('v * 'e * 'v) option
val get_edge_kind : ('v, 'e) t -> ('v * 'e * 'v * edge_kind) option
val dfs : tbl:'v set -> eq:('v -> 'v -> bool) -> graph:('v, 'e) graph -> 'v iter -> ('v, 'e) t iter_once

Full version of DFS.

  • parameter eq

    equality predicate on vertices.

val dfs_tag : eq:('v -> 'v -> bool) -> tags:'v tag_set -> graph:('v, 'e) graph -> 'v iter -> ('v, 'e) t iter_once

Full version of DFS using integer tags.

  • parameter eq

    equality predicate on vertices.

OCaml

Innovation. Community. Security.