Networkx is a set of Python-based network construction libraries. Because I didn't learn python before, so a little bit, this article tells you how to install Python2.7 and networkx in a Windows environment.
First of all, to clarify, if you want to learn more about Python in the system, or to change the Linux system as soon as possible, because the library installation under Windows is very cumbersome, and Linux only need to run the command line (Terminal):
sudo apt-get install Python-matplotlib
You can do it.
Because it's just a matter of using NETWORKX to construct the data, here's a simple way to quickly install and use Python2.7 under Windows.
0. Leave a mark first: Python Beginner's Guide
Https://wiki.python.org/moin/BeginnersGuide
1. Download Python 2.7, double-click Install
https://www.python.org/downloads/windows/
Add Path variable: at < Start > menu-Control panel-system and security-system-advanced System Settings-(Advanced Tab)-environm Ental Variables-Find ' path ', double-click Open-Add path ' C:\Python27 ' (System installation folder), OK.
Confirm installation: In < Start > menu-run cmd-go to command line, enter ' Python ', display
Python 2.7.8 (default, June 30 2014, 16:08:48)
The installation is successful.
(Enter exit () to exit Python)
2. Before installing NETWORKX, you need to download and install the Setuptools:
Https://pypi.python.org/pypi/setuptools
In the Python27 folder, double-click Automatic installation.
3. Download the Networkx, unzip the folder, and copy it to the Python27 folder:
https://pypi.python.org/pypi/networkx/
Enter the Networkx folder under CMD Window command line and enter the ' Python setup.py install ' installation Networkx Library.
Setup is complete.
4. Test procedure:
Enter Python under any path of CMD and use the mini-test program to confirm the installation success!
Http://networkx.github.io/examples.html
The procedure is as follows:
>>> import Networkx as nx>>> g=nx. Graph () >>> g.add_node ("spam") >>> G.add_edge ($) >>> print (G.nodes ()) [1, 2, ' spam ']> >> print (G.edges ()) [(1, 2)]
5. Tutorial with Networkx:
Https://networkx.github.io/documentation/latest/overview.html
Networkx Network generation function:
Http://networkx.lanl.gov/reference/generators.html#module-networkx.generators.random_graphs