A Network-Control Approach to a
Learning-Optimal Brain State

Dhruv Singh

Work in progress · a personal project · July 2026 · code at github.com/DhruvSingh0905/cognitive-substrate-map

Status — a math experiment, not a research contribution. Nothing here is novel. Every method is off-the-shelf, applied to a public knowledge graph as a way to learn the machinery. The full chain does run end to end — substrate, propagation, controllability, objective, uncertainty, optimizer — and the result (§7) survives a nonlinear cross-check (§8), but it is a model exercise, not a finding anyone should act on. Personal project, not peer-reviewed. Feedback welcome.

Overview. This project treats a biomedical knowledge graph as a signed, directed control system and asks a simple question with a hard answer: which genes would you nudge, and by how much, to move the brain toward a state that's good for learning — without disturbing everything else? Starting from PrimeKG[1] (129,375 nodes), I scope down to a 280-node "brain core" (2,871 signed edges, with a 200-node feedback loop), push perturbations through it with a random-walk-with-restart[4], and use control theory[9] to ask what the network can even be steered to. The scoring objective, the uncertainty analysis[12], and the optimizer[15] now run end to end. Crucially, the optimizer may only push un-defended upstream drivers, not defended hubs like BDNF (which are moved indirectly). The result: CAMK2B is the standout single lever, with a small optimal set and steep diminishing returns rather than a synergistic stack; the benefit is modest and honest, and it holds under a nonlinear cross-check. What's built is checked against curated edges (8/8). The output is a ranking of interventions and a trade-off map — not fold-change predictions, and not a protocol.

What this is not. A contribution. The methods are all standard — Personalized PageRank, Liu–Barabási controllability, ε-constraint Pareto, Monte-Carlo uncertainty — and the inputs are weak: a sparse, sign-only graph and a hand-built target vector. The interesting part is the plumbing — wiring those pieces together honestly and seeing what falls out — not the answer it produces. Treat every number here as an exercise, not evidence.


1. Substrate

The base graph is PrimeKG[1] — 129,375 nodes and about 4 million edges across ten types (genes, drugs, diseases, pathways, and so on). It comes from the Hetionet / Rephetio line of work[2], which scores paths through a graph like this to repurpose drugs.

Most of that graph has nothing to do with learning, so I keep only genes that are mostly expressed in brain tissue. The score for a gene $v$ is the fraction of the tissues it appears in that are brain tissue, over PrimeKG's anatomy_protein_present edges $E_a$:

$$e(v)=\frac{\bigl|\{a:(v,a)\in E_a,\ a\in A_{\mathrm{brain}}\}\bigr|}{\bigl|\{a:(v,a)\in E_a\}\bigr|},\qquad \text{keep if } e(v)\ge 0.15 \ \wedge\ \deg_a(v)\ge 5 \tag{1}$$

In words — keep a gene only if a decent share of the tissues it's active in are brain, and only if it's active in enough places for that share to mean something.

After pruning: 280 nodes in four layers — 70 intervention "knobs", 15 systemic inputs, 6 disease readouts, 2 off-limits, and 187 one-hop neighbors — with 3,912 directed edges (2,871 signed: 2,253 activating, 618 inhibiting) and a single 200-node feedback loop.

substrate
Figure 1. The 280-node substrate, colored by layer; node size grows with degree. The dense core is the feedback machinery.

2. The propagation operator

Put the edges in a matrix $W$: the entry $W_{ij}$ is $+1$, $-1$, or $0$ for the effect of gene $j$ on gene $i$ (oriented so $(Wx)_i$ is what flows into $i$). A hub gene with many out-edges would swamp everything, so I divide each gene's column by its out-degree — the same trick as Google's PageRank[3] ($d^{\mathrm{out}}_j=\sum_i|W_{ij}|$):

$$\hat{W}=W\,D_{\mathrm{out}}^{-1},\qquad \hat{W}_{ij}=\frac{W_{ij}}{\sum_k|W_{kj}|} \tag{2}$$

In words — spread each gene's outgoing effect evenly across the genes it points at, so one gene that talks to everyone can't dominate.

Each column now sums to 1 in absolute value, which forces the largest eigenvalue to be $\le 1$ (Perron–Frobenius) and keeps the next step stable (measured: $\rho(\hat W)=0.544$). Dividing by out-degree is the right move for a directed graph, where the problem is out-hubs; the symmetric GCN version $D^{-1/2}\tilde W D^{-1/2}$[6] is for undirected graphs.

out-degree distribution
Figure 2. Out-degree across the 280 genes is heavy-tailed — most point at a handful of others, while a few hubs point at dozens (RELA at 114). That tail is why the normalization matters.

3. Propagation by random-walk-with-restart

To see what a nudge does, push a signal $p$ into one gene and let it spread — but pull a fraction $\alpha$ back to the source at each step, so it stays near where it started[5],[4]:

$$x^{(t+1)}=(1-\alpha)\,\hat{W}x^{(t)}+\alpha\,p \tag{3}$$

In words — at each step, spread the signal one hop, but yank a fixed slice $\alpha$ of it back to the gene you started from.

Solving for the value it settles to gives a closed form (a sum over every path length $k$):

$$x^{*}=\alpha\bigl(I-(1-\alpha)\hat{W}\bigr)^{-1}p=\alpha\sum_{k\ge0}(1-\alpha)^{k}\hat{W}^{k}p \tag{4}$$

In words — the settled response; each extra hop is discounted by $(1-\alpha)^k$, so far-away genes barely feel it.

Because far hops are discounted, the effect stays local — most of the signal is gone within a few hops. The 200-node feedback loop is why we solve for a settled value instead of taking a single push.

decay vs hop distance
Figure 3. Measured on the real graph: perturb CREB1 and the response $|x^*|$ drops about 10× per hop. Straight line on a log axis = exponential decay, exactly the $(1-\alpha)^k$ term.

4. Controllability

Can a few inputs steer the whole thing? Written as a linear system with input map $B$ (the genes we can drive), $\dot{x}=Wx+Bu$, it's fully steerable when the controllability matrix has full rank (Kalman[7]):

$$\operatorname{rank}\mathcal{C}=N,\qquad \mathcal{C}=[\,B,\ WB,\ W^{2}B,\ \dots,\ W^{N-1}B\,] \tag{5}$$

In words — you can reach any state exactly when your inputs, pushed through more and more hops, together cover all $N$ directions.

Testing that directly is impractical at this size, so I use structural controllability (Lin[8]; Liu–Slotine–Barabási[9]): the fewest genes you must control is the number left unmatched after pairing up the network as well as possible,

$$N_{D}=\max\bigl(N-|M^{*}|,\ 1\bigr) \tag{6}$$

In words — match each gene to one it directly drives; whatever's left over is what you have to control by hand.

The matching is found with Hopcroft–Karp[10]. The result: all 280 genes are reachable, but full control would need 81 driver genes and only 37 of those are druggable — so you can't push it to any state you like. You can steer the readouts you actually care about (target control[11]), which takes fewer inputs, and that's the setting the optimizer works in.

driver nodes
Figure 4. The 81 driver genes on the substrate (orange), of which 37 are druggable (green). The rest of the network (grey) is steered indirectly through them.
Table 1. Controllability of the substrate.
quantityvalue
druggable inputs $|\mathcal D|$172
reachable $|R|/N$280 / 280
min drivers $N_D$ (full control)81
drivers that are druggable37 / 81
feedback component (SCC)200

Formal target controllability

"You can steer the readouts" was an assumption above. The actual test: with outputs $y=Cx$ selecting the scored targets $S$, that set is fully controllable iff the target-controllability matrix has full row rank[11]:

$$\operatorname{rank}\bigl[\,CB,\ C\hat{W}B,\ C\hat{W}^{2}B,\ \dots\,\bigr]\;=\;|S|$$

In words — count how many independent directions of the target state your inputs can actually reach. Fewer than $|S|$ means you can push it along a subspace, but not drive it anywhere you like.

Against the 78 scored targets present in the graph:

Table 2. Independently steerable target dimensions.
input setinputsrank / |S|coverage
constrained drivers (un-defended, §7)772 / 7892%
all druggable knobs (unconstrained)2473 / 7894%
every node (graph ceiling)28078 / 78100%

The seven un-defended drivers span 92% of the target space — they steer it rather than merely nudge it. And refusing to push the defended hubs costs just one dimension (92% vs 94%), so the constraint in §7 is nearly free. (Within the model, of course — the graph is the graph.)

5. Target state and objective

The target is a vector $d$ of desired changes. The key fact: most brain variables aren't "more is better" — they have a sweet spot, an inverted-U (Yerkes–Dodson[18]; Arnsten[19]): dopamine, arousal, cortisol, excitation/inhibition balance, mTOR. Benefit is how much closer to the target you get:

$$b_i=\lvert d_i\rvert-\lvert x^{*}_i-d_i\rvert \tag{7}$$

In words — positive if the nudge moved a gene toward its ideal level, negative if it pushed past it.

Total benefit weights each gene by how sure we are of its target (readouts count for nothing); cost is how hard you push plus how much you disturb genes outside the target set:

$$B(p)=\sum_i w_i\,b_i,\qquad C(p)=\lVert p\rVert_1+\gamma\!\!\sum_{j\,\notin\,T}\!\!\lvert x^{*}_j\rvert \tag{8}$$

In words — add up the good across all genes, then subtract the cost: effort plus collateral movement elsewhere.

The current target vector covers 94 genes: 43 set-point, 30 up, 12 down.

target set
Figure 5. The 94-gene target set grouped by system; color is the wanted direction — green up, red down, gold set-point.

6. Uncertainty quantification

Our confidence in each target isn't uniform — some directions are well-established, others shaky — so a single score would overstate precision. We run it many times, sampling each target's confidence weight within its interval (Monte-Carlo[12]), and report a range instead of a point,

$$\widehat{\mathrm{CI}}_{90\%}=\bigl[\,Y_{(\lceil0.05M\rceil)},\ Y_{(\lfloor0.95M\rfloor)}\,\bigr] \tag{9}$$

In words — run it many times, sort the scores, and report the middle 90% as an honest range.

Then use Sobol indices[13],[14] to see which unknown is driving the range:

$$S_i=\frac{\operatorname{Var}_{\theta_i}\!\bigl(\mathbb{E}[Y\mid\theta_i]\bigr)}{\operatorname{Var}(Y)}, \qquad S_{T_i}=\frac{\mathbb{E}\bigl[\operatorname{Var}(Y\mid\theta_{\sim i})\bigr]}{\operatorname{Var}(Y)} \tag{10}$$

In words — of all the wobble in the score, how much comes from each unknown — so you know which fact to go check first.

Edge strengths are deliberately left out of this: they're treated as sign-only (unit weight), because there's no principled distribution to sample — inventing one would add noise, not information.

7. Optimization

There's no single best answer — more benefit usually costs more — so the output is a trade-off curve (a Pareto front). I trace it with the ε-constraint method[15]: get the most benefit while keeping cost under a cap $\varepsilon$, then slide the cap:

$$\max_p\ B(p)\quad\text{s.t.}\quad C(p)\le\varepsilon \tag{11}$$

In words — squeeze out the most benefit at each cost budget, then vary the budget to draw the whole curve.

A plain weighted sum, $\max_p B(p)-\lambda C(p)$, would quietly skip part of the curve when it bends the wrong way (a non-convex front)[16],[17]; ε-constraint doesn't, and the small size makes it cheap to run.

A necessary constraint. The optimizer may only push un-defended upstream drivers — nodes that cascade (out-degree > 0) but aren't heavily regulated (low in-degree). Defended convergence hubs like BDNF and CREB1 are excluded from the push set: they have many regulators (BDNF has 15) that fight a direct push — homeostasis — so we treat them as targets we move indirectly, not levers we pull. (The Liu–Barabási driver set is non-unique, so we use the deterministic in-degree criterion instead.)

Result. Among the un-defended drivers, counting only the downstream effect (so a gene isn't credited for moving itself), CAMK2B (CaMKIIβ, in-degree 0) is the top single lever — #1 in 100% of the 2,000 uncertainty draws, and it holds #1 under the nonlinear cross-check (§8). The benefit is modest: un-defended drivers reach less of the network than the defended hubs we deliberately can't push — which is the honest, un-inflated answer.

knob ranking with confidence bands
Figure 6. Single-knob ranking of the constrained (un-defended driver) set by downstream benefit, with 10–90% confidence bands. CAMK2B leads.

For combinations, the constrained set is small enough that no heuristic is needed: all $2^{7}-1=127$ subsets are evaluated exhaustively, so the front below is provably optimal within the constraint — not a greedy approximation that might have missed a better set. (Greedy forward selection is still run as a cross-check; it lands on the front but misses one point, which is the reason to prefer the exhaustive sweep while it stays cheap.)

Table 3. The exhaustive Pareto front — 6 of 127 subsets are non-dominated.
#knob setbenefitcost
1CAMK2B+0.01721.12
2CAMK2A + CAMK2B+0.02852.80
3NTRK2 + CAMK2A + CAMK2B+0.03454.61
4NTRK2 + CAMK2A + CAMK2B + HRAS+0.03706.57
5NTRK2 + CAMK2A + CAMK2B + CDC42+0.03836.68
6NTRK2 + CAMK2A + CAMK2B + CDC42 + HRAS+0.04098.64

The knee is CAMK2B alone — best benefit per unit cost — followed by steep diminishing returns: the last four points buy roughly twice the benefit for roughly eight times the cost. The drivers act on largely independent downstream, so combinations are close to additive (no synergistic stack), and the efficient set stays small.

benefit-cost Pareto front
Figure 7. Benefit–cost Pareto front over combinations of the constrained drivers. A small set (CAMK2B, then +CAMK2A) sits at the knee.

8. Validation

The engine is test-driven throughout — each stage is gated by unit tests (sign propagation, the resolvent, the objective, the confidence bands, the Pareto front, and the nonlinear map). The main sign check: push one gene by $+1$ and confirm the response sign matches the edge sign in the database — not the model. All eight match ($\alpha=0.15$, $\rho(\hat W)=0.544$).

sign check
Figure 8. Perturb a gene, read the response at a target: green is up, red is down, and each bar's label is the edge sign it should match. All eight agree, including two-hop sign flips.
Table 4. Sign consistency: unit perturbation vs. curated edge sign.
perturb→ targetedge$x^{*}$check
CREB1 ↑BDNF+1+0.0030✓
CREB1 ↑JUN−1−0.0027✓ flip
CREB1 ↑NTRK2+1→+1+0.0080✓ net
GSK3B ↑CREB1−1−0.0041✓ inhib
AKT1 ↑NFKB1+1→−1−0.0008✓ net-flip

One nice check on the operator: two-hop NTRK2 moves more than one-hop BDNF, because CREB1's ~40 out-edges split its signal while BDNF's single out-edge passes it straight through — exactly what equation (2) predicts.

Nonlinear cross-check

The whole engine is linear, so the headline (§7) could be an artifact of that. We re-ran the constrained ranking under a saturating (tanh) propagation and pushed knobs progressively harder into the nonlinear regime, where the linear approximation is meant to break. CAMK2B stays #1 at every strength — its lead widens as the system saturates — and combinations stay roughly additive, so no synergy appears. The finding survives.

nonlinear pressure test
Figure 9. Downstream benefit vs. perturbation strength under the saturating map. CAMK2B's lead grows as the push saturates — the result is not a linearity artifact.

9. Groundedness and assumptions

The layers rest on very different evidence: brain-scoping is computed, edge signs are curated from causal databases, edge strengths are mostly sign-only, and the target vector is hand-built by me. $\hat W$ is a linear (first-order) stand-in for nonlinear biology, so results hold for small nudges near the resting state, not big ones. Everything above is internally consistent and tested; none of it is externally validated.

Concretely, the result "CAMK2B is the best lever" is a statement about this graph under this objective. For it to mean anything about an actual brain, all of the following would have to hold — and I have checked none of them:

So the honest output is an ordered list under stated assumptions and a trade-off map — not fold-changes, not predictions, and emphatically not medical advice. The value of the exercise is the machinery, not the answer: a working pipeline from public graph to constrained, uncertainty-quantified, provably-optimal-within-the-constraint intervention sets. Point it at a better graph and a validated target vector and the same code would be worth something. As it stands it's a math experiment that happens to be about neurons.

10. Status & roadmap

Built, tested, and run: the full pipeline — substrate (§1), operator and RWR engine (§2–3), structural and formal target controllability (§4), the set-point objective (§5), the uncertainty pass (§6), the constrained ε-constraint optimizer over an exhaustive combination sweep (§7), and the nonlinear cross-check (§8). Further out: fitting real edge strengths where measured data exists, a richer intervention model (dose, timing), and validation against real perturbation datasets — the last of which is the only thing that would turn any of this from an exercise into evidence. This is a living write-up; it will change as those pieces land.


References

  1. Chandak, P., Huang, K., Zitnik, M. Building a knowledge graph to enable precision medicine. Scientific Data 10, 67 (2023).
  2. Himmelstein, D.S. et al. Systematic integration of biomedical knowledge prioritizes drugs for repurposing. eLife 6, e26726 (2017).
  3. Page, L., Brin, S., Motwani, R., Winograd, T. The PageRank Citation Ranking: Bringing Order to the Web. Stanford InfoLab (1999).
  4. Gasteiger, J., Bojchevski, A., Günnemann, S. Predict then Propagate: Graph Neural Networks meet Personalized PageRank. ICLR (2019).
  5. Tong, H., Faloutsos, C., Pan, J-Y. Fast Random Walk with Restart and Its Applications. ICDM (2006).
  6. Kipf, T.N., Welling, M. Semi-Supervised Classification with Graph Convolutional Networks. ICLR (2017).
  7. Kalman, R.E. Mathematical Description of Linear Dynamical Systems. J. SIAM Control 1(2), 152–192 (1963).
  8. Lin, C-T. Structural Controllability. IEEE Trans. Automatic Control 19(3), 201–208 (1974).
  9. Liu, Y-Y., Slotine, J-J., Barabási, A-L. Controllability of complex networks. Nature 473, 167–173 (2011).
  10. Hopcroft, J.E., Karp, R.M. An $n^{5/2}$ Algorithm for Maximum Matchings in Bipartite Graphs. SIAM J. Comput. 2(4), 225–231 (1973).
  11. Gao, J., Liu, Y-Y., D'Souza, R.M., Barabási, A-L. Target control of complex networks. Nature Communications 5, 5415 (2014).
  12. JCGM 101:2008. Evaluation of measurement data — Supplement 1 to the GUM — Propagation of distributions using a Monte Carlo method. BIPM (2008).
  13. Sobol, I.M. Global sensitivity indices for nonlinear mathematical models and their Monte Carlo estimates. Math. Comput. Simul. 55, 271–280 (2001).
  14. Saltelli, A. et al. Global Sensitivity Analysis: The Primer. Wiley (2008).
  15. Haimes, Y.Y., Lasdon, L.S., Wismer, D.A. On a bicriterion formulation … the ε-constraint method. IEEE Trans. Syst. Man Cybern. 1(3), 296–297 (1971).
  16. Boyd, S., Vandenberghe, L. Convex Optimization (§4.7, scalarization & Pareto optimality). Cambridge Univ. Press (2004).
  17. Marler, R.T., Arora, J.S. Survey of multi-objective optimization methods for engineering. Struct. Multidiscip. Optim. 26, 369–395 (2004).
  18. Yerkes, R.M., Dodson, J.D. The relation of strength of stimulus to rapidity of habit-formation. J. Comp. Neurol. Psychol. 18, 459–482 (1908).
  19. Arnsten, A.F.T. Stress signalling pathways that impair prefrontal cortex structure and function. Nat. Rev. Neurosci. 10, 410–422 (2009).

Project overview · source code · versions: current · v1 (Jul 2026) · a personal learning project — not medical advice.