Version & licenses
Creative Commons License

Matching.S

Guyslain Naves
  1. module type S =
  2. sig
  3. module P : Path.S

  4. (** The type of matchings *)
  5. type t

  6. (** The edge set of a matching *)
  7. val edges : t -> P.G.E.t

  8. (** The set of vertices covered by a given matching *)
  9. val covered : t -> P.G.V.t

  10. (** The set of vertices not covered by a given matching *)
  11. val uncovered : t -> P.G.V.t

  12. (** The graph on which the matching is defined *)
  13. val graph : t -> P.G.graph

  14. (** an empty matching in a given graph *)
  15. val empty : P.G.graph -> t

  16. (** adding an edge into a matching *)
  17. val add_edge : t -> P.G.edge -> t

  18. (** removing an edge from a matching *)
  19. val remove_edge : t -> P.G.edge -> t

  20. (** [matched_to m u] is [None] if [u] is not matched in [m], or [Some (e,v)] where [e] is
  21. the edge of [m] containing [u] and [v] is its other endpoint.
  22. *)
  23. val matched_to : t -> P.G.vertex -> (P.G.edge * P.G.vertex) option

  24. (** [contract_blossom m cycle], given an alternate cycle of odd length,
  25. where the endpoint of [cycle] is the vertex not matched inside [cycle],
  26. contracts [cycle] in the subjacent graph and the matching, leaving only this endpoint.
  27. *)
  28. val contract_blossom : t -> P.t -> t

  29. (** [augment m path], where [p] is an augmenting path, returns a new matching
  30. obtaind by symmetric difference with the edge set of [path] *)
  31. val augment : t -> P.t -> t

  32. end