UNPKG

gramoloss

Version:

Graph theory package for edition and computation

37 lines (36 loc) 1.57 kB
import { Graph } from "../graph"; import { Option } from "../option"; import { Vertex } from "../vertex"; /** * @param m is the TRANSPOSED adjacency matrix of a directed graph * @todo CHECK for loops * * An arc u->v is said to be heavy if there exists vertices a, b, c such that * - a -> b -> c -> a is a cycle * - a,b,c -> u * - v -> a,b,c * * @returns undefined if there is no heavy arc (in that case the matrix is light) * @returns [u,v,a,b,c] where u->v is an heavy arc */ export declare function searchHeavyArc(m: Array<Array<boolean>>): Option<Array<number>>; /** * We suppose u->v * @param outNeighbors * @param inNeighbors * @param u * @param v * @returns */ export declare function searchHeavyArcDigraphAUXlocal(outNeighbors: Array<Array<number>>, inNeighbors: Array<Array<number>>, u: number, v: number): Array<number>; export declare function searchLocalHeavyArcMatrix(matrix: Array<Array<boolean>>, u: number, v: number): Array<number>; export declare function searchHeavyArcDigraphAUX(g: Graph): Array<Vertex>; export declare function searchHeavyArcDigraph(g: Graph): Array<Vertex>; /** * A tournament is light if there is no arc uv such that there exists a cycle abc such that abc dominates u and v dominates abcs. * If you want to get a conflict, if there is some, use the function tournamentLightConflict * @param g * @returns */ export declare function isTournamentLight(g: Graph): boolean; export declare function hasLightTournamentExtension2(g: Graph): [boolean, Array<[number, number, boolean, Array<[number, number]>, boolean]>];