maximum-matching
Version:
Implementation of Blossom's Algorithm for Maximum Matching
21 lines (20 loc) • 555 B
TypeScript
import { Node } from './Node';
declare type TreeConstructor = {
parent?: Tree;
elem: Node;
children: Tree[];
};
export declare class Tree {
private readonly parent?;
private readonly elem;
private readonly children;
constructor(p: TreeConstructor);
static withRoot(root: Node): Tree;
findSubtree(node: Node): Tree | undefined;
findSubtreeOrFail(node: Node): Tree;
has(node: Node): boolean;
addChild(node: Node): Tree;
pathToRoot(node: Node): Node[];
distanceToRoot(node: Node): number;
}
export {};