---
library: "brainference"
slug: "DegreeEntropy"
name: "DegreeEntropy"
ref: "DegreeEntropy#a793"
hash: "sema:DegreeEntropy#mh:SHA-256:a793cb859ab1915416e67b257770a97d4810b2ac751247aba715530df2d69297"
type: "Primitives"
layer: "Infrastructure"
version: "1.0.0"
root: "8d7193fc97804cdc3aa9080728d8094732206c114f34d36b8ca2b89b943b3990"
license: null
url: "https://semahash.org/vocabularies/brainference/patterns/DegreeEntropy"
---

# DegreeEntropy

Entropy of how connectivity is spread over the nodes of a network: local heterogeneity

Infrastructure · Primitives

## Mechanism

For a network with N nodes and degree sequence k_1..k_N, normalise each node's share of all links, p_i = k_i / sum_j k_j, and take H_d = -sum_i p_i log2 p_i, the [ShannonEntropy](https://semahash.org/vocabularies/brainference/patterns/ShannonEntropy.md) of that share. H_d is maximal (log2 N) when every node has the same degree and falls as connectivity concentrates on a few hubs. It measures how evenly interaction opportunities are distributed, i.e. the diversity of local pathways. For a directed graph, k_i can be the total degree (in-degree plus out-degree), which discards direction. Note that p_i runs over nodes, not over degree classes, so H_d also grows with N; normalise by N or by an area to compare networks of different size.

## Invariants

- Computed from the degree sequence alone, ignoring which nodes are linked to which
- Maximal when all degrees are equal, minimal when connectivity is concentrated
- Grows with node count, so raw values are not comparable across networks of different size

## Failure modes

- Comparing raw H_d across networks of different size and mistaking size for structure
- Using total degree on a directed graph and losing the asymmetry between incoming and outgoing links
- Confusing this node-share form with the entropy of the degree distribution P(k)

## Where this came from

- Thesis: do_2026_ant_collective_behavior (Ch. 1.3.3, Eqs. 1.6-1.7; Ch. 3.2.2, Eq. 3.26)

## Builds on

- [ShannonEntropy](https://semahash.org/vocabularies/brainference/patterns/ShannonEntropy.md) (references)

## Used by

- [InteractionSequenceEntropySignature](https://semahash.org/vocabularies/brainference/patterns/InteractionSequenceEntropySignature.md) (composes_with)
- [SecondOrderInteractionNetwork](https://semahash.org/vocabularies/brainference/patterns/SecondOrderInteractionNetwork.md) (composes_with)
- [SpectralEntropy](https://semahash.org/vocabularies/brainference/patterns/SpectralEntropy.md) (composes_with)

## Identity

- Library: brainference 1.0.0 (root 8d7193fc9780)
- Ref: DegreeEntropy#a793
- Hash: sema:DegreeEntropy#mh:SHA-256:a793cb859ab1915416e67b257770a97d4810b2ac751247aba715530df2d69297

## Links

- Page: https://semahash.org/vocabularies/brainference/patterns/DegreeEntropy
- JSON: https://semahash.org/vocabularies/brainference/patterns/DegreeEntropy.json
- Library: https://semahash.org/vocabularies/brainference
- Library index: https://semahash.org/vocabularies/brainference/index.json
