import type { Fn2 , Pair } from "@thi.ng/api" ; export type DegreeType = "in" | "out" | "inout" ; typeParam export interface IGraph < T = number > { numEdges ( ) : number ; numVertices ( ) : number ; /**
     * Returns iterator of all edges in the graph. Each edge is a tuple of
     * `[from, to]`. For undirected graphs each edge will only be emitted once.
     */ edges ( ) : IterableIterator < Edge < T > > ; /**
     * Attempts to add an edge between given vertex IDs. Depending on the actual
     * implementation, only max. 1 edge per unique vertex pair is supported
     * (currently only  AdjacencyList supports multi-edges). If the graph
     * is undirected, a symmetric edge might be created automatically. Returns
     * true, if the edge was created.
     *
     *  param from param to addEdge ( from , to ) : boolean ; param from param to removeEdge ( from , to ) : boolean ; param from param to hasEdge ( from , to ) : boolean ; /**
     * Returns number of edges for given vertex. By default only outgoing edges
     * are counted, but can be customized via given  DegreeType . Note: In
     * undirected graphs the `type` has no relevance and essentially is always
     * `"inout"`.
     *
     *  param id param type degree ( id , type ? ) : number ; param id neighbors ( id ) : Iterable < number > ; /**
     * Only useful for directed graphs. Returns a new graph in which the
     * direction of edges is inverted/flipped. I.e. an edge `a -> b` becomes `b
     * -> a`.
     */ invert ( ) : IGraph < T > ; } export type Edge < T = number > = Pair < T , T > ; export type CostFn < T = number > = Fn2 < T , T , number > ;