> For the complete documentation index, see [llms.txt](https://hub.bsvblockchain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hub.bsvblockchain.org/wiki/the-network/the-bitcoin-network/mandala-network.md).

# Mandala Network

Mandala networks refer to a family of networks which are fast and cost-effective, yet robust against failures and attacks. They are built up in layers, or \***shells/generations**, and their name derives from their visual similarity to Mandala images. They are defined by construction in \[1] as a mathematical graph with certain rules for the distribution of nodes and edges in each shell, and how they connect to nodes in the shell below. They are characterised by being

* Ultra-small-world
* Highly sparse In the basic method for construction, Mandala networks are characterised by three parameters (n\_1, b, \lambda), where n\_1 is the number of nodes in the first generation, b is the number of new nodes added to each node in subsequent shells, and \lambda is the number of connections between nodes in the same shell (other than the first shell). The choice of these parameters determines a **type** of Mandala network, where a unique Mandala network is determined by type and total number of shells g. In the first shell there are n\_1 nodes that form a connected graph. A second shell is created by connecting each node in the first shell with b nodes in the second shell, and connecting each node in the second shell to \lambda nodes in the second shell. This method is used to create a third shell where, in addition, each node is also connected to its ancestor node in the first shell. This process can be repeated iteratively to create g shells. Because each node is connected directly to a node in the first shell, and each node in the first shell is directly to another node in the first shell, the maximum shortest path length between nodes is 3. If the number of nodes in each shell is labelled by n\_i then the total number of nodes on the network is given by

```bash
N = \sum_{i=1}^{g} n_i .
```

Due to the symmetry of the construction, the mean shortest path length is given by

```bash
\langle l \rangle = \sum_{i=1}^{g} n_i \phi_i
```

where \phi\_i is the sum of the shortest path lengths connecting a node in the i-th shell with all other nodes in the network. It can be shown that

```bash
\langle l \rangle = \alpha + \frac{O(N)}{N^2}
```

where \alpha is a constant which may be determined for each network. It can be shown that 1 \leq \alpha , where \alpha \to \frac{8}{3} as N \to \infty.

1. References [(1) Mandala Networks: ultra-small-world and highly sparse graphs\*, Sampaio Filho, C., Moreira, A., Andrade, R. et al. Sci Rep 5, 9082 (2015) doi:10.1038/srep09082](https://www.nature.com/articles/srep09082)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hub.bsvblockchain.org/wiki/the-network/the-bitcoin-network/mandala-network.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
