# RoutingOptions

Import it from `@grafloria/engine`.

Routing options

```ts
interface RoutingOptions
```

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `algorithm?` | `RoutingAlgorithm` |  | Algorithm to use |
| `avoidObstacles?` | `boolean` |  | Avoid obstacles |
| `gridSize?` | `number` |  | Grid cell size for grid-based algorithms |
| `obstacleMargin?` | `number` |  | Margin around obstacles |
| `minimizeBends?` | `boolean` |  | Minimize bends (for orthogonal) |
| `costs?` | `{ distance?: number; bends?: number; crossings?: number; }` |  | Cost weights |
| `maxIterations?` | `number` |  | Maximum iterations for pathfinding |
| `jetty?` | `number` |  | . Minimum port-anchor stub: the route must leave the source and enter the target PERPENDICULAR to the port side for at least this many px before the first bend. When set it also replaces the built-in 20px breathing-room offset, and a link with FLOATING (direction- less) anchors derives its exit sides from the relative geometry instead of taking the stub-less midline fallback. |
| `container?` | `GeometryRectangle` |  | Soft containment. When both endpoints live in the same group, the renderer passes that group's bounds here; grid routers charge `containerPenalty` per step OUTSIDE the container, so sibling edges stay within their container when an inside route exists — without making escape impossible when obstacles force it. |
| `containerPenalty?` | `number` |  | Extra cost per grid step outside `container`. Default: 2 × gridSize. |
| `simplifyPath?` | `boolean` |  | Simplify path to reduce waypoint count |
| `simplificationEpsilon?` | `number` |  | Simplification tolerance (epsilon) - higher values = more aggressive |
