Create a graph

let g = graph();

Can optionally provide initial connections:

let g = graph(
{ from: `a`, to: `b` },
{ from: `b`, to: `c` }
)
  • Parameters

    • Rest...initialConnections: Readonly<{
          bidi?: boolean;
          from: string;
          to: string | string[];
          weight?: number;
      }>[]

    Returns Readonly<{
        vertices: IMapImmutable<string, Readonly<{
            id: string;
            out: readonly Readonly<{
                id: string;
                weight?: number;
            }>[];
        }>>;
    }>