graph-builder
Version:
A graph builder library for modeling abstract graph structures.
22 lines (14 loc) • 683 B
Markdown
[Home](./index) > [graph-builder](./graph-builder.md) > [BaseGraph](./graph-builder.basegraph.md) > [hasEdge](./graph-builder.basegraph.hasedge.md)
# BaseGraph.hasEdge method
Returns true if there is an edge that directly connects `nodeU` to `nodeV`<!-- -->. This is equivalent to `nodes().contains(nodeU) && successors(nodeU).contains(nodeV)`<!-- -->.
In an undirected graph, this is equal to `hasEdgeConnecting(nodeV, nodeU)`<!-- -->.
**Signature:**
```javascript
hasEdge(nodeU: N, nodeV: N): boolean;
```
**Returns:** `boolean`
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| `nodeU` | `N` | |
| `nodeV` | `N` | |