Skip to Main Content
Python Data Science Essentials
book

Python Data Science Essentials

by Alberto Boschetti
April 2015
Beginner content levelBeginner
258 pages
5h 48m
English
Packt Publishing
Content preview from Python Data Science Essentials

Graph algorithms

To get insights from graphs, many algorithms have been developed. In this chapter, we'll use a well-known graph in NetworkX, the Krackhardt Kite graph. It is a dummy graph containing 10 nodes, and it is typically used to proof graph algorithms. Krackhardt is the creator of the structure, which has the shape of a kite. It's composed of two different zones. In the first zone (composed of nodes 0 to 6), the nodes are interlinked; in the other zone (nodes 7 to 9), they are connected as a chain:

In: G = nx.krackhardt_kite_graph()
nx.draw_networkx(G)
plt.show()
Graph algorithms

Let's start with connectivity. Two nodes of a graph are connected if there ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Data Science Essentials - Second Edition

Python Data Science Essentials - Second Edition

Luca Massaron, Alberto Boschetti
Python Data Science Essentials - Third Edition

Python Data Science Essentials - Third Edition

Alberto Boschetti, Luca Massaron, Pietro Marinelli, Matteo Malosetti
Python: End-to-end Data Analysis

Python: End-to-end Data Analysis

Phuong Vothihong, Martin Czygan, Ivan Idris, Magnus Vilhelm Persson, Luiz Felipe Martins

Publisher Resources

ISBN: 9781785280429Supplemental Content