MMatchOriel
Product

Product features · Maximum bipartite matching

01

MatchOriel gives allowed assignments and augmenting paths a shared project context so a proposed matching can be checked pair by pair.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Maximum bipartite matching

● ● ●MatchOriel●
A concrete starting point · Maximum bipartite matching ×
def maximum_matching(edges, right_count):
    if type(right_count) is not int or not 0 <= right_count <= 32 or type(edges) not in (list, tuple) or len(edges) > 32:
        raise ValueError("matching.size")
    if any(type(row) not in (set, frozenset) or any(type(v) is not int or not 0 <= v < right_count for v in row) for row in edges):
        raise ValueError("matching.edge")
    owners = [-1] * right_count
    def augment(left, seen):
        for right in sorted(edges[left]):
            if right in seen:
                continue
            seen.add(right)
            if owners[right] == -1 or augment(owners[right], seen):
                owners[right] = left
                return True
        return False
    for left in range(len(edges)):
        augment(left, set())
    return sorted((left, right) for right, left in enumerate(owners) if left != -1)
✳Find a maximum-cardinality matching between two groups of at most 32 vertices from allowed-edge sets.
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗