Library / Code module
Hodge decomposition of edge flows
hodge_edge_flow_decomposition
Split a flow on the edges of a small graph (pairwise preferences, score differences, transfers) into a gradient explained by a global potential, curl circulating around filled triangles, and harmonic circulation around holes. Shows how much of a set of pairwise comparisons is consistent with a single ranking.
ATTRIBUTION.md3.9 KBLICENSE1.0 KBREADME.md3.2 KBatom_cli.py3.0 KBcomponent.json11.7 KBhodge_edge_flow_decomposition.py7.3 KBnumerics.py28.0 KBschema_lite.py8.9 KBtest_hodge_edge_flow_decomposition.py4.2 KBtest_package.py12.0 KB
Full files in your harness.
What it takes and gives
- Runs with
- Python 3.10 or later
- Entry points
- hodge_decomposition, flow_from_potential
- Known answers
- 9 cases its tests reproduce
Cases it covers
- difference flow has no cycle part: Pairwise differences x_u - x_v on a cycle look cyclic but are a gradient by construction; reading them as circulation is the trap.
Limits and scope
- Limits
- Dense least squares through pseudo-inverses: meant for graphs of up to about a hundred edges. Only 2-cells that are triangles are supported. The decomposition is unweighted; weighted HodgeRank (edge weights from comparison counts) is not included. It describes the flow; it does not test whether the curl part is statistically significant.
- Guarantees
- gradient + curl + harmonic equals the flow; the three parts are pairwise orthogonal because B1 B2 = 0. The curl and harmonic parts are divergence-free; the gradient and harmonic parts have zero circulation around every declared triangle. A flow x_u - x_v is a gradient of the potential -x: its curl and harmonic parts are zero on any graph; potentials sum to zero on each connected component.
- Assumes
- The flow on edge (u, v) means flow from u to v; reversing an edge's orientation negates its value. Which 3-cycles count as filled is a modelling choice: declared triangles or every 3-clique.
Details
- Kind
- Code module
- Licence
- MIT
- Declared effects
- runs commands
- Source
- github.com/alisonjieli-png/loop-engine/tools/creative_originals/evaluation_atoms/items/hodge_edge_flow_decomposition
- Size
- 10 files, 83.4 KB
- Identity
library.supply.creative_originals.722a507b5a43e56ea42bbcd8.9134093b5a8acc48- Version
9134093b5a8acc48debe6f39c6cde2714c574d7e2a4c147fc61abbc5b3a3da76
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Where it is shown
- Statistics for comparing resultsDeterministic skills
Related components
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.