Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Network Science with Python and NetworkX Quick Start Guide

You're reading from   Network Science with Python and NetworkX Quick Start Guide Explore and visualize network data effectively

Arrow left icon
Product type Paperback
Published in Apr 2019
Publisher Packt
ISBN-13 9781789955316
Length 190 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Edward L. Platt Edward L. Platt
Author Profile Icon Edward L. Platt
Edward L. Platt
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. What is a Network? 2. Working with Networks in NetworkX FREE CHAPTER 3. From Data to Networks 4. Affiliation Networks 5. The Small Scale - Nodes and Centrality 6. The Big Picture - Describing Networks 7. In-Between - Communities 8. Social Networks and Going Viral 9. Simulation and Analysis 10. Networks in Space and Time 11. Visualization 12. Conclusion 13. Other Books You May Enjoy Appendix

MultiGraph and MultiDiGraph – parallel edges

Meanwhile, in 18th-century Königsberg, both Graph and DiGraph fall short. Several of the bridges of Königsberg (discussed in Chapter 1, What is a Network?) connected the same two landmasses. In order to represent the bridges as a network, the nodes representing the land masses need to have multiple parallel edges, but the Graph class only allows one edge between a pair of nodes. For situations like this, NetworkX provides the MultiGraph and MultiDiGraph classes. For many applications, parallel edges can be combined into a single weighted edge, but when they can't, these classes can be used.

These MultiGraph and MultiDigraph classes work very much like Graph and DiGraph, but allow parallel edges. Any number of edges can be added between the same two endpoints. The following example reconstructs the Königsberg...

You have been reading a chapter from
Network Science with Python and NetworkX Quick Start Guide
Published in: Apr 2019
Publisher: Packt
ISBN-13: 9781789955316
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image