Complex Network Analysis in Python

Book description

Construct, analyze, and visualize networks with networkx, a Python language module. Network analysis is a powerful tool you can apply to a multitude of datasets and situations. Discover how to work with all kinds of networks, including social, product, temporal, spatial, and semantic networks. Convert almost any real-world data into a complex network--such as recommendations on co-using cosmetic products, muddy hedge fund connections, and online friendships. Analyze and visualize the network, and make business decisions based on your analysis. If you're a curious Python programmer, a data scientist, or a CNA specialist interested in mechanizing mundane tasks, you'll increase your productivity exponentially.

Complex network analysis used to be done by hand or with non-programmable network analysis tools, but not anymore! You can now automate and program these tasks in Python. Complex networks are collections of connected items, words, concepts, or people. By exploring their structure and individual elements, we can learn about their meaning, evolution, and resilience.

Starting with simple networks, convert real-life and synthetic network graphs into networkx data structures. Look at more sophisticated networks and learn more powerful machinery to handle centrality calculation, blockmodeling, and clique and community detection. Get familiar with presentation-quality network visualization tools, both programmable and interactive--such as Gephi, a CNA explorer. Adapt the patterns from the case studies to your problems. Explore big networks with NetworKit, a high-performance networkx substitute. Each part in the book gives you an overview of a class of networks, includes a practical study of networkx functions and techniques, and concludes with case studies from various fields, including social networking, anthropology, marketing, and sports analytics.

Combine your CNA and Python programming skills to become a better network analyst, a more accomplished data scientist, and a more versatile programmer.

What You Need:

You will need a Python 3.x installation with the following additional modules: Pandas (>=0.18), NumPy (>=1.10), matplotlib (>=1.5), networkx (>=1.11), python-louvain (>=0.5), NetworKit (>=3.6), and generalizesimilarity. We recommend using the Anaconda distribution that comes with all these modules, except for python-louvain, NetworKit, and generalizedsimilarity, and works on all major modern operating systems.

Publisher resources

View/Submit Errata

Table of contents

  1.  Acknowledgments
  2.  Preface
    1. About the Reader
    2. About the Book
    3. About the Software
    4. About the Notation
    5. Online Resources
  3. 1. The Art of Seeing Networks
    1. Know Thy Networks
    2. Enter Complex Network Analysis
    3. Draw Your First Network with Paper and Pencil
  4. Part I. Elementary Networks and Tools
    1. 2. Surveying the Tools of the Craft
      1. Do Not Weave Your Own Networks
      2. Glance at iGraph
      3. Appreciate the Power of graph-tool
      4. Accept NetworkX
      5. Keep in Mind NetworKit
      6. Compare the Toolkits
    2. 3. Introducing NetworkX
      1. Construct a Simple Network with NetworkX
      2. Add Attributes
      3. Visualize a Network with Matplotlib
      4. Share and Preserve Networks
    3. 4. Introducing Gephi
      1. Worth 1,000 Words
      2. Import and Modify a Simple Network with Gephi
      3. Explore the Network
      4. Sketch the Network
      5. Prepare a Presentation-Quality Image
      6. Combine Gephi and NetworkX
    4. 5. Case Study: Constructing a Network of Wikipedia Pages
      1. Get the Data, Build the Network
      2. Eliminate Duplicates
      3. Truncate the Network
      4. Explore the Network
  5. Part II. Networks Based on Explicit Relationships
    1. 6. Understanding Social Networks
      1. Understand Egocentric and Sociocentric Networks
      2. Recognize Communication Networks
      3. Appreciate Synthetic Networks
      4. Distinguish Strong and Weak Ties
    2. 7. Mastering Advanced Network Construction
      1. Create Networks from Adjacency and Incidence Matrices
      2. Work with Edge Lists and Node Dictionaries
      3. Generate Synthetic Networks
      4. Slice Weighted Networks
    3. 8. Measuring Networks
      1. Start with Global Measures
      2. Explore Neighborhoods
      3. Think in Terms of Paths
      4. Choose the Right Centralities
      5. Estimate Network Uniformity Through Assortativity
    4. 9. Case Study: Panama Papers
      1. Create a Network of Entities and Officers
      2. Draw the Network
      3. Analyze the Network
      4. Build a “Panama” Network with Pandas
  6. Part III. Networks Based on Co-Occurrences
    1. 10. Constructing Semantic and Product Networks
      1. Semantic Networks
      2. Product Networks
    2. 11. Unearthing the Network Structure
      1. Locate Isolates
      2. Split Networks into Connected Components
      3. Separate Cores, Shells, Coronas, and Crusts
      4. Extract Cliques
      5. Recognize Clique Communities
      6. Outline Modularity-Based Communities
      7. Perform Blockmodeling
      8. Name Extracted Blocks
    3. 12. Case Study: Performing Cultural Domain Analysis
      1. Get the Terms
      2. Build the Term Network
      3. Slice the Network
      4. Extract and Name Term Communities
      5. Interpret the Results
    4. 13. Case Study: Going from Products to Projects
      1. Read Data
      2. Analyze the Networks
      3. Name the Components
  7. Part IV. Unleashing Similarity
    1. 14. Similarity-Based Networks
      1. Understand Similarity
      2. Choose the Right Distance
    2. 15. Harnessing Bipartite Networks
      1. Work with Bipartite Networks Directly
      2. Project Bipartite Networks
      3. Compute Generalized Similarity
    3. 16. Case Study: Building a Network of Trauma Types
      1. Embark on Psychological Trauma
      2. Read the Data, Build a Bipartite Network
      3. Build Four Weighted Networks
      4. Plot and Compare the Networks
  8. Part V. When Order Makes a Difference
    1. 17. Directed Networks
      1. Discover Asymmetric Relationships
      2. Explore Directed Networks
      3. Apply Topological Sort to Directed Acyclic Graphs
      4. Master “toposort”
  9. A1. Network Construction, Five Ways
    1. Pure Python
    2. iGraph
    3. graph-tool
    4. NetworkX
    5. NetworKit
  10. A2. Migrating from NetworkX 1.x to 2.x
  11.  Bibliography

Product information

  • Title: Complex Network Analysis in Python
  • Author(s): Dmitry Zinoviev
  • Release date: January 2018
  • Publisher(s): Pragmatic Bookshelf
  • ISBN: 9781680502695