Skip to main content
Glama

hopcroft_karp

Computes maximum bipartite matching from left and right vertex counts plus edge pairs using the Hopcroft-Karp algorithm in O(E√V) time.

Instructions

Find maximum matching in a bipartite graph using the Hopcroft-Karp algorithm in O(E * sqrt(V)).

Input Schema

NameRequiredDescriptionDefault
edgesYesEdges as [left_vertex, right_vertex] pairs
left_sizeYesNumber of vertices on the left side
right_sizeYesNumber of vertices on the right side

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It usefully discloses the algorithm and time complexity O(E * sqrt(V)), but it does not describe the return format, vertex indexing assumptions, or behavior for empty/invalid graphs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single front-loaded sentence that includes the purpose, algorithm, and complexity. Every part earns its place, with no wasted wording.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is only partially complete. It explains the algorithm and complexity but omits the return value shape and indexing conventions, which an agent would need to use the result correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters. The description references E and V but adds no further meaning beyond what the schema provides, such as whether vertices are zero-indexed or how edge pairs map to sizes.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: finding a maximum matching in a bipartite graph. It also names the exact algorithm, Hopcroft-Karp, which distinguishes it from sibling tools like dinic_max_flow, edmonds_karp, and hungarian_assign.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool: for maximum matching in a bipartite graph. However, it gives no explicit guidance on alternatives or when not to use it, such as preferring a different algorithm for weighted or general graphs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools