Every home game is tangled: some money flows straight uphill from fish to shark, some just churns in circles between three players who keep trading the same stack back and forth. This tool takes a chip-transfer log and mathematically splits it into those two pieces โ the clean hierarchy and the leftover chaos.
Read the ladder as "who is structurally upstream of whom," not moral judgment โ a player can sit low on the ladder after one unlucky session and it means nothing about next week.
Grounded in "Disentangling Large-Scale Supply Networks: f-HiCoNE Framework for Flow-Hierarchical Clustering via Combinatorial Hodge Decomposition" โ arXiv:2604.04538.
The real finding: real supply/transaction networks (the paper studies ~650,000 firms) are not clean acyclic hierarchies โ they're entangled with cyclic flows. Combinatorial Hodge decomposition splits any weighted directed flow graph into a gradient component (an acyclic hierarchy, described by a scalar potential per node, solved via a graph-Laplacian least-squares system) and a cyclic/curl component (pure circulation that doesn't move anyone's rank). The potentials line up with real upstream/downstream firm positioning.Scale note: this demo runs the identical linear algebra โ build the weighted flow graph, solve the graph-Laplacian least-squares system for a scalar potential, subtract to get the residual โ on a poker table instead of 650,000 firms, and stops after the Hodge split (it doesn't reproduce the paper's downstream community-clustering stage).
1Feed it a chip-transfer log
One transaction per line (commas also work): Winner beats Loser amount โ e.g. Shark beats Fish1 400. Amount is the size of the pot that changed hands.
Players
โ
Chips in circulation
โ
Hierarchy score (variance explained by rank, not churn)
โ
2Watch it split
Raw table graph
Every transaction as it actually happened โ winner and loser, arrow points toward whoever received the chips. This is the messy, uninterpreted input.
โผ combinatorial hodge decomposition (graph-Laplacian least squares) โผ
๐ช Hierarchy ladder (gradient)
Players ranked by scalar potential ฮฆ โ the acyclic ranking that best explains the flows. Arrows climb the ladder; width = strength of that hierarchical edge.
๐ Chaos loop (curl / residual)
What's left after the hierarchy is subtracted out โ chips circulating in loops that don't move anyone's rank. Thin/absent edges mean that relationship is pure hierarchy, no churn.
3Full breakdown per player
Rank
Player
Potential ฮฆ
Net winnings
Total volume
What's actually being computed.
1. For every pair of players, net their transactions into one signed flow x_ij (net chips moved iโj) and one confidence weight w_ij (total volume traded between them).
2. Build the weighted graph Laplacian L from w_ij, and the divergence vector div(x). Solve (L + J/n)ยทฮฆ = -div(x) for the scalar potential ฮฆ โ a small linear system, solved here with real Gaussian elimination (no library). J/n is the standard trick for pulling the minimum-norm solution out of a graph Laplacian's singular null space (potentials are only meaningful up to a shared constant, so we recenter them to mean zero).
3. The gradient component on edge iโj is ฮฆ_j โ ฮฆ_i โ the flow a clean hierarchy would predict. The residual x_ij โ (ฮฆ_j โ ฮฆ_i) is the curl/cyclic component โ the part no ranking can explain, because it's circulating.
4. Hierarchy score = 1 โ (weighted residual sum of squares) / (weighted total sum of squares). 1.0 = perfectly hierarchical, 0.0 = pure circulation (see the "pure circular churn" preset, where it's exactly 0).