4 * Copyright (C) 2005 - 2007 Imagine S.A.
5 * For more information or commercial use please contact us at www.amesim.com
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 (** This module provides a graph structure over which it is possible to apply
24 an algorithm that finds the strongly connected components of this graph. *)
27 (** The type of the graph used to perform the strongly connected component
31 (** [create size] creates a graph with [size] unconnected nodes. *)
33 val connect: int -> int -> t -> unit
34 (** [connect i j g] connects the [i]th node to the [j]th one in g. *)
36 val strongly_connected_components: t -> int list list
37 (** [strongly_connected_components g] returns the stronly connected components
38 of [g] as a list of index lists. *)
40 val print_with: (int -> unit) -> t -> unit
41 (** [print_with print_fun g] prints the connexions in [g] using [print_fun]. *)