addVertexAndEdge

open fun addVertexAndEdge(vertex: T, edgeFrom: T, edgeTo: T): Graph<T>

Adds a vertex and an edge in a single operation.

Return

a new graph instance with both the vertex and edge added

Parameters

vertex

the vertex to add

edgeFrom

the source vertex of the edge

edgeTo

the destination vertex of the edge