> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ag2.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# autogen.graph_utils.has_self_loops

<code class="doc-symbol doc-symbol-heading doc-symbol-function" />

#### has\_self\_loops

```python theme={null}
has_self_loops(allowed_speaker_transitions: dict[str, list[Agent]]) -> bool
```

Check if there are self loops in the allowed\_speaker\_transitions.<br />

<b>Parameters:</b>

| Name                          | Description                                                                                                                                                                                                                                               |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allowed_speaker_transitions` | A dictionary of keys and list as values.<br /><br />The keys are the names of the agents, and the values are the names of the agents that the key agent can transition<br /><br />**Type:** dict\[str, list\[[Agent](/docs/api-reference/autogen/Agent)]] |

<b>Returns:</b>

| Type | Description                                                              |
| ---- | ------------------------------------------------------------------------ |
| bool | True if there are self loops in the allowed\_speaker\_transitions\_Dict. |

<br />
