graph-builder
Version:
A graph builder library for modeling abstract graph structures.
19 lines (12 loc) • 689 B
Markdown
[Home](./index) > [graph-builder](./graph-builder.md) > [ValueGraphBuilder](./graph-builder.valuegraphbuilder.md) > [allowsSelfLoops](./graph-builder.valuegraphbuilder.allowsselfloops.md)
# ValueGraphBuilder.allowsSelfLoops method
Specifies whether the graph will allow self-loops (edges that connect a node to itself). Attempting to add a self-loop to a graph that does not allow them will throw an error.
**Signature:**
```javascript
allowsSelfLoops(allowsSelfLoops: boolean): ValueGraphBuilder<N, V>;
```
**Returns:** `ValueGraphBuilder<N, V>`
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| `allowsSelfLoops` | `boolean` | |