Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
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
Mastering Python Data Visualization

You're reading from   Mastering Python Data Visualization Generate effective results in a variety of visually appealing charts using the plotting packages in Python

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781783988327
Length 372 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Preface 1. A Conceptual Framework for Data Visualization FREE CHAPTER 2. Data Analysis and Visualization 3. Getting Started with the Python IDE 4. Numerical Computing and Interactive Plotting 5. Financial and Statistical Models 6. Statistical and Machine Learning 7. Bioinformatics, Genetics, and Network Models 8. Advanced Visualization A. Go Forth and Explore Visualization Index

Maximum flow and minimum cut

A flow network is a directed graph from a source to a destination with capacities assigned along each edge. Just as we can model a street map as a directed graph in order to find the shortest path from one place to another, we can also interpret a directed graph as a "flow network". Some examples of flow networks are liquid flowing through pipes, current passing through electrical networks, and data transferring through communication networks. The following is an example graph flow diagram:

Maximum flow and minimum cut

The edges of the G graph are expected to have a capacity that indicates how much flow the edge can support. If this capacity is not present, then it is assumed to have infinite capacity. The maximum flow of the flow network G here is 4.

In the NetworkX package, the maximum_flow_value(Graph, from, to) function evaluates the maximum flow of a graph, as shown in the following code:

import networkx as nx
G = nx.DiGraph()
G.add_edge('p','y', capacity...
lock icon The rest of the chapter is locked
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