Programming with NetworkX in Python

CAUTION: Do NOT name your Python file networkx.py. It will trick Python into thinking that your file is the NetworkX library. Code: https://www.mtirfan.com/files/graphs.py Main topics: 1. Creating a graph, adding nodes and edges, adding attributes to nodes and edges, and doing common graph operations. 2. Visualizing a graph. 3. Generating Erdos-Renyi random graphs and Barabasi-Albert preferential attachment networks and plotting their degree distributions.