maximum-matching
Version:
Implementation of Blossom's Algorithm for Maximum Matching
21 lines (20 loc) • 611 B
TypeScript
import { Node } from '../../graphs/Node';
import { BlossomPathDirection } from './BlossomPathDirection';
declare type BlossomConstructor = {
root: Node;
cycle: Node[];
};
export declare class Blossom {
readonly root: Node;
readonly cycle: Node[];
constructor({ root, cycle }: BlossomConstructor);
has(node: Node): boolean;
path(from: Node, to: Node, { direction }?: {
direction?: BlossomPathDirection | undefined;
}): Node[];
evenPath(from: Node, to: Node): Node[];
private ensureOddCycle;
private ensureIsInCycle;
private ensureIsInBlossom;
}
export {};