Networkx for feedback networks
From InterSciWiki
back to Realistic modeling of complex interactive systems#Assignments/exercises see the
Kejzar slides for introduction to the simulations
[edit] Installing networkx for Python
http://cheeseshop.python.org/pypi/networkx/0.34 Networkx including windows installation (that is the recommended download. In my windows installation, Nataša Kejžar's two programs for the feedback networks simulation, feedback.py and to_Pajek.py, didnt recognize networkx to be a valid module until I renamed C:\python25\share\doc\networkx-0.34 to networkx-x.xx. Then they ran, and left to_Pajek.pyc, a compiled file that Python uses to speed execution.
[edit] Starting from Python feedback networks
back to Python for networks
The function to_Pajek.Graph_to_Pajek(G,"feedback1120.net")
runs a function to_Pajek (from the feedback.py file, last few lines, uncommented) and outputs a file in which network G (in networkx format) is saved as a Pajek file. So it can be read in Pajek and analyzed or drawn (if a suitable number of vertices, of course--Nataša June 2007).
4) in the interactive window ("Python shell"), you have the G (network in networkx format) saved and you can analyze it further with networkx commands (such as to get degree "histogram"; the commands are:
import networkx
hist = networkx.degree_histogram(G)
(is this a compound operation? i.e. deg = networkx.degree prior to histogram; histogram is a function in Python) You may want to go back to http://www.awaretek.com/tutorials.html or http://www.limsi.fr/Individu/pointal/python/pqrc/versions/PQRC-2.4-USLetter-latest.pdf or http://rgruet.free.fr/PQR25/PQR2.5_modern_B&W_letter.pdf for commands in Python and https://networkx.lanl.gov/Reference/ or https://networkx.lanl.gov/wiki/QuickReference for commands in networkx.
Natasa -- how do I make these modules callable?
cent = networkx.centrality(G)
comp = networkx.components(G)
[edit] Pajek drawings
G = simulate_feedback(1,1.2,0,5000,1) alpha=1 beta=1.2 gamma=0
The average links per node is 1.4, and colors in the center are for k-core levels by degree.
