---
name: "Stable_matching"
section: "3o"
platform: "linux"
package: "ocaml"
version: "5.5.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Stable_matching"
---

# Stable\_matching(3o)

no description

## NAME

Stable\_matching - no description

## Module

Module   Stable\_matching

## Documentation

Module **Stable\_matching**\
  :  **sig end**

*module Item :* **sig end**

*type left\_index* =  **int**

*type right\_index* =  **int**

*type rank* =  **int**

*type* **('a, 'v)** *matches* = {\
  left :  **'a list** ;\
  pairs :  **('v \* 'v) list** ;\
  right :  **'a list** ;\
  }

*type* **('v, 'k)** *item\_matches* =  **(('v, 'k) Item.t, 'v) matches**

*type unstable\_matching* = {\
  first :  **left\_index \* right\_index** ;\
  second :  **left\_index \* right\_index** ;\
  current\_rank :  **rank \* rank** ;\
  optimal :  **rank \* rank** ;\
  }

*val stable\_matches* :  **distance:(int -\> int -\> int) -\>** **('a, int) matches -\>** **(unit, unstable\_matching) Result.t**

*val strong\_stable\_matches* :  **distance:(int -\> int -\> int) -\>** **('a, int) matches -\>** **(unit, unstable\_matching) Result.t**

*val matches* :  **compatible:(left\_index -\> right\_index -\> bool) -\>** **preferences:(right\_index -\>** **(left\_index \* rank) array) -\>** **size:int \* int -\> (int, int) matches**

**matches ~compatible ~preferences ~size:(ls,rs)** computes a matching between a set of  **ls** left items and  **rs** right items favoring the right side. The matches are compatible and weakly stable according to the  **preferences** matrix. The size of the matching is at least 2/3 of the optimal matching size (computing optimal matching with partial preferences and ties is in NP).

*val fuzzy\_match\_names* :  **compatibility:('k -\> 'k -\> bool) -\>** **max\_right\_items:int -\>** **cutoff:(string -\> int) -\>** **('v, 'k) Item.t list -\>** **('v, 'k) Item.t list -\> ('v, 'k) item\_matches**

**fuzzy\_match\_names ~compatibility ~max\_right\_item ~cutoff left right** calls the  **Stable\_matching.matches** function using the OSA edit distance to compute preferences with a cutoff function. To avoid quadratic complexity on large module size we limit the right side to the first  **max\_right\_item** items
