> 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/nearly-complete-graph.md).

# Nearly Complete Graph

A graph is a collection of vertices and edges. A graph is complete if there is an edge connecting every vertex to every other vertex. A graph is nearly complete if it can be obtained by removing a small number of edges from a complete graph relative to the size of the graph.

1. Mathematical Definition Consider a graph with vertices v, edges e, and genus g. Calculate

```bash
: X = (e - 3v + 6)/6 .
```

Let \lceil X \rceil denote the smallest integer greater than or equal to X. All graphs satisfy Euler's lower bound : g \geq \lceil X \rceil . For complete graphs g =\lceil X \rceil and the bound is saturated. One may start with a complete graph and remove p edges such that the remaining graph satisfies

* Euler's lower bound is saturated g =\lceil X \rceil
* The graph is connected Let NC(n) denote the maximum number of possible edge removals from the complete graph K\_n such that the above two properties hold no matter which edges are removed. A graph with n vertices is **nearly complete** if it can be obtained by removing p \leq NC(n) edges from the complete graph K\_n.

1. References

* [The genus of nearly complete graphs-case 6, Jonathan L. Gross, Aeq. Math. 13, 243–249 (1975) doi:10.1007/BF01836527](https://link.springer.com/article/10.1007/BF01836527)


---

# 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/nearly-complete-graph.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.
