- connectTo(graph, a, b, weight?): {
edge: Collections.Graphs.Undirected.Edge;
graph: Graph;
} Parameters
- graph: Readonly<{
edges: readonly Readonly<{
a: string;
b: string;
weight?: number;
}>[];
vertices: IMapImmutable<string, Readonly<{
id: string;
}>>;
}> - a: string
- b: string
Optional
weight: number
Connects A with B, returning the changed graph and created edge. If the connection already exists, the original graph & edge is returned.