edge_add
Signature/Parameters
Add an edge to the graph if it is not already present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edge
|
tuple[str, str] or tuple[tuple[str, str], tuple[str, str]] or set[str]
|
Edge specification compatible with the formats accepted at initialization. Use a two-tuple for directed edges, a set with two nodes for undirected edges, or a pair of directed tuples for bidirected edges. |
required |
Returns:
| Type | Description |
|---|---|
DAG
|
The current instance when the edge already exists; otherwise a new
|
Examples: