The Wolfram Emerging Leaders Program: Boot Camp is a year-long program for talented high school students. Students spend a semester learning Wolfram Language, and then work in a small group over the second semester to do either a research-based project or a product development–based project under the guidance of an expert mentor. Projects are centered around a topic at the intersection of the group’s interests.
◼
with contributions from Elena Whaong
Abstract
Abstract
Through computational simulation of neuron network interactions across small-world, random, and regular lattice graphs, we model the relationship between long-term potentiation (LTP) and neuron degeneration in the context of Multiple Sclerosis. Using a simplified model where neurons are represented as nodes and synaptic connections as weighted edges, we examine how long-term potentiation (LTP) interacts with progressive demyelination across the three graph topologies. By tracking connection weight changes over cycle simulations, we explore how network structure influences the brain’s ability to compensate for myelin loss.
Introduction
Introduction
Multiple sclerosis (MS) is a chronic neurological disorder that is characterized by damage to myelin, the insulating protective sheath that surround axons in the central nervous system. Myelin enables efficient propagation of electrical signals between neurons. In MS, demyelination disrupts this process, which leads to impaired neural connections and rapid progression of neurological disability. This degeneration interferes with adaptive neural plasticity that normally act to strengthen important functional pathways.
One important form of neural plasticity that this project looks at is long-term potentiation (LTP), a process through which synaptic connections are strengthened respective to repeated neural activity. LTP is an important process for learning and memory as it increases the likelihood that signals will successfully be transmitted rapidly along frequently used pathways. At the physiological level, sustained activation of a synapse leads to changes in the electrical and chemical properties of its post-synaptic neuron and thereby a greater responsiveness to incoming signals. As a result, neural pathways that are repeatedly activated become more efficient at transmitting information.
In MS, through a process called demyelination, the body's immune system attacks myelin, the coat that surrounds nerve fibers and helps electrical signals travel quickly between neurons. When myelin is damaged or lost, signals move slower, become weaker, and may not even reach their destination. In this way, demyelination reverses the benefits of processes like long-term potentiation, contributing to the common symptoms of MS that include difficulties in movement, sensation, and cognition.
We have random, regular lattice, and small-world directed networks representing a simplified brain under multiple sclerosis. Through each network, we will research how neurodegenerative brain diseases affect the method and efficiency of neural connection formation and its efficiency.
Model Setup
Model Setup
To begin modelling demyelination computationally, we first need a simplified version of a brain network. In this project, each neuron will be represented as a node, and each neural connection will be represented as a directed edge. The strength of each connection is stored as an edge weight.
Random Network
Random Network
We’ll begin with the simplest possible model: a random directed network. This gives us a useful baseline because it does not assume any special biological structure. Instead, connections form stochastically, meaning that each possible connection has a fixed probability of appearing.
In our first model, we use 18 neurons:
In our first model, we use 18 neurons:
In[]:=
nNeurons=18;pConnect=0.18;learnRate=0.25;pathLen=6;nWalks=50;msProb=0.15;msRange={0.05,0.6};cycles=150;SeedRandom[12];neurons=Range[nNeurons];
Connections between neurons are generated stochastically to form an initial directed network. For every ordered pair of neurons (i, j), a directed connection from neuron i to neuron j is created with a fixed probability of pConnect. At initialization, all connections are assigned a weight of zero to represent unpotentiated path strength prior to learning and demyelination.
The value pConnect = 0.18 controls how densely connected the graph is. For every ordered pair of neurons (i,j), the model decides whether to create a connection from neuron i to neuron j. We exclude self-connections, since a neuron should not connect directly to itself in this simplified model.
The value pConnect = 0.18 controls how densely connected the graph is. For every ordered pair of neurons (i,j), the model decides whether to create a connection from neuron i to neuron j. We exclude self-connections, since a neuron should not connect directly to itself in this simplified model.
Build a random edge list:
In[]:=
rawEdges=Flatten@Table[If[i≠j&&RandomReal[]<pConnect,ij,Nothing],{i,neurons},{j,neurons}];
At this stage, we have the structure of the network, but no learning has taken place yet. To represent this, every connection is assigned an initial weight of zero. This means that the connection exists, but has not yet been strengthened through repeated use.
Create a list of zeros with the same length as rawEdges, representing each weight between nodes starting at 0:
In[]:=
wRandom=AssociationThread[rawEdges,ConstantArray[0.,Length[rawEdges]]];wRandom
Out[]=
(12)0.,(13)0.,(17)0.,(115)0.,(117)0.,(21)0.,(24)0.,(27)0.,(210)0.,(212)0.,(46)0.,(52)0.,(54)0.,(56)0.,(515)0.,(518)0.,(68)0.,(610)0.,(613)0.,(74)0.,(716)0.,(86)0.,(815)0.,(817)0.,(91)0.,(912)0.,(913)0.,(917)0.,(101)0.,(105)0.,(1016)0.,(111)0.,(112)0.,(1110)0.,(1216)0.,(134)0.,(137)0.,(1310)0.,(1312)0.,(1314)0.,(1317)0.,(143)0.,(145)0.,(151)0.,(152)0.,(153)0.,(158)0.,(1510)0.,(167)0.,(171)0.,(181)0.,(182)0.,(188)0.,(1812)0.
To make the graph easier to interpret, create a function that labels each edge with its weight:
In[]:=
makeLabels[elist_]:=Cases[elist,Property[e_,EdgeWeightwt_](ePlaced[NumberForm[wt,{3,2}],Center])];edgeLabelRules[wAssoc_]:=KeyValueMap[(#1Placed[NumberForm[#2,{3,2}],Center])&,wAssoc];
Then define a graph-making function:
In[]:=
makeGraph[wAssoc_]:=Graph[neurons,KeyValueMap[Property[#1,EdgeWeight#2]&,wAssoc],DirectedEdgesTrue,VertexSize0.5,EdgeLabelsedgeLabelRules[wAssoc]];
Long Term Potentiation
Long Term Potentiation
Once the random network has been created, we can simulate neural activity. In this model, a signal travelling through the brain is represented as a random walk through the graph. The signal begins at one neuron, then moves along one of its outgoing connections to another neuron, and repeats this for several steps.
First, build an association that stores the outgoing neighbors of each neuron:
In[]:=
neighborsAssocRandom=Association@Table[vAdjacencyList[Graph[neurons,rawEdges,DirectedEdgesTrue],v],{v,neurons}];
This allows the immediate lookup of which neurons any given neuron can send a signal to.
Now we define a random walk.
Now we define a random walk.
Starting from a given neuron, repeatedly jump to a random neighbor and record each stop:
In[]:=
randomWalk[start_,len_]:=Module[{path={start},cur=start,nb},Do[nb=Lookup[neighborsAssoc,cur,{}];If[nb==={},Break[]];cur=RandomChoice[nb];AppendTo[path,cur],{len}];path];
The walks are converted into a sequence of edges, allowing us to update only the used connections.
Each walk produces a list of neurons. For example, a path such as {3, 7, 10, 5} means that the signal traveled from neuron 3 to neuron 7, then from neuron 7 to neuron 10, and then from neuron 10 to neuron 5.
To update the connection strengths, we need to convert this path into the edges that were actually used.
Each walk produces a list of neurons. For example, a path such as {3, 7, 10, 5} means that the signal traveled from neuron 3 to neuron 7, then from neuron 7 to neuron 10, and then from neuron 10 to neuron 5.
To update the connection strengths, we need to convert this path into the edges that were actually used.
Convert a path into a sequence of directed connections:
In[]:=
edgesFromPath[path_List]:=Thread[path[[;;-2]]path[[2;;]]];
Only these used connections will be reinforced.
The reinforcement function models long-term potentiation. If a connection is used, its weight increases. Reinforcements of edge weights are also bounded, simulating the biological limits of synaptic strength.
The reinforcement function models long-term potentiation. If a connection is used, its weight increases. Reinforcements of edge weights are also bounded, simulating the biological limits of synaptic strength.
Reinforce edge weights function:
In[]:=
reinforce[wAssoc_,pathEdges_List,lr_]:=Module[{w2=wAssoc},Do[If[KeyExistsQ[w2,e],w2[e]=Clip[w2[e]+lr*(1-w2[e]),{0,1}]],{e,pathEdges}];w2];
The above rule w2[e] = Clip[w2[e] + lr*(1 - w2[e]), {0, 1}] means that weak connections strengthen quickly at first, but the amount of strengthening decreases as the weight approaches 1. This is useful because it creates a biological limit since synaptic strength can increase, but it cannot grow forever. The Clip function keeps all weights between 0 and 1.
In biological terms, this represents long-term potentiation. Connections that are repeatedly used become more efficient at transmitting signals. In the model, frequently travelled edges gradually become stronger.
In biological terms, this represents long-term potentiation. Connections that are repeatedly used become more efficient at transmitting signals. In the model, frequently travelled edges gradually become stronger.
Demyelination
Demyelination
After modelling learning, we introduce damage to the system. In multiple sclerosis, demyelination weakens the ability of neurons to transmit signals efficiently. In this graph model, we represent this by reducing the weights of some connections.
For each edge, roll a number -- if it is below damage probability, multiply edge weight by a random degradation factor:
In[]:=
msDamage[wAssoc_,prob_,factorRange_]:=Module[{w2=wAssoc,f},KeyValueMap[(If[RandomReal[]<prob,f=RandomReal[factorRange];w2[#1]=Clip[#2*f,{0,1}]])&,wAssoc];w2];
Each edge has a probability msProb of being damaged. If damage occurs, the edge weight is multiplied by a random factor between 0.05 and 0.6. As a result, some connections are only moderately weakened, while others lose most of their strength, reflecting the non-uniform nature of demyelination.
In a biological nervous system, some pathways may remain functional while others become severely impaired. By applying damage probabilistically, the model creates a simplified version of this uneven degradation.
In a biological nervous system, some pathways may remain functional while others become severely impaired. By applying damage probabilistically, the model creates a simplified version of this uneven degradation.
For each edge, increment its weight by a share of the reinforcement if it was part of the walked path, otherwise leave weight unchanged:
In[]:=
reinforcePath[g_,path_]:=Module[{pathEdges,allEdges,newEdges},pathEdges=DirectedEdge@@@Partition[path,2,1];allEdges=EdgeList[g];newEdges=Table[With[{e=allEdges[[k]],wt=PropertyValue[{g,allEdges[[k]]},EdgeWeight]},If[MemberQ[pathEdges,e],Property[e,EdgeWeight(wt+1/Length[pathEdges])],Property[e,EdgeWeightwt]]],{k,Length[allEdges]}];Graph[VertexList[g],newEdges,DirectedEdgesTrue,VertexSize0.5,EdgeLabelsmakeLabels[newEdges]]];
Now we can combine learning and demyelination into a single simulation. Each cycle represents a period of neural activity followed by MS-like damage.
In each cycle, the model performs many random walks. The pathways used during these walks are strengthened through long-term potentiation. Then demyelination is applied, weakening some of the existing connections. By storing every version of the network in wHistoryRandom, we can later animate the model and see how the network changes over time.
In each cycle, the model performs many random walks. The pathways used during these walks are strengthened through long-term potentiation. Then demyelination is applied, weakening some of the existing connections. By storing every version of the network in wHistoryRandom, we can later animate the model and see how the network changes over time.
Set up wHistoryRandom:
Set up neighbor lookup to the random graph so walks use the correct topology:
For each cycle, run nWalks random walks from randomly chosen starting neurons, reinforce edges of traveled paths, and apply demyelination, recording updated weight after walks in a cycle complete:
Animate the graph with each cycle as a frame and each edge’s opacity reflecting its weight:
In the animation, stronger edges become more opaque and more visually prominent, while weaker edges have lower opacity. This lets us observe the competition between learning and damage. Some pathways are reinforced through repeated use, while others are weakened by demyelination.
The random model acts as the baseline for the project. Since its structure has no built-in organization, it helps us understand what happens when neural connections are formed without local or small-world structure. We can then compare this behavior with more organized networks, such as the regular lattice and small-world models.
Across cycles, degradation spreads fairly evenly across neurons. A sharp drop in edge weights occurs around cycles 65-70 as demyelination outpaces LTP reinforcement, followed by a noticeably slower rate of decline for the cycles onward. The plateau reflects a floor effect, as weights have already been driven so low that further demyelination has diminishing impact. The random model therefore shows weak overall protection against MS progression, with LTP being able to sustain compensation for demyelination for only a few initial cycles.
The random model acts as the baseline for the project. Since its structure has no built-in organization, it helps us understand what happens when neural connections are formed without local or small-world structure. We can then compare this behavior with more organized networks, such as the regular lattice and small-world models.
Across cycles, degradation spreads fairly evenly across neurons. A sharp drop in edge weights occurs around cycles 65-70 as demyelination outpaces LTP reinforcement, followed by a noticeably slower rate of decline for the cycles onward. The plateau reflects a floor effect, as weights have already been driven so low that further demyelination has diminishing impact. The random model therefore shows weak overall protection against MS progression, with LTP being able to sustain compensation for demyelination for only a few initial cycles.
Regular Lattice model
Regular Lattice model
A regular lattice model means each neuron connects only to a certain number, say k, of its nearest neighbors in some structured grid. There are 5 lattice types for the 2D space: oblique (general unit cell, no restrictions on side length or angles), rectangular, centered rectangular, square, and hexagonal.
We will be mapping out a toroidal lattice, a torus (donut) shaped grid that is often used in computational neuroscience(need to expand on this****). A toroidal lattice can be embedded in both 2D and 3D spaces, as we will be using a 2D space for consistency across our three models here. In a 2D toroidal lattice, its edges are “wrapped” to form a closed surface (ring shape). The k value determines how many of a neurons neighbors it can connect to.
Modeling a regular lattice provides the case of having no long-range connections (weight reinforcements are local).
Unlike the random model, the lattice model has a fixed structure. Each neuron connects only to a certain number of nearby neurons, creating a local and highly ordered network. This is useful because it gives us the opposite case from the random model. Instead of allowing long-distance connections to form randomly, the lattice forces communication to happen locally. This lets us test how a structured but local network responds to learning and demyelination.
We will be mapping out a toroidal lattice, a torus (donut) shaped grid that is often used in computational neuroscience(need to expand on this****). A toroidal lattice can be embedded in both 2D and 3D spaces, as we will be using a 2D space for consistency across our three models here. In a 2D toroidal lattice, its edges are “wrapped” to form a closed surface (ring shape). The k value determines how many of a neurons neighbors it can connect to.
Modeling a regular lattice provides the case of having no long-range connections (weight reinforcements are local).
Unlike the random model, the lattice model has a fixed structure. Each neuron connects only to a certain number of nearby neurons, creating a local and highly ordered network. This is useful because it gives us the opposite case from the random model. Instead of allowing long-distance connections to form randomly, the lattice forces communication to happen locally. This lets us test how a structured but local network responds to learning and demyelination.
We again use 18 neurons, where k is the amount of neighbors a node can connect with:
In this model, each neuron connects to its next two neighbours. To avoid edge effects, we use modular arithmetic so the network wraps around at the end, creating a ring-like lattice.
For each neuron, create directed edges to its k nearest clockwise neighbors (using modular arithmetic to wrap around the ring), then add the reverse of each edge so connections run in both directions:
The Mod function is particularly important: without the Mod function making the structure circular, neurons near the end of the list would have fewer forward neighbours. With it, neuron 18 can connect back to neurons 1 and 2, creating a closed loop.
Adding the reverse of each connection also gives the lattice bidirectional local connectivity. In other words, if neuron 5 connects to neuron 6, neuron 6 can also connect back to neuron 5. This creates a regular ring where each neuron is connected to nearby neurons on both sides.
Adding the reverse of each connection also gives the lattice bidirectional local connectivity. In other words, if neuron 5 connects to neuron 6, neuron 6 can also connect back to neuron 5. This creates a regular ring where each neuron is connected to nearby neurons on both sides.
As before, every edge begins with a weight of zero:
We also create a neighbour association for the lattice.
Get list of outgoing neighbor neurons per each original neuron:
The function above stores the outgoing neighbours for every neuron, which is needed for the random-walk simulation.
When visualized, the lattice forms a ring-like structure; because each neuron is connected to nearby neurons rather than to distant random nodes, the model is a useful representation of a local-only network.
When visualized, the lattice forms a ring-like structure; because each neuron is connected to nearby neurons rather than to distant random nodes, the model is a useful representation of a local-only network.
Long term potentiation
Long term potentiation
The long term potentiation function has the same logic as that of our random graph LTP model. However, while a signal may jump across the graph if a random long-range connection exists in a random network model, in the lattice model, the signal is restricted to local steps around the ring. Because the lattice only contains local connections, potentiation also remains local, and repeated walks tend to reinforce nearby pathways rather than creating strong links between distant parts of the graph.
Moreover, in the random model, while learning may strengthen scattered connections across the network, learning strengthens neighbour-based pathways for a lattice. The model therefore allows us to ask whether local structure alone is enough to preserve communication when demyelination occurs.
Moreover, in the random model, while learning may strengthen scattered connections across the network, learning strengthens neighbour-based pathways for a lattice. The model therefore allows us to ask whether local structure alone is enough to preserve communication when demyelination occurs.
Demyelination
Demyelination
The demyelination function also remains the same across models, using the same logic.
In the lattice model, damage modeled after MS has a different effect than in the random model. Because every neuron only has a small number of local neighbours, there are fewer alternative routes when a connection becomes weak. A damaged local pathway may force the signal to continue travelling through other nearby connections, rather than taking a shortcut across the network.
As a result, the lattice model is especially useful for comparison, since it represents a network with strong regularity but limited flexibility. If demyelination weakens important local links, communication will become less efficient because the graph has no long-range connections to compensate.
In the lattice model, damage modeled after MS has a different effect than in the random model. Because every neuron only has a small number of local neighbours, there are fewer alternative routes when a connection becomes weak. A damaged local pathway may force the signal to continue travelling through other nearby connections, rather than taking a shortcut across the network.
As a result, the lattice model is especially useful for comparison, since it represents a network with strong regularity but limited flexibility. If demyelination weakens important local links, communication will become less efficient because the graph has no long-range connections to compensate.
Finally, we run the lattice model through the same cycle of activity and damage.
Set up wHistoryLattice :
Each cycle contains two competing processes. First, random walks simulate neural activity and reinforce the connections that are used. Then, demyelination weakens a random subset of the edges. The state of the lattice is stored after each cycle so that the network can be animated.
Set up neighbor lookup to the lattice graph:
For each cycle, run nWalks random walks from randomly chosen starting neurons, reinforcing edges of traveled paths, applying demyelination, and recording updated weights:
Animate the lattice graph, each cycle being a frame and opacity representing edge weights:
The animation shows a clear ring-like structure. As the simulation runs, some local pathways become stronger through repeated use, while others are weakened by demyelination, creating an evolving pattern of reinforced and damaged local connections.
The regular lattice model therefore represents the local-structure case in our comparison. It has much more organization than the random model, but it lacks the long-range shortcuts that may help signals travel efficiently across a brain network. It’s locality, however, makes the lattice surprisingly resilient against demyelination. Because random walks are forced to repeatedly traverse the same nearby edges, LTP reinforcement concentrates heavily on local paths that it outpaces demyelination.
Compared to the random network model, degradation was only visible when msProb was increased significantly. When msProb = 0.9 instead of the 0.15 used for the random network, connections stayed strong until around cycle 210, suggesting that structural regularity, despite inefficiency for global signal transmission, generates solid protection against MS progression due to compounding localized LTP. Furthermore, when msProb is slightly lower, ~0.7, visible degradation appears much earlier while overall degradation stays more constant. For 0.9, almost every edge is hit each cycle, so damage is aggressive and drives weights down before LTP can respond, which causes a later, visible drop. When it is slightly lower, fewer edges get hit per cycle, giving LTP time to recover some edges between damage rounds. What results is the appearance of a more constant degradation state overall, similar to how the lattice behaves at 0.9 after the drop.
The lattice reflects the relapsing-remitting phases of MS, where patients experience periods of damage followed by partial recovery. It is important to note that for a patient, msProb would realistically increase over time, which makes the threshold between relapsing and recovering and fully declining (i.e. msProb=0.9) found above even more significant.
The regular lattice model therefore represents the local-structure case in our comparison. It has much more organization than the random model, but it lacks the long-range shortcuts that may help signals travel efficiently across a brain network. It’s locality, however, makes the lattice surprisingly resilient against demyelination. Because random walks are forced to repeatedly traverse the same nearby edges, LTP reinforcement concentrates heavily on local paths that it outpaces demyelination.
Compared to the random network model, degradation was only visible when msProb was increased significantly. When msProb = 0.9 instead of the 0.15 used for the random network, connections stayed strong until around cycle 210, suggesting that structural regularity, despite inefficiency for global signal transmission, generates solid protection against MS progression due to compounding localized LTP. Furthermore, when msProb is slightly lower, ~0.7, visible degradation appears much earlier while overall degradation stays more constant. For 0.9, almost every edge is hit each cycle, so damage is aggressive and drives weights down before LTP can respond, which causes a later, visible drop. When it is slightly lower, fewer edges get hit per cycle, giving LTP time to recover some edges between damage rounds. What results is the appearance of a more constant degradation state overall, similar to how the lattice behaves at 0.9 after the drop.
The lattice reflects the relapsing-remitting phases of MS, where patients experience periods of damage followed by partial recovery. It is important to note that for a patient, msProb would realistically increase over time, which makes the threshold between relapsing and recovering and fully declining (i.e. msProb=0.9) found above even more significant.
Small World Model
Small World Model
Small World Model
The final model we created was a small-world network. This model is especially useful because it sits between the random network and the regular lattice network. A lattice network has strong local structure, because each neuron mainly connects to nearby neurons. A random network has more irregular connections, which can create quicker routes across the graph but with less local organization. A small-world network combines both of these properties: most connections remain local, but a small number are rewired to create longer-range shortcuts.
This makes the small-world model the most relevant comparison in the project. Many real biological networks, including brain networks, are often described as having small-world properties. They contain local clusters where nearby neurons or regions are strongly connected, but they also contain longer-range connections that allow information to travel across the system in a small number of steps.
This makes the small-world model the most relevant comparison in the project. Many real biological networks, including brain networks, are often described as having small-world properties. They contain local clusters where nearby neurons or regions are strongly connected, but they also contain longer-range connections that allow information to travel across the system in a small number of steps.
Increase the amount of cycles and damage of MS to better see effects of demyelination and LTP:
We begin by setting the rewiring probability:
Starting from the lattice edge list, each edge is rewired with probability pSmallWorld to a random non-neighbor, creating long range connections:
Add the reverse of each edge so connections can run in both directions:
The value pSmallWorld = 0.1 means that each lattice edge has a 10% chance of being rewired. This is low enough that most of the original lattice structure remains, but high enough to introduce a few shortcut connections. These shortcuts are what make the network different from a regular lattice.
rawEdgesSmallWorld = rawEdgesLattice means the small-world model begins with the same local neighbourhood structure as the regular lattice model. Each neuron is initially connected to nearby neurons, giving the network a clear local structure.
This is the most important part of the small-world model. For each edge, the code identifies the source neuron s and the target neuron t. If a randomly generated number is less than pSmallWorld, the edge is rewired. This means the source neuron stays the same, but the target neuron is replaced with a new randomly chosen neuron.
The Complement part ensures that the new target is not already one of the original local neighbours and is not the source neuron itself. This avoids creating duplicate local connections or self-connections. As a result, rewired edges tend to become longer-range shortcuts rather than simply repeating the same local structure.
As in the other two models, the edge weight represents the strength of a neural connection. Starting all weights at zero means that the structural connections exist, but no learning has occurred yet. The network has the potential to transmit signals, but its pathways have not yet been strengthened through repeated activity.
rawEdgesSmallWorld = rawEdgesLattice means the small-world model begins with the same local neighbourhood structure as the regular lattice model. Each neuron is initially connected to nearby neurons, giving the network a clear local structure.
This is the most important part of the small-world model. For each edge, the code identifies the source neuron s and the target neuron t. If a randomly generated number is less than pSmallWorld, the edge is rewired. This means the source neuron stays the same, but the target neuron is replaced with a new randomly chosen neuron.
The Complement part ensures that the new target is not already one of the original local neighbours and is not the source neuron itself. This avoids creating duplicate local connections or self-connections. As a result, rewired edges tend to become longer-range shortcuts rather than simply repeating the same local structure.
As in the other two models, the edge weight represents the strength of a neural connection. Starting all weights at zero means that the structural connections exist, but no learning has occurred yet. The network has the potential to transmit signals, but its pathways have not yet been strengthened through repeated activity.
Initialize all small-world edge weights to 0:
Build neighbor lookup table from edge list:
Initialize weight history:
Before running the simulation, we set the neighbor association to use the small-world network; then each signal is simulated using a random walk:
Each walk begins at a randomly chosen neuron. At each step, the model chooses one of the current neuron’s outgoing neighbours and moves there. The resulting path represents a signal travelling through the brain-like network.
The path is then converted into a list of used edges using edgesFromPath. These are the connections that participated in the signal transmission. The reinforce function then strengthens those used connections according to the same bounded learning rule used in the other models:
Each walk begins at a randomly chosen neuron. At each step, the model chooses one of the current neuron’s outgoing neighbours and moves there. The resulting path represents a signal travelling through the brain-like network.
The path is then converted into a list of used edges using edgesFromPath. These are the connections that participated in the signal transmission. The reinforce function then strengthens those used connections according to the same bounded learning rule used in the other models:
Set up neighbor lookup to small world:
For each cycle, run nWalks random walks from starting neurons, reinforcing edges, applying demyelination, and recording updated weights:
Animate the graph with each cycle as a frame and each edge’s opacity reflecting its weight:
In the graph output, the model still has a generally lattice-like structure, but with extra connections that cut across the graph. These longer-range edges are the shortcuts created by rewiring. Over time, some of these shortcut connections may become strongly reinforced if they are repeatedly used by random walks.
This is the key feature of the small-world model. It does not look as completely regular as the lattice model, but it is also not as irregular as the random model. It keeps local clustering while introducing shortcut pathways.
The small-world model is the final and most important comparison model because it combines the advantages of the other two structures. The lattice model has strong local organization, but signals may need many steps to travel across the network. The random model can create faster global routes, but lacks consistent local structure. The small-world model sits between them, preserving local neighbourhood connections while adding a few long-range shortcuts.
In the context of the brain, this is useful because efficient neural communication depends on both local processing and global integration. Local connections allow nearby neurons or regions to work together, while longer-range connections allow information to move between distant parts of the brain.
The small world model demonstrates remarkable stability under demyelination -- at msProb = 0.15, demyelination remains stable across all cycles, and even at msProb=0.9, most connections stay intact throughout the simulation, weakening gradually rather than disappearing.
In the random network, demyelination is uneven, with some connections vanishing entirely while others remain strongly reinforced. The lattice, due to its clustering nature, develops regions of near total disconnection while neighboring clusters remain intact. The small world model contrasts with both, as it is built on the lattice structure but extended through shortcuts, allowing LTP reinforcement to spread a lattice model’s clustering ability throughout an entire small-world network. The result is one interconnected cluster that degrades uniformly, with connections weakening together rather than vanishing selectively.
Therefore, our simulation suggests that small-world topology is the most efficient for neural communication and the most resilient against the progressive and non-uniform damage characteristics of multiple sclerosis.
This is the key feature of the small-world model. It does not look as completely regular as the lattice model, but it is also not as irregular as the random model. It keeps local clustering while introducing shortcut pathways.
The small-world model is the final and most important comparison model because it combines the advantages of the other two structures. The lattice model has strong local organization, but signals may need many steps to travel across the network. The random model can create faster global routes, but lacks consistent local structure. The small-world model sits between them, preserving local neighbourhood connections while adding a few long-range shortcuts.
In the context of the brain, this is useful because efficient neural communication depends on both local processing and global integration. Local connections allow nearby neurons or regions to work together, while longer-range connections allow information to move between distant parts of the brain.
The small world model demonstrates remarkable stability under demyelination -- at msProb = 0.15, demyelination remains stable across all cycles, and even at msProb=0.9, most connections stay intact throughout the simulation, weakening gradually rather than disappearing.
In the random network, demyelination is uneven, with some connections vanishing entirely while others remain strongly reinforced. The lattice, due to its clustering nature, develops regions of near total disconnection while neighboring clusters remain intact. The small world model contrasts with both, as it is built on the lattice structure but extended through shortcuts, allowing LTP reinforcement to spread a lattice model’s clustering ability throughout an entire small-world network. The result is one interconnected cluster that degrades uniformly, with connections weakening together rather than vanishing selectively.
Therefore, our simulation suggests that small-world topology is the most efficient for neural communication and the most resilient against the progressive and non-uniform damage characteristics of multiple sclerosis.
Future Directions
Future Directions
Our findings are limited by the simplicity of the models, as real neural networks involve far greater complexity in synaptic dynamics, spatial organization, and other factors that can be captured in a weighted graph simulation. Moving forward, we could extend our work by implementing a dynamic msProb that increases over cycles, which more closely reflects real MS progression, incorporating larger networks, including myelin repair, and creating specialized nodes or areas mimicking parts of the brain more accurately.
Conclusion
Conclusion
Through computational simulation of random network, regular lattice, and small-world topologies, we modeled the relationship between long-term potentiation and demyelination as a simplified representation of multiple sclerosis progression. Across all three models, LTP outpaced demyelination in early cycles, suggesting that synaptic reinforcement provides a level of protection against early myelin loss regardless of network structure. However, the type of network proved to be a significant factor in long-term resilience.
The random network model showed the least resilience, with connection disappearing fairly unevenly. The regular lattice, despite its lack of long-range connections, demonstrated solid resistance, with LTP reinforcement compounding so heavily over local edges that the model required msProb = 0.9 to produce visible degradation. Finally, the small-world model proved the most resilient, not fragmenting like the random network or clustering like the lattice but degrading uniformly.
These results suggest that network topology plays a significant role in how neural circuits compensate for myelin loss, with implications for understanding MS progression at the circuit level.
The random network model showed the least resilience, with connection disappearing fairly unevenly. The regular lattice, despite its lack of long-range connections, demonstrated solid resistance, with LTP reinforcement compounding so heavily over local edges that the model required msProb = 0.9 to produce visible degradation. Finally, the small-world model proved the most resilient, not fragmenting like the random network or clustering like the lattice but degrading uniformly.
These results suggest that network topology plays a significant role in how neural circuits compensate for myelin loss, with implications for understanding MS progression at the circuit level.
Acknowledgements
Acknowledgements
We would like to thank William Choi-Kim, our mentor, for his valuable guidance and support throughout this project. His feedback consistently pushed our thinking further and helped shape the direction of our research. We would also like to thank Rory Foulger and Eryn Gillam for their guidance and for making this project possible.
References
References
Purves, D., Augustine, G. J., Fitzpatrick, D., et al. (Eds.). (2001). Long-term synaptic potentiation. In Neuroscience (2nd ed.). Sinauer Associates. https://www.ncbi.nlm.nih.gov/books/NBK10878/
Neuroscience Group. (n.d.). Multiple sclerosis and the myelin sheath. https://neurosciencegroup.com/blog/multiple-sclerosis-and-the-myelin-sheath/
Queensland Brain Institute. (n.d.). Axons: The cable transmission of neurons. University of Queensland. https://qbi.uq.edu.au/brain/brain-anatomy/axons-cable-transmission-neurons
Trafton, A. (2018, October 18). Dendrites are active in neural computation, new research shows. MIT News. https://news.mit.edu/2018/dendrites-explain-brains-computing-power-1018
Neuroscience Group. (n.d.). Multiple sclerosis and the myelin sheath. https://neurosciencegroup.com/blog/multiple-sclerosis-and-the-myelin-sheath/
Queensland Brain Institute. (n.d.). Axons: The cable transmission of neurons. University of Queensland. https://qbi.uq.edu.au/brain/brain-anatomy/axons-cable-transmission-neurons
Trafton, A. (2018, October 18). Dendrites are active in neural computation, new research shows. MIT News. https://news.mit.edu/2018/dendrites-explain-brains-computing-power-1018
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
Modeling multiple sclerosis and demyelination resilience across neural networks
by Wolfram Education Programs
Wolfram Community, STAFF PICKS, June 6, 2026
https://community.wolfram.com/groups/-/m/t/3729914
by Wolfram Education Programs
Wolfram Community, STAFF PICKS, June 6, 2026
https://community.wolfram.com/groups/-/m/t/3729914