• Connects A with B, returning the changed graph and created edge. If the connection already exists, the original graph & edge is returned.

    Parameters

    • graph: Readonly<{
          edges: readonly Readonly<{
              a: string;
              b: string;
              weight?: number;
          }>[];
          vertices: IMapImmutable<string, Readonly<{
              id: string;
          }>>;
      }>
    • a: string
    • b: string
    • Optionalweight: number

    Returns {
        edge: Collections.Graphs.Undirected.Edge;
        graph: Graph;
    }