# `Yog.Builder.ToroidalGraph`
[🔗](https://github.com/code-shoily/yog_ex/blob/v0.97.0/lib/yog/builder/toroidal_graph.ex#L1)

A specialized grid graph result for toroidal (wrapping) grids.

Structurally identical to `Yog.Builder.GridGraph`, but with its own type
to allow specialized rendering and behavioral hints.

## Fields

- `graph` - The underlying Yog graph
- `rows` - Number of rows in the grid
- `cols` - Number of columns in the grid
- `topology` - Connection pattern (`:rook`, `:queen`, etc.)

# `t`

```elixir
@type t() :: %Yog.Builder.ToroidalGraph{
  cols: non_neg_integer(),
  graph: Yog.graph(),
  rows: non_neg_integer(),
  topology: atom()
}
```

# `coord_to_id`

Converts coordinate to ID.

# `id_to_coord`

Converts ID to coordinate.

# `new`

```elixir
@spec new(Yog.graph(), non_neg_integer(), non_neg_integer(), atom()) :: t()
```

Creates a new toroidal graph result.

# `to_graph`

```elixir
@spec to_graph(t()) :: Yog.graph()
```

Unwraps to a plain graph.

# `to_grid_graph`

```elixir
@spec to_grid_graph(t()) :: Yog.Builder.GridGraph.t()
```

Converts to a standard GridGraph.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
