Functor Wstdlib.MakeSCC

module MakeSCC: 
functor (H : Exthtbl.S) -> sig .. end
Parameters:
H : Exthtbl.S

type vertex = H.key 
type 'a source = 'a -> vertex 
type 'a adjacency = (vertex -> unit) -> 'a -> unit 
val scc : 'a source ->
'a adjacency -> 'a list -> (bool * 'a list) list

scc src adj gr takes a directed graph gr represented as a list of adjacency descriptors of type 'a. Each descriptor d in gr contains a single source vertex src d. The function adj takes a vertex visitor fn and a descriptor d, and iterates over d, applying fn to each vertex adjacent to src d. It is allowed to apply fn to vertices outside gr. The result of scc is a list of strongly connected components in a topological order. Each component is represented as a non-empty list of descriptors whose sources constitute the component, together with a Boolean flag indicating the presence of cycles inside the component. This flag is always true for non-singleton components.