<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Functions — NetworkX 1.8.1 documentation</title> <link rel="stylesheet" href="../_static/networkx.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '1.8.1', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: false }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <link rel="search" type="application/opensearchdescription+xml" title="Search within NetworkX 1.8.1 documentation" href="../_static/opensearch.xml"/> <link rel="top" title="NetworkX 1.8.1 documentation" href="../index.html" /> <link rel="up" title="Reference" href="pdf_reference.html" /> <link rel="next" title="degree" href="generated/networkx.classes.function.degree.html" /> <link rel="prev" title="closeness_vitality" href="generated/networkx.algorithms.vitality.closeness_vitality.html" /> </head> <body> <div style="color: black;background-color: white; font-size: 3.2em; text-align: left; padding: 15px 10px 10px 15px"> NetworkX </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="generated/networkx.classes.function.degree.html" title="degree" accesskey="N">next</a> |</li> <li class="right" > <a href="generated/networkx.algorithms.vitality.closeness_vitality.html" title="closeness_vitality" accesskey="P">previous</a> |</li> <li><a href="http://networkx.github.com/">NetworkX Home </a> | </li> <li><a href="http://networkx.github.com/documentation.html">Documentation </a>| </li> <li><a href="http://networkx.github.com/download.html">Download </a> | </li> <li><a href="http://github.com/networkx">Developer (Github)</a></li> <li><a href="index.html" >Reference</a> »</li> <li><a href="pdf_reference.html" accesskey="U">Reference</a> »</li> </ul> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Functions</a><ul> <li><a class="reference internal" href="#graph">Graph</a><ul> </ul> </li> <li><a class="reference internal" href="#nodes">Nodes</a><ul> </ul> </li> <li><a class="reference internal" href="#edges">Edges</a><ul> </ul> </li> <li><a class="reference internal" href="#attributes">Attributes</a><ul> </ul> </li> <li><a class="reference internal" href="#freezing-graph-structure">Freezing graph structure</a><ul> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="generated/networkx.algorithms.vitality.closeness_vitality.html" title="previous chapter">closeness_vitality</a></p> <h4>Next topic</h4> <p class="topless"><a href="generated/networkx.classes.function.degree.html" title="next chapter">degree</a></p> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="module-networkx.classes.function"> <span id="functions"></span><h1>Functions<a class="headerlink" href="#module-networkx.classes.function" title="Permalink to this headline">¶</a></h1> <p>Functional interface to graph methods and assorted utilities.</p> <div class="section" id="graph"> <h2>Graph<a class="headerlink" href="#graph" title="Permalink to this headline">¶</a></h2> <table border="1" class="longtable docutils"> <colgroup> <col width="10%" /> <col width="90%" /> </colgroup> <tbody valign="top"> <tr class="row-odd"><td><a class="reference internal" href="generated/networkx.classes.function.degree.html#networkx.classes.function.degree" title="networkx.classes.function.degree"><tt class="xref py py-obj docutils literal"><span class="pre">degree</span></tt></a>(G[, nbunch, weight])</td> <td>Return degree of single node or of nbunch of nodes.</td> </tr> <tr class="row-even"><td><a class="reference internal" href="generated/networkx.classes.function.degree_histogram.html#networkx.classes.function.degree_histogram" title="networkx.classes.function.degree_histogram"><tt class="xref py py-obj docutils literal"><span class="pre">degree_histogram</span></tt></a>(G)</td> <td>Return a list of the frequency of each degree value.</td> </tr> <tr class="row-odd"><td><a class="reference internal" href="generated/networkx.classes.function.density.html#networkx.classes.function.density" title="networkx.classes.function.density"><tt class="xref py py-obj docutils literal"><span class="pre">density</span></tt></a>(G)</td> <td>Return the density of a graph.</td> </tr> <tr class="row-even"><td><a class="reference internal" href="generated/networkx.classes.function.info.html#networkx.classes.function.info" title="networkx.classes.function.info"><tt class="xref py py-obj docutils literal"><span class="pre">info</span></tt></a>(G[, n])</td> <td>Print short summary of information for the graph G or the node n.</td> </tr> <tr class="row-odd"><td><a class="reference internal" href="generated/networkx.classes.function.create_empty_copy.html#networkx.classes.function.create_empty_copy" title="networkx.classes.function.create_empty_copy"><tt class="xref py py-obj docutils literal"><span class="pre">create_empty_copy</span></tt></a>(G[, with_nodes])</td> <td>Return a copy of the graph G with all of the edges removed.</td> </tr> <tr class="row-even"><td><a class="reference internal" href="generated/networkx.classes.function.is_directed.html#networkx.classes.function.is_directed" title="networkx.classes.function.is_directed"><tt class="xref py py-obj docutils literal"><span class="pre">is_directed</span></tt></a>(G)</td> <td>Return True if graph is directed.</td> </tr> </tbody> </table> </div> <div class="section" id="nodes"> <h2>Nodes<a class="headerlink" href="#nodes" title="Permalink to this headline">¶</a></h2> <table border="1" class="longtable docutils"> <colgroup> <col width="10%" /> <col width="90%" /> </colgroup> <tbody valign="top"> <tr class="row-odd"><td><a class="reference internal" href="generated/networkx.classes.function.nodes.html#networkx.classes.function.nodes" title="networkx.classes.function.nodes"><tt class="xref py py-obj docutils literal"><span class="pre">nodes</span></tt></a>(G)</td> <td>Return a copy of the graph nodes in a list.</td> </tr> <tr class="row-even"><td><a class="reference internal" href="generated/networkx.classes.function.number_of_nodes.html#networkx.classes.function.number_of_nodes" title="networkx.classes.function.number_of_nodes"><tt class="xref py py-obj docutils literal"><span class="pre">number_of_nodes</span></tt></a>(G)</td> <td>Return the number of nodes in the graph.</td> </tr> <tr class="row-odd"><td><a class="reference internal" href="generated/networkx.classes.function.nodes_iter.html#networkx.classes.function.nodes_iter" title="networkx.classes.function.nodes_iter"><tt class="xref py py-obj docutils literal"><span class="pre">nodes_iter</span></tt></a>(G)</td> <td>Return an iterator over the graph nodes.</td> </tr> <tr class="row-even"><td><a class="reference internal" href="generated/networkx.classes.function.all_neighbors.html#networkx.classes.function.all_neighbors" title="networkx.classes.function.all_neighbors"><tt class="xref py py-obj docutils literal"><span class="pre">all_neighbors</span></tt></a>(graph, node)</td> <td>Returns all of the neighbors of a node in the graph.</td> </tr> <tr class="row-odd"><td><a class="reference internal" href="generated/networkx.classes.function.non_neighbors.html#networkx.classes.function.non_neighbors" title="networkx.classes.function.non_neighbors"><tt class="xref py py-obj docutils literal"><span class="pre">non_neighbors</span></tt></a>(graph, node)</td> <td>Returns the non-neighbors of the node in the graph.</td> </tr> </tbody> </table> </div> <div class="section" id="edges"> <h2>Edges<a class="headerlink" href="#edges" title="Permalink to this headline">¶</a></h2> <table border="1" class="longtable docutils"> <colgroup> <col width="10%" /> <col width="90%" /> </colgroup> <tbody valign="top"> <tr class="row-odd"><td><a class="reference internal" href="generated/networkx.classes.function.edges.html#networkx.classes.function.edges" title="networkx.classes.function.edges"><tt class="xref py py-obj docutils literal"><span class="pre">edges</span></tt></a>(G[, nbunch])</td> <td>Return list of edges adjacent to nodes in nbunch.</td> </tr> <tr class="row-even"><td><a class="reference internal" href="generated/networkx.classes.function.number_of_edges.html#networkx.classes.function.number_of_edges" title="networkx.classes.function.number_of_edges"><tt class="xref py py-obj docutils literal"><span class="pre">number_of_edges</span></tt></a>(G)</td> <td>Return the number of edges in the graph.</td> </tr> <tr class="row-odd"><td><a class="reference internal" href="generated/networkx.classes.function.edges_iter.html#networkx.classes.function.edges_iter" title="networkx.classes.function.edges_iter"><tt class="xref py py-obj docutils literal"><span class="pre">edges_iter</span></tt></a>(G[, nbunch])</td> <td>Return iterator over edges adjacent to nodes in nbunch.</td> </tr> </tbody> </table> </div> <div class="section" id="attributes"> <h2>Attributes<a class="headerlink" href="#attributes" title="Permalink to this headline">¶</a></h2> <table border="1" class="longtable docutils"> <colgroup> <col width="10%" /> <col width="90%" /> </colgroup> <tbody valign="top"> <tr class="row-odd"><td><a class="reference internal" href="generated/networkx.classes.function.set_node_attributes.html#networkx.classes.function.set_node_attributes" title="networkx.classes.function.set_node_attributes"><tt class="xref py py-obj docutils literal"><span class="pre">set_node_attributes</span></tt></a>(G, name, attributes)</td> <td>Set node attributes from dictionary of nodes and values</td> </tr> <tr class="row-even"><td><a class="reference internal" href="generated/networkx.classes.function.get_node_attributes.html#networkx.classes.function.get_node_attributes" title="networkx.classes.function.get_node_attributes"><tt class="xref py py-obj docutils literal"><span class="pre">get_node_attributes</span></tt></a>(G, name)</td> <td>Get node attributes from graph</td> </tr> <tr class="row-odd"><td><a class="reference internal" href="generated/networkx.classes.function.set_edge_attributes.html#networkx.classes.function.set_edge_attributes" title="networkx.classes.function.set_edge_attributes"><tt class="xref py py-obj docutils literal"><span class="pre">set_edge_attributes</span></tt></a>(G, name, attributes)</td> <td>Set edge attributes from dictionary of edge tuples and values</td> </tr> <tr class="row-even"><td><a class="reference internal" href="generated/networkx.classes.function.get_edge_attributes.html#networkx.classes.function.get_edge_attributes" title="networkx.classes.function.get_edge_attributes"><tt class="xref py py-obj docutils literal"><span class="pre">get_edge_attributes</span></tt></a>(G, name)</td> <td>Get edge attributes from graph</td> </tr> </tbody> </table> </div> <div class="section" id="freezing-graph-structure"> <h2>Freezing graph structure<a class="headerlink" href="#freezing-graph-structure" title="Permalink to this headline">¶</a></h2> <table border="1" class="longtable docutils"> <colgroup> <col width="10%" /> <col width="90%" /> </colgroup> <tbody valign="top"> <tr class="row-odd"><td><a class="reference internal" href="generated/networkx.classes.function.freeze.html#networkx.classes.function.freeze" title="networkx.classes.function.freeze"><tt class="xref py py-obj docutils literal"><span class="pre">freeze</span></tt></a>(G)</td> <td>Modify graph to prevent further change by adding or removing nodes or edges.</td> </tr> <tr class="row-even"><td><a class="reference internal" href="generated/networkx.classes.function.is_frozen.html#networkx.classes.function.is_frozen" title="networkx.classes.function.is_frozen"><tt class="xref py py-obj docutils literal"><span class="pre">is_frozen</span></tt></a>(G)</td> <td>Return True if graph is frozen.</td> </tr> </tbody> </table> </div> </div> </div> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="generated/networkx.classes.function.degree.html" title="degree" >next</a> |</li> <li class="right" > <a href="generated/networkx.algorithms.vitality.closeness_vitality.html" title="closeness_vitality" >previous</a> |</li> <li><a href="http://networkx.github.com/">NetworkX Home </a> | </li> <li><a href="http://networkx.github.com/documentation.html">Documentation </a>| </li> <li><a href="http://networkx.github.com/download.html">Download </a> | </li> <li><a href="http://github.com/networkx">Developer (Github)</a></li> <li><a href="index.html" >Reference</a> »</li> <li><a href="pdf_reference.html" >Reference</a> »</li> </ul> </div> <div class="footer"> © Copyright 2013, NetworkX Developers. Last updated on Oct 23, 2013. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>