graph-builder
Version:
A graph builder library for modeling abstract graph structures.
20 lines (13 loc) • 638 B
Markdown
[Home](./index) > [graph-builder](./graph-builder.md) > [GraphConnections](./graph-builder.graphconnections.md) > [addPredecessor](./graph-builder.graphconnections.addpredecessor.md)
# GraphConnections.addPredecessor method
Add `node` as a predecessor to the origin node. In the case of an undirected graph, it also becomes a successor. Associates `value` with the edge connecting the two nodes.
**Signature:**
```javascript
addPredecessor(node: N, value: V): void;
```
**Returns:** `void`
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| `node` | `N` | |
| `value` | `V` | |