Applying Math with Python by Sam Morley

Applying Math with Python by Sam Morley

Author:Sam Morley [Sam Morley]
Language: eng
Format: epub
Tags: COM077000 - COMPUTERS / Mathematical and Statistical Software, COM051300 - COMPUTERS / Programming / Algorithms, COM036000 - COMPUTERS / Logic Design
Publisher: Packt Publishing
Published: 2020-07-30T12:06:51+00:00


Here, Tu is the number of triangles at u and the denominator is the total possible number of triangles at u. If the degree of u (the number of edges from u) is 0 or 1, then we set cu to 0.

In this recipe, we will learn how to compute the clustering coefficient of a node in a network.

Getting ready

For this recipe, we will need the NetworkX package imported as nx and the Matplotlib pyplot module imported as plt.

How to do it...

The following steps show you how to compute the clustering coefficient of a node in a network:

First, we need to create a sample network to work with:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.