PyOpenGL/OpenGL Generating Particle Webs/ Cosmic NBodys

I am working on a small scale Universe Simulator. I’m stuck on creating the dark matters webs of the universe that look like this: mpa-garching.mpg.de/galform/data_vis/sim3dnew-highres.png I am generating the particles as solid spheres with the radius of 0.5 . How can I make the particles slowly move toward each other as demonstrated in the picture above to form “webs” of these particles? If anyone has any ideas or might have some examples of how this can be done that would be great. Code in either c/c++/python would be great. (I have the first step of the picture done) Here is a picture of what I have done: i.imgur.com/uiTEa3j.png

The physics I am in need of help with is: Creating a force emitted by each particle to attract other particles toward it to form a web of the particles as show in the picture above.

I know this is a difficult topic to help me with but I think I’ve figured out a piece of it.
Perhaps what I am looking for is a dynamic moving mesh of particles that attract to eachother to form “webs”.
Is this possible to make?