sig
  type pos = { x : float; y : float; }
  module type S =
    sig
      type t
      type vertex
      module H :
        sig
          type key = vertex
          type 'a t
          val create : int -> 'a t
          val clear : 'a t -> unit
          val reset : 'a t -> unit
          val copy : 'a t -> 'a t
          val add : 'a t -> key -> '-> unit
          val remove : 'a t -> key -> unit
          val find : 'a t -> key -> 'a
          val find_all : 'a t -> key -> 'a list
          val replace : 'a t -> key -> '-> unit
          val mem : 'a t -> key -> bool
          val iter : (key -> '-> unit) -> 'a t -> unit
          val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
          val length : 'a t -> int
          val stats : 'a t -> Hashtbl.statistics
        end
      val layered :
        distance:(Tree_layout.S.vertex -> Tree_layout.S.vertex -> float) ->
        Tree_layout.S.t ->
        Tree_layout.S.vertex -> Tree_layout.pos Tree_layout.S.H.t
      val boundaries :
        ?margins:Tree_layout.pos ->
        Tree_layout.pos Tree_layout.S.H.t ->
        Tree_layout.pos * Tree_layout.pos
    end
  module type TREE =
    sig
      type t
      module V : Hashtbl.HashedType
      val children : Tree_layout.TREE.t -> V.t -> (V.t -> unit) -> unit
      val rev_children : Tree_layout.TREE.t -> V.t -> (V.t -> unit) -> unit
      val rightmost_child : Tree_layout.TREE.t -> V.t -> V.t option
      val leftmost_child : Tree_layout.TREE.t -> V.t -> V.t option
      val is_parent : Tree_layout.TREE.t -> parent:V.t -> child:V.t -> bool
    end
  module Make :
    functor (G : TREE->
      sig
        module H :
          sig
            type key = G.V.t
            type 'a t
            val create : int -> 'a t
            val clear : 'a t -> unit
            val reset : 'a t -> unit
            val copy : 'a t -> 'a t
            val add : 'a t -> key -> '-> unit
            val remove : 'a t -> key -> unit
            val find : 'a t -> key -> 'a
            val find_all : 'a t -> key -> 'a list
            val replace : 'a t -> key -> '-> unit
            val mem : 'a t -> key -> bool
            val iter : (key -> '-> unit) -> 'a t -> unit
            val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
            val length : 'a t -> int
            val stats : 'a t -> Hashtbl.statistics
          end
        val layered :
          distance:(G.V.t -> G.V.t -> float) -> G.t -> G.V.t -> pos H.t
        val boundaries : ?margins:pos -> pos H.t -> pos * pos
      end
end