Random Walks on Various Topologies

Manipulate[
DynamicModule[{tt=Table[RandomWalkFn[200,lattice[latttype]],{40}]},Grid[{{Dynamic[RandomWalkHexGraphics[particles,steps,tt]]},{Button["generate new walk",tt=Table[RandomWalkFn[200,lattice[latttype]],{40}],ImageSize->150]}}]],
{{latttype,6,"connection angle"},{3->"2π/3",4->"π/2",5->"2π/5",6->"π/3",7->"2π/7",8->"π/4",9->"2π/9",10->"π/5",11->"2π/11",12->"π/6"}},
{{particles,20},1,40,1,Appearance->"Labeled"},
{{steps,75},1,200,1,Appearance->"Labeled"},
TrackedSymbols:>{latttype,particles,steps},
Initialization:>(
SeedRandom[1123];
lattice[n_]:=N[Table[{Cos[(2*Pi*i)/n],Sin[(2*Pi*i)/n]},{i,0,n-1}]];
RandomWalkFn[n_,tmp_List,startpos_: {0,0}]:=FoldList[Plus,startpos,Table[tmp[[RandomInteger[{1,Length[tmp]}]]],{n}]];
RandomWalkHexGraphics[particles_,steps_,tt_]:=Module[{data},data=Table[tt[[j]][[i]],{j,1,particles},{i,1,steps}];
Graphics[{AbsolutePointSize[0.8],AbsoluteThickness[0.3],Line@data},PlotRange->{{Min[data]-1,Max[data]+1},{Min[data]-1,Max[data]+1}},AspectRatio->Automatic,ImageSize->400]];
)]

This Demonstration displays random walks on network topologies with connection angles leading out from the nodes ranging between π/3 to π/6.

Contributed by: Abigail Nussey