sublinear-solver
Skill94 starsChanged 10 days agoMITView on GitHub
Solve sparse diagonally dominant linear systems, rank graph nodes with PageRank / personalized PageRank, or get local top-k scores with forward/backward push, using @ruvnet/sublinear-core (zero dependencies) or the sublinear-time-solver MCP server. Use when a task needs A x = b on a sparse matrix, node importance in a graph, "related items" from a seed node, or a single entry of a large solution.
- Installs packages
In this repository2 other files it gives its agents.
- .claude/commands/monitoring/agents.mdAGENTS.md
- sublinear-solverSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Check converged and residual before relying on x.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sublinear solver
Pick the entry point
- Library code:
npm i @ruvnet/sublinear-core. It has 0 dependencies and provides ESM, CJS and types. - Agent tools: the MCP server
npx -y sublinear-time-solver serve. The tools to use aresolve,pageRank,estimateEntryandanalyzeMatrix. - Rust:
cargo add sublinear.
Recipes
import { solve, graphFromEdges, pageRank, personalizedPageRank, forwardPush, backwardPush, estimateEntry, topK } from '@ruvnet/sublinear-core';
// A x = b. A is COO {rows, cols, rowIndices, colIndices, values}, dense rows, or a CsrMatrix.
const { x, residual, converged, method } = solve(A, b, { tolerance: 1e-10 });
// Graph ranking with string ids; edges are [source, target, weight?].
const g = graphFromEdges(edges);
topK(pageRank(g).scores, 10, g);
topK(personalizedPageRank(g, seedId, { damping: 0.85 }).scores, 10, g);
// Large graph, local answer: the cost depends on epsilon, not on n.
topK(forwardPush(g, seedId, { epsilon: 1e-6 }).scores, 10, g);
backwardPush(g, targetId); // ppr_s(target) for every source s
// One entry of x without solving for all of x (requires strict row diagonal dominance).
estimateEntry(A, b, i, { walks: 20000 }); // { estimate, standardError }Rules
dampingis the probability of following an edge. A restart probability α meansdamping = 1 - α.- Check
convergedandresidualbefore relying onx. The residual is recomputed from the returned vector. - Jacobi, Neumann and Gauss-Seidel need diagonal dominance. Conjugate gradient needs a symmetric positive definite matrix.
method: 'auto'picks between them. - A full solution vector costs time linear in nnz per iteration. Only
forwardPush,backwardPushandestimateEntryhave a cost independent of n. - The MCP
solveTrueSublineartool is approximate. Check itsverified_relative_residual, or usesolvewhen you need accuracy. - The consciousness, psycho-symbolic, emergence and temporal-lead MCP tools are experimental simulations, not solvers.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

