graph-builder
Version:
A graph builder library for modeling abstract graph structures.
19 lines (12 loc) • 653 B
Markdown
[Home](./index) > [graph-builder](./graph-builder.md) > [GraphBuilder](./graph-builder.graphbuilder.md) > [allowsSelfLoops](./graph-builder.graphbuilder.allowsselfloops.md)
# GraphBuilder.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): GraphBuilder<N>;
```
**Returns:** `GraphBuilder<N>`
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| `allowsSelfLoops` | `boolean` | |