docs/Related Notes

Related Notes#

Under Related, each page lists notes it never links to but probably belongs with.

No tags to maintain, no configuration, no embeddings, no model. The answer is already in the graph.

The idea#

Two ideas from bibliometrics, both about sixty years old, both a few lines of set arithmetic:

  • Bibliographic coupling — two notes that link to the same third note are probably about related things.
  • Co-citation — two notes that are linked to by the same note are also probably related.

Neither needs to know what any note says. Both fall out of a structure you built by hand, one wikilink at a time, while thinking about something else.

The formula#

For notes X and Y, let In(n) be the notes linking to n and Out(n) the notes n links to.

weight(n)   = 1 / log2(2 + degree(n))

shared(X,Y) = sum of weight(n) for n in Out(X) & Out(Y)
            + sum of weight(n) for n in In(X)  & In(Y)

score(X,Y)  = shared(X,Y) / (sqrt(|N(X)|) * sqrt(|N(Y)|))

Three details do the real work.

The hub cap. A neighbour with a degree above hub_cap (32 by default) is skipped entirely. An index page that links to two hundred notes says nothing about how any two of them relate — without the cap it would make everything related to everything, and produce twenty thousand pairs on its own.

The weight. Among neighbours that survive the cap, popular ones still count for less. Sharing an obscure reference is stronger evidence than sharing a common one.

The denominator. Dividing by the size of both neighbourhoods is what stops well-connected notes from appearing in everyone's list. Without it, "related" degenerates into "busiest".

Directly linked notes are excluded#

If X already links to Y, Y is not offered as related to X. You put that link there; you know about it, and it is in the Backlinks panel anyway. Related is for the connection you did not make on purpose.

Showing your work#

mdssg doctor --explain-related "Seed Pages"
related to Seed Pages:
  Backlinks                    via Wikilinks, How It Works
  Configuration                via Getting Started

Being able to ask why matters more than it sounds. A recommendation nobody can interrogate is indistinguishable from a random one, and this way a bad suggestion points straight at the link that caused it.

Turning it off#

[related]
enabled = false
count = 5
hub_cap = 32

Connections