diff options
author | loicseguin <none@none> | 2010-08-21 00:31:50 +0000 |
---|---|---|
committer | loicseguin <none@none> | 2010-08-21 00:31:50 +0000 |
commit | f45c2d882dc333f5ce92db2794b30a689e407ed2 (patch) | |
tree | 35bfd832fd6fa2718efa61763a1cb5c17500399a | |
parent | 42502ce9724f565b4ee84d6fc44629e56fb1d3ee (diff) | |
download | networkx-f45c2d882dc333f5ce92db2794b30a689e407ed2.tar.gz |
Fix documentation in mincost for Sphinx to display examples properly.
--HG--
extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401930
-rw-r--r-- | networkx/algorithms/flow/mincost.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/networkx/algorithms/flow/mincost.py b/networkx/algorithms/flow/mincost.py index 231bf25a..d6e0e4a7 100644 --- a/networkx/algorithms/flow/mincost.py +++ b/networkx/algorithms/flow/mincost.py @@ -222,6 +222,7 @@ def network_simplex(G, demand = 'demand', capacity = 'capacity', Examples -------- A simple example of a min cost flow problem. + >>> import networkx as nx >>> G = nx.DiGraph() >>> G.add_node('a', demand = -5) @@ -242,6 +243,7 @@ def network_simplex(G, demand = 'demand', capacity = 'capacity', node v a demand a 1. Then run the network simplex. The value of a min cost flow will be the distance between u and v and edges carrying positive flow will indicate the path. + >>> G=nx.DiGraph() >>> G.add_weighted_edges_from([('s','u',10), ('s','x',5), ... ('u','v',1), ('u','x',2), @@ -260,6 +262,7 @@ def network_simplex(G, demand = 'demand', capacity = 'capacity', It is possible to change the name of the attributes used for the algorithm. + >>> G = nx.DiGraph() >>> G.add_node('p', spam = -4) >>> G.add_node('q', spam = 2) @@ -480,6 +483,7 @@ def min_cost_flow_cost(G, demand = 'demand', capacity = 'capacity', Examples -------- A simple example of a min cost flow problem. + >>> import networkx as nx >>> G = nx.DiGraph() >>> G.add_node('a', demand = -5) @@ -563,6 +567,7 @@ def min_cost_flow(G, demand = 'demand', capacity = 'capacity', Examples -------- A simple example of a min cost flow problem. + >>> import networkx as nx >>> G = nx.DiGraph() >>> G.add_node('a', demand = -5) |