• Connect from -> to. Same as connect except you get back the edges as well.

    By default unidirectional, meaning a connection is made only from->to. Use bidi option to set a bidirection connection, adding also to->from.

    Returns a result of { graph, edges }, where graph is the new DirectedGraph and edges is an array of Edges. One for unidirectional, or two for bidirectional.

    Parameters

    • graph: Readonly<{
          vertices: IMapImmutable<string, Readonly<{
              id: string;
              out: readonly Readonly<{
                  id: string;
                  weight?: number;
              }>[];
          }>>;
      }>
    • options: Readonly<{
          bidi?: boolean;
          from: string;
          to: string | string[];
          weight?: number;
      }>

    Returns {
        edges: Collections.Graphs.Directed.Edge[];
        graph: DirectedGraph;
    }