OpenCores
URL https://opencores.org/ocsvn/nocmodel/nocmodel/trunk

Subversion Repositories nocmodel

[/] [nocmodel/] [trunk/] [doc/] [nocmodel.noc_base.html] - Rev 3

Go to most recent revision | Compare with Previous | Blame | View Log

 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module nocmodel.noc_base</title>
</head><body bgcolor="#f0f0f8">
 
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="nocmodel.html"><font color="#ffffff">nocmodel</font></a>.noc_base</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/oscard/Documentos/proyectos/nocmodel-0.1/nocmodel/noc_base.py">/home/oscard/Documentos/proyectos/nocmodel-0.1/nocmodel/noc_base.py</a></font></td></tr></table>
    <p><tt>================<br>
NoCmodel&nbsp;Base&nbsp;Objects<br>
================<br>
&nbsp;&nbsp;<br>
This&nbsp;module&nbsp;declares&nbsp;classes&nbsp;used&nbsp;on&nbsp;a&nbsp;Network-on-chip&nbsp;representation:<br>
&nbsp;&nbsp;<br>
*&nbsp;NoC&nbsp;container&nbsp;class<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Router&nbsp;base&nbsp;class<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Channel&nbsp;base&nbsp;class<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;IPCore&nbsp;base&nbsp;class<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Protocol&nbsp;base&nbsp;class<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Packet&nbsp;class</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
 
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="networkx.html">networkx</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
 
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#dict">__builtin__.dict</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="nocmodel.noc_base.html#packet">packet</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="networkx.classes.graph.html#Graph">networkx.classes.graph.Graph</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="nocmodel.noc_base.html#noc">noc</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="nocmodel.noc_base.html#nocobject">nocobject</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="nocmodel.noc_base.html#channel">channel</a>
</font></dt><dt><font face="helvetica, arial"><a href="nocmodel.noc_base.html#ipcore">ipcore</a>
</font></dt><dt><font face="helvetica, arial"><a href="nocmodel.noc_base.html#protocol">protocol</a>
</font></dt><dt><font face="helvetica, arial"><a href="nocmodel.noc_base.html#router">router</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="channel">class <strong>channel</strong></a>(<a href="nocmodel.noc_base.html#nocobject">nocobject</a>)</font></td></tr>
 
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Channel&nbsp;base&nbsp;object<br>
&nbsp;<br>
This&nbsp;object&nbsp;represents&nbsp;a&nbsp;<a href="#channel">channel</a>&nbsp;object&nbsp;and&nbsp;its&nbsp;properties.&nbsp;This&nbsp;base&nbsp;class<br>
is&nbsp;meant&nbsp;to&nbsp;either&nbsp;be&nbsp;inherited&nbsp;or&nbsp;extended&nbsp;by&nbsp;adding&nbsp;other&nbsp;attributes.<br>
&nbsp;<br>
Relations&nbsp;with&nbsp;other&nbsp;objects:<br>
*&nbsp;It&nbsp;should&nbsp;be&nbsp;related&nbsp;to&nbsp;one&nbsp;NoC&nbsp;model&nbsp;object&nbsp;(self.<strong>graph_ref</strong>)<br>
*&nbsp;It&nbsp;may&nbsp;be&nbsp;one&nbsp;of&nbsp;the&nbsp;edge&nbsp;attributes&nbsp;in&nbsp;the&nbsp;graph&nbsp;model&nbsp;<br>
&nbsp;&nbsp;(edge["channel_ref"]).&nbsp;In&nbsp;this&nbsp;case,&nbsp;this&nbsp;<a href="#channel">channel</a>&nbsp;connects&nbsp;two&nbsp;routers<br>
&nbsp;&nbsp;in&nbsp;the&nbsp;NoC&nbsp;model.<br>
*&nbsp;It&nbsp;should&nbsp;have&nbsp;two&nbsp;references&nbsp;to&nbsp;NoC&nbsp;objects&nbsp;(self.<strong>endpoints</strong>).&nbsp;Two&nbsp;options<br>
&nbsp;&nbsp;exists:&nbsp;two&nbsp;routers&nbsp;references&nbsp;(<a href="#channel">channel</a>&nbsp;has&nbsp;an&nbsp;edge&nbsp;object)&nbsp;or,&nbsp;one<br>
&nbsp;&nbsp;<a href="#router">router</a>&nbsp;and&nbsp;one&nbsp;<a href="#ipcore">ipcore</a>&nbsp;(<a href="#channel">channel</a>&nbsp;don't&nbsp;have&nbsp;any&nbsp;edge&nbsp;object).<br>
&nbsp;<br>
Attributes:<br>
*&nbsp;name<br>
*&nbsp;index:&nbsp;optional&nbsp;index&nbsp;on&nbsp;a&nbsp;<a href="#noc">noc</a>&nbsp;object.&nbsp;Must&nbsp;have&nbsp;an&nbsp;index&nbsp;when&nbsp;it&nbsp;has<br>
&nbsp;&nbsp;a&nbsp;related&nbsp;edge&nbsp;in&nbsp;the&nbsp;graph&nbsp;model&nbsp;(and&nbsp;allowing&nbsp;it&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;do<br>
&nbsp;&nbsp;<a href="#channel">channel</a>&nbsp;searching).&nbsp;None&nbsp;means&nbsp;it&nbsp;is&nbsp;an&nbsp;<a href="#ipcore">ipcore</a>&nbsp;related&nbsp;<a href="#channel">channel</a><br>
*&nbsp;graph_ref&nbsp;optional&nbsp;reference&nbsp;to&nbsp;its&nbsp;graph&nbsp;model<br>
*&nbsp;endpoints&nbsp;optional&nbsp;two-item&nbsp;list&nbsp;with&nbsp;references&nbsp;to&nbsp;the&nbsp;connected&nbsp;objects<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="channel-__init__"><strong>__init__</strong></a>(self, name, index<font color="#909090">=None</font>, **kwargs)</dt></dl>
 
<dl><dt><a name="channel-is_ipcore_link"><strong>is_ipcore_link</strong></a>(self)</dt><dd><tt>Checks&nbsp;if&nbsp;this&nbsp;<a href="#channel">channel</a>&nbsp;is&nbsp;a&nbsp;special&nbsp;link&nbsp;for&nbsp;an&nbsp;<a href="#ipcore">ipcore</a>.<br>
&nbsp;<br>
Return:&nbsp;True&nbsp;if&nbsp;the&nbsp;<a href="#channel">channel</a>&nbsp;is&nbsp;related&nbsp;to&nbsp;an&nbsp;<a href="#ipcore">ipcore</a></tt></dd></dl>
 
<hr>
Methods inherited from <a href="nocmodel.noc_base.html#nocobject">nocobject</a>:<br>
<dl><dt><a name="channel-get_protocol_ref"><strong>get_protocol_ref</strong></a>(self)</dt><dd><tt>Get&nbsp;<a href="#protocol">protocol</a>&nbsp;object&nbsp;for&nbsp;this&nbsp;instance</tt></dd></dl>
 
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="ipcore">class <strong>ipcore</strong></a>(<a href="nocmodel.noc_base.html#nocobject">nocobject</a>)</font></td></tr>
 
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>IP&nbsp;core&nbsp;base&nbsp;object<br>
&nbsp;<br>
This&nbsp;object&nbsp;represents&nbsp;a&nbsp;IP&nbsp;Core&nbsp;object&nbsp;and&nbsp;its&nbsp;properties.&nbsp;This&nbsp;base&nbsp;class<br>
is&nbsp;meant&nbsp;to&nbsp;either&nbsp;be&nbsp;inherited&nbsp;or&nbsp;extended&nbsp;by&nbsp;adding&nbsp;other&nbsp;attributes.<br>
&nbsp;<br>
Relations&nbsp;with&nbsp;other&nbsp;objects:<br>
*&nbsp;It&nbsp;should&nbsp;be&nbsp;related&nbsp;to&nbsp;one&nbsp;NoC&nbsp;model&nbsp;object&nbsp;(self.<strong>graph_ref</strong>)<br>
*&nbsp;It&nbsp;should&nbsp;have&nbsp;one&nbsp;reference&nbsp;to&nbsp;a&nbsp;<a href="#router">router</a>&nbsp;object&nbsp;(self.<strong>router_ref</strong>),&nbsp;even&nbsp;if<br>
&nbsp;&nbsp;the&nbsp;<a href="#ipcore">ipcore</a>&nbsp;has&nbsp;a&nbsp;direct&nbsp;connection&nbsp;to&nbsp;the&nbsp;NoC.<br>
*&nbsp;It&nbsp;should&nbsp;have&nbsp;one&nbsp;reference&nbsp;to&nbsp;a&nbsp;<a href="#channel">channel</a>&nbsp;object&nbsp;(self.<strong>channel_ref</strong>).&nbsp;This<br>
&nbsp;&nbsp;<a href="#channel">channel</a>&nbsp;exclusively&nbsp;link&nbsp;this&nbsp;<a href="#ipcore">ipcore</a>&nbsp;and&nbsp;its&nbsp;<a href="#router">router</a>.<br>
&nbsp;<br>
Attributes:<br>
*&nbsp;name<br>
*&nbsp;router_ref:&nbsp;optional&nbsp;reference&nbsp;to&nbsp;its&nbsp;related&nbsp;<a href="#router">router</a>.<br>
*&nbsp;channel_ref:&nbsp;optional&nbsp;reference&nbsp;to&nbsp;its&nbsp;related&nbsp;<a href="#channel">channel</a><br>
*&nbsp;graph_ref:&nbsp;optional&nbsp;reference&nbsp;to&nbsp;its&nbsp;graph&nbsp;model<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ipcore-__init__"><strong>__init__</strong></a>(self, name, **kwargs)</dt></dl>
 
<hr>
Methods inherited from <a href="nocmodel.noc_base.html#nocobject">nocobject</a>:<br>
<dl><dt><a name="ipcore-get_protocol_ref"><strong>get_protocol_ref</strong></a>(self)</dt><dd><tt>Get&nbsp;<a href="#protocol">protocol</a>&nbsp;object&nbsp;for&nbsp;this&nbsp;instance</tt></dd></dl>
 
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="noc">class <strong>noc</strong></a>(<a href="networkx.classes.graph.html#Graph">networkx.classes.graph.Graph</a>)</font></td></tr>
 
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Base&nbsp;class&nbsp;for&nbsp;NoC&nbsp;modeling.<br>
Based&nbsp;on&nbsp;a&nbsp;<a href="networkx.classes.graph.html#Graph">Graph</a>&nbsp;object&nbsp;that&nbsp;hold&nbsp;the&nbsp;NoC&nbsp;structure<br>
&nbsp;<br>
Arguments<br>
*&nbsp;kwargs:&nbsp;optional&nbsp;parameters&nbsp;to&nbsp;put&nbsp;as&nbsp;object&nbsp;attributes<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="nocmodel.noc_base.html#noc">noc</a></dd>
<dd><a href="networkx.classes.graph.html#Graph">networkx.classes.graph.Graph</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="noc-__init__"><strong>__init__</strong></a>(self, **kwargs)</dt><dd><tt>NoCmodel&nbsp;constructor</tt></dd></dl>
 
<dl><dt><a name="noc-add_channel"><strong>add_channel</strong></a>(self, router1, router2, name<font color="#909090">=''</font>, **kwargs)</dt><dd><tt>Create&nbsp;a&nbsp;base&nbsp;<a href="#channel">channel</a>&nbsp;object&nbsp;to&nbsp;link&nbsp;two&nbsp;objects&nbsp;and&nbsp;add&nbsp;it&nbsp;<br>
to&nbsp;NoC&nbsp;model.<br>
&nbsp;<br>
Arguments:<br>
*&nbsp;router1:&nbsp;reference&nbsp;to&nbsp;a&nbsp;<a href="#router">router</a>,&nbsp;<a href="#router">router</a>&nbsp;index&nbsp;or&nbsp;<a href="#ipcore">ipcore</a><br>
*&nbsp;router2:&nbsp;-idem-<br>
*&nbsp;name:&nbsp;optional&nbsp;argument&nbsp;for&nbsp;<a href="#channel">channel</a>&nbsp;name<br>
*&nbsp;kwargs:&nbsp;optional&nbsp;parameters&nbsp;to&nbsp;put&nbsp;as&nbsp;object&nbsp;attributes<br>
&nbsp;<br>
Notes:<br>
*&nbsp;If&nbsp;router1&nbsp;or&nbsp;router2&nbsp;is&nbsp;an&nbsp;<a href="#ipcore">ipcore</a>&nbsp;reference,&nbsp;this&nbsp;method&nbsp;creates<br>
&nbsp;&nbsp;the&nbsp;special&nbsp;<a href="#channel">channel</a>&nbsp;object&nbsp;and&nbsp;update&nbsp;<a href="#ipcore">ipcore</a>&nbsp;references.&nbsp;Additionally,<br>
&nbsp;&nbsp;if&nbsp;both&nbsp;arguments&nbsp;are&nbsp;ipcores,&nbsp;throw&nbsp;an&nbsp;error&nbsp;exception</tt></dd></dl>
 
<dl><dt><a name="noc-add_from_channel"><strong>add_from_channel</strong></a>(self, channel_ref, router1<font color="#909090">=None</font>, router2<font color="#909090">=None</font>)</dt><dd><tt>Add&nbsp;a&nbsp;<a href="#channel">channel</a>&nbsp;object&nbsp;to&nbsp;NoC&nbsp;model.<br>
&nbsp;<br>
Use&nbsp;this&nbsp;function&nbsp;to&nbsp;add&nbsp;an&nbsp;object&nbsp;based&nbsp;on&nbsp;a&nbsp;derived&nbsp;class&nbsp;of&nbsp;<br>
base&nbsp;<a href="#channel">channel</a>&nbsp;defined&nbsp;in&nbsp;this&nbsp;module.<br>
&nbsp;<br>
Arguments<br>
*&nbsp;channel_ref:&nbsp;reference&nbsp;to&nbsp;the&nbsp;<a href="#channel">channel</a>&nbsp;object<br>
*&nbsp;router1:&nbsp;optional&nbsp;reference&nbsp;to&nbsp;a&nbsp;<a href="#router">router</a>,&nbsp;<a href="#router">router</a>&nbsp;index&nbsp;or&nbsp;<a href="#ipcore">ipcore</a><br>
*&nbsp;router2:&nbsp;-idem-<br>
&nbsp;<br>
Return:&nbsp;the&nbsp;same&nbsp;reference&nbsp;passed&nbsp;in&nbsp;channel_ref<br>
&nbsp;<br>
Notes:<br>
*&nbsp;If&nbsp;router1&nbsp;or&nbsp;router2&nbsp;are&nbsp;not&nbsp;used&nbsp;as&nbsp;arguments,&nbsp;will&nbsp;assume&nbsp;that<br>
&nbsp;&nbsp;<a href="#channel">channel</a>&nbsp;object&nbsp;has&nbsp;defined&nbsp;its&nbsp;attribute&nbsp;"endpoints"&nbsp;with&nbsp;the&nbsp;<br>
&nbsp;&nbsp;objects&nbsp;to&nbsp;connect.&nbsp;If&nbsp;the&nbsp;objects&nbsp;don't&nbsp;exist&nbsp;in&nbsp;the&nbsp;NoC&nbsp;model,<br>
&nbsp;&nbsp;throw&nbsp;an&nbsp;error&nbsp;exception.<br>
&nbsp;<br>
*&nbsp;If&nbsp;router1&nbsp;or&nbsp;router2&nbsp;is&nbsp;an&nbsp;<a href="#ipcore">ipcore</a>&nbsp;reference,&nbsp;this&nbsp;method&nbsp;creates<br>
&nbsp;&nbsp;the&nbsp;special&nbsp;<a href="#channel">channel</a>&nbsp;object&nbsp;and&nbsp;update&nbsp;<a href="#ipcore">ipcore</a>&nbsp;references.&nbsp;Additionally,<br>
&nbsp;&nbsp;if&nbsp;both&nbsp;arguments&nbsp;are&nbsp;ipcores,&nbsp;throw&nbsp;an&nbsp;error&nbsp;exception.<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
*&nbsp;This&nbsp;function&nbsp;will&nbsp;change&nbsp;channel_ref.index&nbsp;and&nbsp;channel_ref.graph_ref&nbsp;<br>
&nbsp;&nbsp;attributes&nbsp;when&nbsp;inserted&nbsp;in&nbsp;the&nbsp;NoC&nbsp;model.&nbsp;Also&nbsp;it&nbsp;may&nbsp;change&nbsp;<br>
&nbsp;&nbsp;channel_ref.endpoints&nbsp;with&nbsp;router1&nbsp;and&nbsp;router2&nbsp;references.</tt></dd></dl>
 
<dl><dt><a name="noc-add_from_ipcore"><strong>add_from_ipcore</strong></a>(self, ipcore_ref, router_ref, channel_ref<font color="#909090">=None</font>)</dt><dd><tt>Add&nbsp;a&nbsp;<a href="#ipcore">ipcore</a>&nbsp;object&nbsp;to&nbsp;NoC&nbsp;model.<br>
&nbsp;<br>
Arguments<br>
*&nbsp;ipcore_ref:&nbsp;reference&nbsp;to&nbsp;<a href="#ipcore">ipcore</a>&nbsp;object<br>
*&nbsp;router_ref:&nbsp;reference&nbsp;to&nbsp;an&nbsp;existing&nbsp;<a href="#router">router</a>&nbsp;to&nbsp;connect<br>
*&nbsp;channel_ref:&nbsp;optional&nbsp;<a href="#channel">channel</a>&nbsp;object&nbsp;that&nbsp;connect&nbsp;the&nbsp;<a href="#router">router</a>&nbsp;and<br>
&nbsp;&nbsp;the&nbsp;<a href="#ipcore">ipcore</a>.&nbsp;If&nbsp;not&nbsp;used,&nbsp;this&nbsp;function&nbsp;will&nbsp;create&nbsp;a&nbsp;new&nbsp;<a href="#channel">channel</a>&nbsp;object.<br>
&nbsp;<br>
Return:&nbsp;the&nbsp;same&nbsp;reference&nbsp;passed&nbsp;in&nbsp;ipcore_ref<br>
&nbsp;<br>
Notes:<br>
*&nbsp;This&nbsp;function&nbsp;automatically&nbsp;adds&nbsp;a&nbsp;special&nbsp;<a href="#channel">channel</a>&nbsp;object&nbsp;<br>
&nbsp;&nbsp;(<a href="#router">router</a>-to-<a href="#ipcore">ipcore</a>)&nbsp;and&nbsp;adjust&nbsp;its&nbsp;relations&nbsp;in&nbsp;all&nbsp;involved&nbsp;objects.</tt></dd></dl>
 
<dl><dt><a name="noc-add_ipcore"><strong>add_ipcore</strong></a>(self, router_ref, name<font color="#909090">=''</font>, **kwargs)</dt><dd><tt>Create&nbsp;an&nbsp;<a href="#ipcore">ipcore</a>&nbsp;object&nbsp;and&nbsp;connect&nbsp;it&nbsp;to&nbsp;the&nbsp;<a href="#router">router</a>&nbsp;reference&nbsp;argument<br>
&nbsp;<br>
Arguments<br>
*&nbsp;router_ref:&nbsp;reference&nbsp;to&nbsp;an&nbsp;existing&nbsp;<a href="#router">router</a><br>
*&nbsp;name:&nbsp;optional&nbsp;name&nbsp;for&nbsp;this&nbsp;<a href="#router">router</a>.&nbsp;By&nbsp;default&nbsp;has&nbsp;the&nbsp;form&nbsp;of&nbsp;<br>
&nbsp;&nbsp;"IP_&lt;router_index&gt;"<br>
*&nbsp;kwargs:&nbsp;optional&nbsp;parameters&nbsp;to&nbsp;put&nbsp;as&nbsp;object&nbsp;attributes<br>
&nbsp;<br>
Return:&nbsp;reference&nbsp;to&nbsp;the&nbsp;created&nbsp;<a href="#ipcore">ipcore</a>&nbsp;object<br>
&nbsp;<br>
Notes:<br>
*&nbsp;This&nbsp;function&nbsp;automatically&nbsp;adds&nbsp;a&nbsp;special&nbsp;<a href="#channel">channel</a>&nbsp;object&nbsp;<br>
&nbsp;&nbsp;(<a href="#router">router</a>-to-<a href="#ipcore">ipcore</a>)&nbsp;and&nbsp;adjust&nbsp;its&nbsp;relations&nbsp;in&nbsp;all&nbsp;involved&nbsp;objects.</tt></dd></dl>
 
<dl><dt><a name="noc-add_router"><strong>add_router</strong></a>(self, name<font color="#909090">=''</font>, with_ipcore<font color="#909090">=False</font>, **kwargs)</dt><dd><tt>Create&nbsp;a&nbsp;base&nbsp;<a href="#router">router</a>&nbsp;object&nbsp;and&nbsp;add&nbsp;it&nbsp;to&nbsp;NoC&nbsp;model.<br>
&nbsp;<br>
Arguments<br>
*&nbsp;name:&nbsp;optional&nbsp;name&nbsp;for&nbsp;this&nbsp;<a href="#router">router</a>.&nbsp;By&nbsp;default&nbsp;has&nbsp;the&nbsp;form&nbsp;of&nbsp;<br>
&nbsp;&nbsp;"R_&lt;index&gt;"<br>
*&nbsp;with_ipcore:&nbsp;If&nbsp;True,&nbsp;add&nbsp;an&nbsp;<a href="#ipcore">ipcore</a>&nbsp;to&nbsp;the&nbsp;created&nbsp;<a href="#router">router</a>.<br>
*&nbsp;kwargs:&nbsp;optional&nbsp;parameters&nbsp;to&nbsp;put&nbsp;as&nbsp;object&nbsp;attributes<br>
&nbsp;<br>
Return:&nbsp;reference&nbsp;to&nbsp;the&nbsp;created&nbsp;<a href="#router">router</a>&nbsp;object</tt></dd></dl>
 
<dl><dt><a name="noc-add_router_from_object"><strong>add_router_from_object</strong></a>(self, router_ref)</dt><dd><tt>Add&nbsp;an&nbsp;existing&nbsp;<a href="#router">router</a>&nbsp;object&nbsp;to&nbsp;NoC&nbsp;model.<br>
&nbsp;<br>
Use&nbsp;this&nbsp;function&nbsp;to&nbsp;add&nbsp;an&nbsp;object&nbsp;based&nbsp;on&nbsp;a&nbsp;derived&nbsp;class&nbsp;of&nbsp;<br>
base&nbsp;<a href="#router">router</a>&nbsp;defined&nbsp;in&nbsp;this&nbsp;module.<br>
&nbsp;<br>
Arguments<br>
*&nbsp;router_ref:&nbsp;reference&nbsp;to&nbsp;the&nbsp;<a href="#router">router</a>&nbsp;object<br>
&nbsp;<br>
Return:&nbsp;the&nbsp;same&nbsp;reference&nbsp;passed&nbsp;in&nbsp;router_ref<br>
&nbsp;<br>
Notes:&nbsp;<br>
*&nbsp;This&nbsp;function&nbsp;will&nbsp;change&nbsp;router_ref.index&nbsp;and&nbsp;router_ref.graph_ref&nbsp;<br>
&nbsp;&nbsp;attributes&nbsp;when&nbsp;inserted&nbsp;in&nbsp;the&nbsp;NoC&nbsp;model.</tt></dd></dl>
 
<dl><dt><a name="noc-all_list"><strong>all_list</strong></a>(self)</dt></dl>
 
<dl><dt><a name="noc-channel_list"><strong>channel_list</strong></a>(self)</dt></dl>
 
<dl><dt><a name="noc-del_channel"><strong>del_channel</strong></a>(self, channel_ref)</dt><dd><tt>Remove&nbsp;channel_ref&nbsp;from&nbsp;the&nbsp;NoC&nbsp;model<br>
&nbsp;<br>
TODO:&nbsp;not&nbsp;implemented</tt></dd></dl>
 
<dl><dt><a name="noc-del_ipcore"><strong>del_ipcore</strong></a>(self, ipcore_ref)</dt><dd><tt>Remove&nbsp;ipcore_ref&nbsp;from&nbsp;the&nbsp;NoC&nbsp;model<br>
&nbsp;<br>
TODO:&nbsp;not&nbsp;implemented</tt></dd></dl>
 
<dl><dt><a name="noc-del_router"><strong>del_router</strong></a>(self, router_ref)</dt><dd><tt>Remove&nbsp;router_ref&nbsp;from&nbsp;the&nbsp;NoC&nbsp;model<br>
&nbsp;<br>
TODO:&nbsp;not&nbsp;implemented</tt></dd></dl>
 
<dl><dt><a name="noc-get_router_by_address"><strong>get_router_by_address</strong></a>(self, address)</dt><dd><tt>#&nbsp;query&nbsp;functions</tt></dd></dl>
 
<dl><dt><a name="noc-ipcore_list"><strong>ipcore_list</strong></a>(self)</dt></dl>
 
<dl><dt><a name="noc-router_list"><strong>router_list</strong></a>(self)</dt><dd><tt>#&nbsp;list&nbsp;generation&nbsp;functions</tt></dd></dl>
 
<hr>
Methods inherited from <a href="networkx.classes.graph.html#Graph">networkx.classes.graph.Graph</a>:<br>
<dl><dt><a name="noc-__contains__"><strong>__contains__</strong></a>(self, n)</dt><dd><tt>Return&nbsp;True&nbsp;if&nbsp;n&nbsp;is&nbsp;a&nbsp;node,&nbsp;False&nbsp;otherwise.&nbsp;Use&nbsp;the&nbsp;expression<br>
'n&nbsp;in&nbsp;G'.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;print&nbsp;1&nbsp;in&nbsp;G<br>
True</tt></dd></dl>
 
<dl><dt><a name="noc-__getitem__"><strong>__getitem__</strong></a>(self, n)</dt><dd><tt>Return&nbsp;a&nbsp;<a href="__builtin__.html#dict">dict</a>&nbsp;of&nbsp;neighbors&nbsp;of&nbsp;node&nbsp;n.&nbsp;&nbsp;Use&nbsp;the&nbsp;expression&nbsp;'G[n]'.<br>
&nbsp;<br>
Parameters<br>
----------<br>
n&nbsp;:&nbsp;node<br>
&nbsp;&nbsp;&nbsp;A&nbsp;node&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Returns<br>
-------<br>
adj_dict&nbsp;:&nbsp;dictionary<br>
&nbsp;&nbsp;&nbsp;The&nbsp;adjacency&nbsp;dictionary&nbsp;for&nbsp;nodes&nbsp;connected&nbsp;to&nbsp;n.<br>
&nbsp;<br>
Notes<br>
-----<br>
G[n]&nbsp;is&nbsp;similar&nbsp;to&nbsp;G.<a href="#noc-neighbors">neighbors</a>(n)&nbsp;but&nbsp;the&nbsp;internal&nbsp;data&nbsp;dictionary<br>
is&nbsp;returned&nbsp;instead&nbsp;of&nbsp;a&nbsp;list.<br>
&nbsp;<br>
Assigning&nbsp;G[n]&nbsp;will&nbsp;corrupt&nbsp;the&nbsp;internal&nbsp;graph&nbsp;data&nbsp;structure.<br>
Use&nbsp;G[n]&nbsp;for&nbsp;reading&nbsp;data&nbsp;only.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;print&nbsp;G[0]<br>
{1:&nbsp;{}}</tt></dd></dl>
 
<dl><dt><a name="noc-__iter__"><strong>__iter__</strong></a>(self)</dt><dd><tt>Iterate&nbsp;over&nbsp;the&nbsp;nodes.&nbsp;Use&nbsp;the&nbsp;expression&nbsp;'for&nbsp;n&nbsp;in&nbsp;G'.<br>
&nbsp;<br>
Returns<br>
-------<br>
niter&nbsp;:&nbsp;iterator<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;iterator&nbsp;over&nbsp;all&nbsp;nodes&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;for&nbsp;n&nbsp;in&nbsp;G:<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;n,<br>
0&nbsp;1&nbsp;2&nbsp;3</tt></dd></dl>
 
<dl><dt><a name="noc-__len__"><strong>__len__</strong></a>(self)</dt><dd><tt>Return&nbsp;the&nbsp;number&nbsp;of&nbsp;nodes.&nbsp;Use&nbsp;the&nbsp;expression&nbsp;'len(G)'.<br>
&nbsp;<br>
Returns<br>
-------<br>
nnodes&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;number&nbsp;of&nbsp;nodes&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;print&nbsp;len(G)<br>
4</tt></dd></dl>
 
<dl><dt><a name="noc-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>Return&nbsp;the&nbsp;graph&nbsp;name.<br>
&nbsp;<br>
Returns<br>
-------<br>
name&nbsp;:&nbsp;string<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;name&nbsp;of&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.path_graph(4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&gt;&gt;&gt;&nbsp;print&nbsp;G<br>
path_graph(4)</tt></dd></dl>
 
<dl><dt><a name="noc-add_cycle"><strong>add_cycle</strong></a>(self, nlist, **attr)</dt><dd><tt>Add&nbsp;a&nbsp;cycle.<br>
&nbsp;<br>
Parameters<br>
----------<br>
nlist&nbsp;:&nbsp;list&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;nodes.&nbsp;&nbsp;A&nbsp;cycle&nbsp;will&nbsp;be&nbsp;constructed&nbsp;from<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;nodes&nbsp;(in&nbsp;order)&nbsp;and&nbsp;added&nbsp;to&nbsp;the&nbsp;graph.<br>
attr&nbsp;:&nbsp;keyword&nbsp;arguments,&nbsp;optional&nbsp;(default=&nbsp;no&nbsp;attributes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;Attributes&nbsp;to&nbsp;add&nbsp;to&nbsp;every&nbsp;edge&nbsp;in&nbsp;cycle.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
add_path,&nbsp;add_star<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G=nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_cycle">add_cycle</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_cycle">add_cycle</a>([10,11,12],weight=7)</tt></dd></dl>
 
<dl><dt><a name="noc-add_edge"><strong>add_edge</strong></a>(self, u, v, attr_dict<font color="#909090">=None</font>, **attr)</dt><dd><tt>Add&nbsp;an&nbsp;edge&nbsp;between&nbsp;u&nbsp;and&nbsp;v.<br>
&nbsp;<br>
The&nbsp;nodes&nbsp;u&nbsp;and&nbsp;v&nbsp;will&nbsp;be&nbsp;automatically&nbsp;added&nbsp;if&nbsp;they&nbsp;are&nbsp;<br>
not&nbsp;already&nbsp;in&nbsp;the&nbsp;graph.&nbsp;&nbsp;<br>
&nbsp;<br>
Edge&nbsp;attributes&nbsp;can&nbsp;be&nbsp;specified&nbsp;with&nbsp;keywords&nbsp;or&nbsp;by&nbsp;providing<br>
a&nbsp;dictionary&nbsp;with&nbsp;key/value&nbsp;pairs.&nbsp;&nbsp;See&nbsp;examples&nbsp;below.<br>
&nbsp;<br>
Parameters<br>
----------<br>
u,v&nbsp;:&nbsp;nodes<br>
&nbsp;&nbsp;&nbsp;&nbsp;Nodes&nbsp;can&nbsp;be,&nbsp;for&nbsp;example,&nbsp;strings&nbsp;or&nbsp;numbers.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Nodes&nbsp;must&nbsp;be&nbsp;hashable&nbsp;(and&nbsp;not&nbsp;None)&nbsp;Python&nbsp;objects.<br>
attr_dict&nbsp;:&nbsp;dictionary,&nbsp;optional&nbsp;(default=&nbsp;no&nbsp;attributes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;Dictionary&nbsp;of&nbsp;edge&nbsp;attributes.&nbsp;&nbsp;Key/value&nbsp;pairs&nbsp;will<br>
&nbsp;&nbsp;&nbsp;&nbsp;update&nbsp;existing&nbsp;data&nbsp;associated&nbsp;with&nbsp;the&nbsp;edge.<br>
attr&nbsp;:&nbsp;keyword&nbsp;arguments,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Edge&nbsp;data&nbsp;(or&nbsp;labels&nbsp;or&nbsp;objects)&nbsp;can&nbsp;be&nbsp;assigned&nbsp;using<br>
&nbsp;&nbsp;&nbsp;&nbsp;keyword&nbsp;arguments.&nbsp;&nbsp;&nbsp;<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
add_edges_from&nbsp;:&nbsp;add&nbsp;a&nbsp;collection&nbsp;of&nbsp;edges<br>
&nbsp;<br>
Notes&nbsp;<br>
-----<br>
Adding&nbsp;an&nbsp;edge&nbsp;that&nbsp;already&nbsp;exists&nbsp;updates&nbsp;the&nbsp;edge&nbsp;data.<br>
&nbsp;<br>
NetworkX&nbsp;algorithms&nbsp;designed&nbsp;for&nbsp;weighted&nbsp;graphs&nbsp;use&nbsp;as<br>
the&nbsp;edge&nbsp;weight&nbsp;a&nbsp;numerical&nbsp;value&nbsp;assigned&nbsp;to&nbsp;the&nbsp;keyword<br>
'weight'.<br>
&nbsp;<br>
Examples<br>
--------<br>
The&nbsp;following&nbsp;all&nbsp;add&nbsp;the&nbsp;edge&nbsp;e=(1,2)&nbsp;to&nbsp;graph&nbsp;G:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;e&nbsp;=&nbsp;(1,2)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>(1,&nbsp;2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;explicit&nbsp;two-node&nbsp;form<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>(*e)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;single&nbsp;edge&nbsp;as&nbsp;tuple&nbsp;of&nbsp;two&nbsp;nodes<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edges_from">add_edges_from</a>(&nbsp;[(1,2)]&nbsp;)&nbsp;#&nbsp;add&nbsp;edges&nbsp;from&nbsp;iterable&nbsp;container<br>
&nbsp;<br>
Associate&nbsp;data&nbsp;to&nbsp;edges&nbsp;using&nbsp;keywords:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>(1,&nbsp;2,&nbsp;weight=3)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>(1,&nbsp;3,&nbsp;weight=7,&nbsp;capacity=15,&nbsp;length=342.7)</tt></dd></dl>
 
<dl><dt><a name="noc-add_edges_from"><strong>add_edges_from</strong></a>(self, ebunch, attr_dict<font color="#909090">=None</font>, **attr)</dt><dd><tt>Add&nbsp;all&nbsp;the&nbsp;edges&nbsp;in&nbsp;ebunch.<br>
&nbsp;<br>
Parameters<br>
----------<br>
ebunch&nbsp;:&nbsp;container&nbsp;of&nbsp;edges<br>
&nbsp;&nbsp;&nbsp;&nbsp;Each&nbsp;edge&nbsp;given&nbsp;in&nbsp;the&nbsp;container&nbsp;will&nbsp;be&nbsp;added&nbsp;to&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;graph.&nbsp;The&nbsp;edges&nbsp;must&nbsp;be&nbsp;given&nbsp;as&nbsp;as&nbsp;2-tuples&nbsp;(u,v)&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;3-tuples&nbsp;(u,v,d)&nbsp;where&nbsp;d&nbsp;is&nbsp;a&nbsp;dictionary&nbsp;containing&nbsp;edge<br>
&nbsp;&nbsp;&nbsp;&nbsp;data.<br>
attr_dict&nbsp;:&nbsp;dictionary,&nbsp;optional&nbsp;(default=&nbsp;no&nbsp;attributes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;Dictionary&nbsp;of&nbsp;edge&nbsp;attributes.&nbsp;&nbsp;Key/value&nbsp;pairs&nbsp;will<br>
&nbsp;&nbsp;&nbsp;&nbsp;update&nbsp;existing&nbsp;data&nbsp;associated&nbsp;with&nbsp;each&nbsp;edge.<br>
attr&nbsp;:&nbsp;keyword&nbsp;arguments,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Edge&nbsp;data&nbsp;(or&nbsp;labels&nbsp;or&nbsp;objects)&nbsp;can&nbsp;be&nbsp;assigned&nbsp;using<br>
&nbsp;&nbsp;&nbsp;&nbsp;keyword&nbsp;arguments.&nbsp;&nbsp;&nbsp;<br>
&nbsp;<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
add_edge&nbsp;:&nbsp;add&nbsp;a&nbsp;single&nbsp;edge<br>
add_weighted_edges_from&nbsp;:&nbsp;convenient&nbsp;way&nbsp;to&nbsp;add&nbsp;weighted&nbsp;edges<br>
&nbsp;<br>
Notes<br>
-----<br>
Adding&nbsp;the&nbsp;same&nbsp;edge&nbsp;twice&nbsp;has&nbsp;no&nbsp;effect&nbsp;but&nbsp;any&nbsp;edge&nbsp;data<br>
will&nbsp;be&nbsp;updated&nbsp;when&nbsp;each&nbsp;duplicate&nbsp;edge&nbsp;is&nbsp;added.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edges_from">add_edges_from</a>([(0,1),(1,2)])&nbsp;#&nbsp;using&nbsp;a&nbsp;list&nbsp;of&nbsp;edge&nbsp;tuples<br>
&gt;&gt;&gt;&nbsp;e&nbsp;=&nbsp;zip(range(0,3),range(1,4))<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edges_from">add_edges_from</a>(e)&nbsp;#&nbsp;Add&nbsp;the&nbsp;path&nbsp;graph&nbsp;0-1-2-3<br>
&nbsp;<br>
Associate&nbsp;data&nbsp;to&nbsp;edges<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edges_from">add_edges_from</a>([(1,2),(2,3)],&nbsp;weight=3)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edges_from">add_edges_from</a>([(3,4),(1,4)],&nbsp;label='WN2898')</tt></dd></dl>
 
<dl><dt><a name="noc-add_node"><strong>add_node</strong></a>(self, n, attr_dict<font color="#909090">=None</font>, **attr)</dt><dd><tt>Add&nbsp;a&nbsp;single&nbsp;node&nbsp;n&nbsp;and&nbsp;update&nbsp;node&nbsp;attributes.<br>
&nbsp;<br>
Parameters<br>
----------<br>
n&nbsp;:&nbsp;node<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;node&nbsp;can&nbsp;be&nbsp;any&nbsp;hashable&nbsp;Python&nbsp;object&nbsp;except&nbsp;None.<br>
attr_dict&nbsp;:&nbsp;dictionary,&nbsp;optional&nbsp;(default=&nbsp;no&nbsp;attributes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;Dictionary&nbsp;of&nbsp;node&nbsp;attributes.&nbsp;&nbsp;Key/value&nbsp;pairs&nbsp;will<br>
&nbsp;&nbsp;&nbsp;&nbsp;update&nbsp;existing&nbsp;data&nbsp;associated&nbsp;with&nbsp;the&nbsp;node.<br>
attr&nbsp;:&nbsp;keyword&nbsp;arguments,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Set&nbsp;or&nbsp;change&nbsp;attributes&nbsp;using&nbsp;key=value.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
add_nodes_from<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_node">add_node</a>(1)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_node">add_node</a>('Hello')<br>
&gt;&gt;&gt;&nbsp;K3&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>([(0,1),(1,2),(2,0)])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_node">add_node</a>(K3)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-number_of_nodes">number_of_nodes</a>()<br>
3<br>
&nbsp;<br>
Use&nbsp;keywords&nbsp;set/change&nbsp;node&nbsp;attributes:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_node">add_node</a>(1,size=10)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_node">add_node</a>(3,weight=0.4,UTM=('13S',382871,3972649))<br>
&nbsp;<br>
Notes<br>
-----<br>
A&nbsp;hashable&nbsp;object&nbsp;is&nbsp;one&nbsp;that&nbsp;can&nbsp;be&nbsp;used&nbsp;as&nbsp;a&nbsp;key&nbsp;in&nbsp;a&nbsp;Python<br>
dictionary.&nbsp;This&nbsp;includes&nbsp;strings,&nbsp;numbers,&nbsp;tuples&nbsp;of&nbsp;strings<br>
and&nbsp;numbers,&nbsp;etc.<br>
&nbsp;<br>
On&nbsp;many&nbsp;platforms&nbsp;hashable&nbsp;items&nbsp;also&nbsp;include&nbsp;mutables&nbsp;such&nbsp;as<br>
NetworkX&nbsp;Graphs,&nbsp;though&nbsp;one&nbsp;should&nbsp;be&nbsp;careful&nbsp;that&nbsp;the&nbsp;hash<br>
doesn't&nbsp;change&nbsp;on&nbsp;mutables.</tt></dd></dl>
 
<dl><dt><a name="noc-add_nodes_from"><strong>add_nodes_from</strong></a>(self, nodes, **attr)</dt><dd><tt>Add&nbsp;multiple&nbsp;nodes.<br>
&nbsp;<br>
Parameters<br>
----------<br>
nodes&nbsp;:&nbsp;iterable&nbsp;container<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;container&nbsp;of&nbsp;nodes&nbsp;(list,&nbsp;<a href="__builtin__.html#dict">dict</a>,&nbsp;set,&nbsp;etc.).&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;OR<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;container&nbsp;of&nbsp;(node,&nbsp;attribute&nbsp;<a href="__builtin__.html#dict">dict</a>)&nbsp;tuples.<br>
&nbsp;&nbsp;&nbsp;&nbsp;Node&nbsp;attributes&nbsp;are&nbsp;updated&nbsp;using&nbsp;the&nbsp;attribute&nbsp;<a href="__builtin__.html#dict">dict</a>.<br>
attr&nbsp;:&nbsp;keyword&nbsp;arguments,&nbsp;optional&nbsp;(default=&nbsp;no&nbsp;attributes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;Update&nbsp;attributes&nbsp;for&nbsp;all&nbsp;nodes&nbsp;in&nbsp;nodes.<br>
&nbsp;&nbsp;&nbsp;&nbsp;Node&nbsp;attributes&nbsp;specified&nbsp;in&nbsp;nodes&nbsp;as&nbsp;a&nbsp;tuple<br>
&nbsp;&nbsp;&nbsp;&nbsp;take&nbsp;precedence&nbsp;over&nbsp;attributes&nbsp;specified&nbsp;generally.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
add_node<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_nodes_from">add_nodes_from</a>('Hello')<br>
&gt;&gt;&gt;&nbsp;K3&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>([(0,1),(1,2),(2,0)])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_nodes_from">add_nodes_from</a>(K3)<br>
&gt;&gt;&gt;&nbsp;sorted(G.<a href="#noc-nodes">nodes</a>())<br>
[0,&nbsp;1,&nbsp;2,&nbsp;'H',&nbsp;'e',&nbsp;'l',&nbsp;'o']<br>
&nbsp;<br>
Use&nbsp;keywords&nbsp;to&nbsp;update&nbsp;specific&nbsp;node&nbsp;attributes&nbsp;for&nbsp;every&nbsp;node.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_nodes_from">add_nodes_from</a>([1,2],&nbsp;size=10)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_nodes_from">add_nodes_from</a>([3,4],&nbsp;weight=0.4)<br>
&nbsp;<br>
Use&nbsp;(node,&nbsp;attrdict)&nbsp;tuples&nbsp;to&nbsp;update&nbsp;attributes&nbsp;for&nbsp;specific<br>
nodes.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_nodes_from">add_nodes_from</a>([(1,<a href="__builtin__.html#dict">dict</a>(size=11)),&nbsp;(2,{'color':'blue'})])<br>
&gt;&gt;&gt;&nbsp;G.node[1]['size']<br>
11<br>
&gt;&gt;&gt;&nbsp;H&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()<br>
&gt;&gt;&gt;&nbsp;H.<a href="#noc-add_nodes_from">add_nodes_from</a>(G.<a href="#noc-nodes">nodes</a>(data=True))<br>
&gt;&gt;&gt;&nbsp;H.node[1]['size']<br>
11</tt></dd></dl>
 
<dl><dt><a name="noc-add_path"><strong>add_path</strong></a>(self, nlist, **attr)</dt><dd><tt>Add&nbsp;a&nbsp;path.<br>
&nbsp;<br>
Parameters<br>
----------<br>
nlist&nbsp;:&nbsp;list&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;nodes.&nbsp;&nbsp;A&nbsp;path&nbsp;will&nbsp;be&nbsp;constructed&nbsp;from<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;nodes&nbsp;(in&nbsp;order)&nbsp;and&nbsp;added&nbsp;to&nbsp;the&nbsp;graph.<br>
attr&nbsp;:&nbsp;keyword&nbsp;arguments,&nbsp;optional&nbsp;(default=&nbsp;no&nbsp;attributes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;Attributes&nbsp;to&nbsp;add&nbsp;to&nbsp;every&nbsp;edge&nbsp;in&nbsp;path.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
add_star,&nbsp;add_cycle<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G=nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([10,11,12],weight=7)</tt></dd></dl>
 
<dl><dt><a name="noc-add_star"><strong>add_star</strong></a>(self, nlist, **attr)</dt><dd><tt>Add&nbsp;a&nbsp;star.<br>
&nbsp;<br>
The&nbsp;first&nbsp;node&nbsp;in&nbsp;nlist&nbsp;is&nbsp;the&nbsp;middle&nbsp;of&nbsp;the&nbsp;star.&nbsp;&nbsp;It&nbsp;is&nbsp;connected&nbsp;<br>
to&nbsp;all&nbsp;other&nbsp;nodes&nbsp;in&nbsp;nlist.<br>
&nbsp;<br>
Parameters<br>
----------<br>
nlist&nbsp;:&nbsp;list&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;nodes.&nbsp;<br>
attr&nbsp;:&nbsp;keyword&nbsp;arguments,&nbsp;optional&nbsp;(default=&nbsp;no&nbsp;attributes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;Attributes&nbsp;to&nbsp;add&nbsp;to&nbsp;every&nbsp;edge&nbsp;in&nbsp;star.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
add_path,&nbsp;add_cycle<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_star">add_star</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_star">add_star</a>([10,11,12],weight=2)</tt></dd></dl>
 
<dl><dt><a name="noc-add_weighted_edges_from"><strong>add_weighted_edges_from</strong></a>(self, ebunch, **attr)</dt><dd><tt>Add&nbsp;all&nbsp;the&nbsp;edges&nbsp;in&nbsp;ebunch&nbsp;as&nbsp;weighted&nbsp;edges&nbsp;with&nbsp;specified<br>
weights.<br>
&nbsp;<br>
Parameters<br>
----------<br>
ebunch&nbsp;:&nbsp;container&nbsp;of&nbsp;edges<br>
&nbsp;&nbsp;&nbsp;&nbsp;Each&nbsp;edge&nbsp;given&nbsp;in&nbsp;the&nbsp;list&nbsp;or&nbsp;container&nbsp;will&nbsp;be&nbsp;added<br>
&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;the&nbsp;graph.&nbsp;The&nbsp;edges&nbsp;must&nbsp;be&nbsp;given&nbsp;as&nbsp;3-tuples&nbsp;(u,v,w)<br>
&nbsp;&nbsp;&nbsp;&nbsp;where&nbsp;w&nbsp;is&nbsp;a&nbsp;number.<br>
attr&nbsp;:&nbsp;keyword&nbsp;arguments,&nbsp;optional&nbsp;(default=&nbsp;no&nbsp;attributes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;Edge&nbsp;attributes&nbsp;to&nbsp;add/update&nbsp;for&nbsp;all&nbsp;edges.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
add_edge&nbsp;:&nbsp;add&nbsp;a&nbsp;single&nbsp;edge<br>
add_edges_from&nbsp;:&nbsp;add&nbsp;multiple&nbsp;edges<br>
&nbsp;<br>
Notes<br>
-----<br>
Adding&nbsp;the&nbsp;same&nbsp;edge&nbsp;twice&nbsp;has&nbsp;no&nbsp;effect&nbsp;but&nbsp;any&nbsp;edge&nbsp;data<br>
will&nbsp;be&nbsp;updated&nbsp;when&nbsp;each&nbsp;duplicate&nbsp;edge&nbsp;is&nbsp;added.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_weighted_edges_from">add_weighted_edges_from</a>([(0,1,3.0),(1,2,7.5)])</tt></dd></dl>
 
<dl><dt><a name="noc-adjacency_iter"><strong>adjacency_iter</strong></a>(self)</dt><dd><tt>Return&nbsp;an&nbsp;iterator&nbsp;of&nbsp;(node,&nbsp;adjacency&nbsp;<a href="__builtin__.html#dict">dict</a>)&nbsp;tuples&nbsp;for&nbsp;all&nbsp;nodes.<br>
&nbsp;<br>
This&nbsp;is&nbsp;the&nbsp;fastest&nbsp;way&nbsp;to&nbsp;look&nbsp;at&nbsp;every&nbsp;edge.&nbsp;<br>
For&nbsp;directed&nbsp;graphs,&nbsp;only&nbsp;outgoing&nbsp;adjacencies&nbsp;are&nbsp;included.<br>
&nbsp;<br>
Returns<br>
-------<br>
adj_iter&nbsp;:&nbsp;iterator<br>
&nbsp;&nbsp;&nbsp;An&nbsp;iterator&nbsp;of&nbsp;(node,&nbsp;adjacency&nbsp;dictionary)&nbsp;for&nbsp;all&nbsp;nodes&nbsp;in<br>
&nbsp;&nbsp;&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
adjacency_list<br>
&nbsp;&nbsp;&nbsp;<br>
Examples&nbsp;&nbsp;&nbsp;<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;[(n,nbrdict)&nbsp;for&nbsp;n,nbrdict&nbsp;in&nbsp;G.<a href="#noc-adjacency_iter">adjacency_iter</a>()]<br>
[(0,&nbsp;{1:&nbsp;{}}),&nbsp;(1,&nbsp;{0:&nbsp;{},&nbsp;2:&nbsp;{}}),&nbsp;(2,&nbsp;{1:&nbsp;{},&nbsp;3:&nbsp;{}}),&nbsp;(3,&nbsp;{2:&nbsp;{}})]</tt></dd></dl>
 
<dl><dt><a name="noc-adjacency_list"><strong>adjacency_list</strong></a>(self)</dt><dd><tt>Return&nbsp;an&nbsp;adjacency&nbsp;list&nbsp;representation&nbsp;of&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
The&nbsp;output&nbsp;adjacency&nbsp;list&nbsp;is&nbsp;in&nbsp;the&nbsp;order&nbsp;of&nbsp;G.<a href="#noc-nodes">nodes</a>().<br>
For&nbsp;directed&nbsp;graphs,&nbsp;only&nbsp;outgoing&nbsp;adjacencies&nbsp;are&nbsp;included.&nbsp;<br>
&nbsp;<br>
Returns<br>
-------<br>
adj_list&nbsp;:&nbsp;lists&nbsp;of&nbsp;lists<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;adjacency&nbsp;structure&nbsp;of&nbsp;the&nbsp;graph&nbsp;as&nbsp;a&nbsp;list&nbsp;of&nbsp;lists.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
adjacency_iter<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-adjacency_list">adjacency_list</a>()&nbsp;#&nbsp;in&nbsp;order&nbsp;given&nbsp;by&nbsp;G.<a href="#noc-nodes">nodes</a>()<br>
[[1],&nbsp;[0,&nbsp;2],&nbsp;[1,&nbsp;3],&nbsp;[2]]</tt></dd></dl>
 
<dl><dt><a name="noc-clear"><strong>clear</strong></a>(self)</dt><dd><tt>Remove&nbsp;all&nbsp;nodes&nbsp;and&nbsp;edges&nbsp;from&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
This&nbsp;also&nbsp;removes&nbsp;the&nbsp;name,&nbsp;and&nbsp;all&nbsp;graph,&nbsp;node,&nbsp;and&nbsp;edge&nbsp;attributes.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-clear">clear</a>()<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-nodes">nodes</a>()<br>
[]<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-edges">edges</a>()<br>
[]</tt></dd></dl>
 
<dl><dt><a name="noc-copy"><strong>copy</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Returns<br>
-------<br>
G&nbsp;:&nbsp;<a href="networkx.classes.graph.html#Graph">Graph</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;copy&nbsp;of&nbsp;the&nbsp;graph.&nbsp;&nbsp;&nbsp;<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
to_directed:&nbsp;return&nbsp;a&nbsp;directed&nbsp;copy&nbsp;of&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Notes<br>
-----<br>
This&nbsp;makes&nbsp;a&nbsp;complete&nbsp;copy&nbsp;of&nbsp;the&nbsp;graph&nbsp;including&nbsp;all&nbsp;of&nbsp;the&nbsp;<br>
node&nbsp;or&nbsp;edge&nbsp;attributes.&nbsp;<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;H&nbsp;=&nbsp;G.<a href="#noc-copy">copy</a>()</tt></dd></dl>
 
<dl><dt><a name="noc-degree"><strong>degree</strong></a>(self, nbunch<font color="#909090">=None</font>, weighted<font color="#909090">=False</font>)</dt><dd><tt>Return&nbsp;the&nbsp;degree&nbsp;of&nbsp;a&nbsp;node&nbsp;or&nbsp;nodes.<br>
&nbsp;<br>
The&nbsp;node&nbsp;degree&nbsp;is&nbsp;the&nbsp;number&nbsp;of&nbsp;edges&nbsp;adjacent&nbsp;to&nbsp;that&nbsp;node.&nbsp;<br>
&nbsp;<br>
Parameters<br>
----------<br>
nbunch&nbsp;:&nbsp;iterable&nbsp;container,&nbsp;optional&nbsp;(default=all&nbsp;nodes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;container&nbsp;of&nbsp;nodes.&nbsp;&nbsp;The&nbsp;container&nbsp;will&nbsp;be&nbsp;iterated<br>
&nbsp;&nbsp;&nbsp;&nbsp;through&nbsp;once.&nbsp;&nbsp;&nbsp;&nbsp;<br>
weighted&nbsp;:&nbsp;bool,&nbsp;optional&nbsp;(default=False)<br>
&nbsp;&nbsp;&nbsp;If&nbsp;True&nbsp;return&nbsp;the&nbsp;sum&nbsp;of&nbsp;edge&nbsp;weights&nbsp;adjacent&nbsp;to&nbsp;the&nbsp;node.&nbsp;&nbsp;<br>
&nbsp;<br>
Returns<br>
-------<br>
nd&nbsp;:&nbsp;dictionary,&nbsp;or&nbsp;number<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;dictionary&nbsp;with&nbsp;nodes&nbsp;as&nbsp;keys&nbsp;and&nbsp;degree&nbsp;as&nbsp;values&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;number&nbsp;if&nbsp;a&nbsp;single&nbsp;node&nbsp;is&nbsp;specified.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-degree">degree</a>(0)<br>
1<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-degree">degree</a>([0,1])<br>
{0:&nbsp;1,&nbsp;1:&nbsp;2}<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-degree">degree</a>([0,1]).values()<br>
[1,&nbsp;2]</tt></dd></dl>
 
<dl><dt><a name="noc-degree_iter"><strong>degree_iter</strong></a>(self, nbunch<font color="#909090">=None</font>, weighted<font color="#909090">=False</font>)</dt><dd><tt>Return&nbsp;an&nbsp;iterator&nbsp;for&nbsp;(node,&nbsp;degree).&nbsp;<br>
&nbsp;<br>
The&nbsp;node&nbsp;degree&nbsp;is&nbsp;the&nbsp;number&nbsp;of&nbsp;edges&nbsp;adjacent&nbsp;to&nbsp;the&nbsp;node.&nbsp;<br>
&nbsp;<br>
Parameters<br>
----------<br>
nbunch&nbsp;:&nbsp;iterable&nbsp;container,&nbsp;optional&nbsp;(default=all&nbsp;nodes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;container&nbsp;of&nbsp;nodes.&nbsp;&nbsp;The&nbsp;container&nbsp;will&nbsp;be&nbsp;iterated<br>
&nbsp;&nbsp;&nbsp;&nbsp;through&nbsp;once.&nbsp;&nbsp;&nbsp;&nbsp;<br>
weighted&nbsp;:&nbsp;bool,&nbsp;optional&nbsp;(default=False)<br>
&nbsp;&nbsp;&nbsp;If&nbsp;True&nbsp;return&nbsp;the&nbsp;sum&nbsp;of&nbsp;edge&nbsp;weights&nbsp;adjacent&nbsp;to&nbsp;the&nbsp;node.&nbsp;&nbsp;<br>
&nbsp;<br>
Returns<br>
-------<br>
nd_iter&nbsp;:&nbsp;an&nbsp;iterator&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;iterator&nbsp;returns&nbsp;two-tuples&nbsp;of&nbsp;(node,&nbsp;degree).<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
degree<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;list(G.<a href="#noc-degree_iter">degree_iter</a>(0))&nbsp;#&nbsp;node&nbsp;0&nbsp;with&nbsp;degree&nbsp;1<br>
[(0,&nbsp;1)]<br>
&gt;&gt;&gt;&nbsp;list(G.<a href="#noc-degree_iter">degree_iter</a>([0,1]))<br>
[(0,&nbsp;1),&nbsp;(1,&nbsp;2)]</tt></dd></dl>
 
<dl><dt><a name="noc-edges"><strong>edges</strong></a>(self, nbunch<font color="#909090">=None</font>, data<font color="#909090">=False</font>)</dt><dd><tt>Return&nbsp;a&nbsp;list&nbsp;of&nbsp;edges.<br>
&nbsp;<br>
Edges&nbsp;are&nbsp;returned&nbsp;as&nbsp;tuples&nbsp;with&nbsp;optional&nbsp;data&nbsp;<br>
in&nbsp;the&nbsp;order&nbsp;(node,&nbsp;neighbor,&nbsp;data).<br>
&nbsp;<br>
Parameters<br>
----------<br>
nbunch&nbsp;:&nbsp;iterable&nbsp;container,&nbsp;optional&nbsp;(default=&nbsp;all&nbsp;nodes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;container&nbsp;of&nbsp;nodes.&nbsp;&nbsp;The&nbsp;container&nbsp;will&nbsp;be&nbsp;iterated<br>
&nbsp;&nbsp;&nbsp;&nbsp;through&nbsp;once.<br>
data&nbsp;:&nbsp;bool,&nbsp;optional&nbsp;(default=False)<br>
&nbsp;&nbsp;&nbsp;&nbsp;Return&nbsp;two&nbsp;tuples&nbsp;(u,v)&nbsp;(False)&nbsp;or&nbsp;three-tuples&nbsp;(u,v,data)&nbsp;(True).<br>
&nbsp;<br>
Returns<br>
--------<br>
edge_list:&nbsp;list&nbsp;of&nbsp;edge&nbsp;tuples<br>
&nbsp;&nbsp;&nbsp;&nbsp;Edges&nbsp;that&nbsp;are&nbsp;adjacent&nbsp;to&nbsp;any&nbsp;node&nbsp;in&nbsp;nbunch,&nbsp;or&nbsp;a&nbsp;list<br>
&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;all&nbsp;edges&nbsp;if&nbsp;nbunch&nbsp;is&nbsp;not&nbsp;specified.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
edges_iter&nbsp;:&nbsp;return&nbsp;an&nbsp;iterator&nbsp;over&nbsp;the&nbsp;edges<br>
&nbsp;<br>
Notes<br>
-----<br>
Nodes&nbsp;in&nbsp;nbunch&nbsp;that&nbsp;are&nbsp;not&nbsp;in&nbsp;the&nbsp;graph&nbsp;will&nbsp;be&nbsp;(quietly)&nbsp;ignored.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-edges">edges</a>()<br>
[(0,&nbsp;1),&nbsp;(1,&nbsp;2),&nbsp;(2,&nbsp;3)]<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-edges">edges</a>(data=True)&nbsp;#&nbsp;default&nbsp;edge&nbsp;data&nbsp;is&nbsp;{}&nbsp;(empty&nbsp;dictionary)<br>
[(0,&nbsp;1,&nbsp;{}),&nbsp;(1,&nbsp;2,&nbsp;{}),&nbsp;(2,&nbsp;3,&nbsp;{})]<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-edges">edges</a>([0,3])<br>
[(0,&nbsp;1),&nbsp;(3,&nbsp;2)]<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-edges">edges</a>(0)<br>
[(0,&nbsp;1)]</tt></dd></dl>
 
<dl><dt><a name="noc-edges_iter"><strong>edges_iter</strong></a>(self, nbunch<font color="#909090">=None</font>, data<font color="#909090">=False</font>)</dt><dd><tt>Return&nbsp;an&nbsp;iterator&nbsp;over&nbsp;the&nbsp;edges.<br>
&nbsp;<br>
Edges&nbsp;are&nbsp;returned&nbsp;as&nbsp;tuples&nbsp;with&nbsp;optional&nbsp;data&nbsp;<br>
in&nbsp;the&nbsp;order&nbsp;(node,&nbsp;neighbor,&nbsp;data).<br>
&nbsp;<br>
Parameters<br>
----------<br>
nbunch&nbsp;:&nbsp;iterable&nbsp;container,&nbsp;optional&nbsp;(default=&nbsp;all&nbsp;nodes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;container&nbsp;of&nbsp;nodes.&nbsp;&nbsp;The&nbsp;container&nbsp;will&nbsp;be&nbsp;iterated<br>
&nbsp;&nbsp;&nbsp;&nbsp;through&nbsp;once.<br>
data&nbsp;:&nbsp;bool,&nbsp;optional&nbsp;(default=False)<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;True,&nbsp;return&nbsp;edge&nbsp;attribute&nbsp;<a href="__builtin__.html#dict">dict</a>&nbsp;in&nbsp;3-tuple&nbsp;(u,v,data).<br>
&nbsp;<br>
Returns<br>
-------<br>
edge_iter&nbsp;:&nbsp;iterator<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;iterator&nbsp;of&nbsp;(u,v)&nbsp;or&nbsp;(u,v,d)&nbsp;tuples&nbsp;of&nbsp;edges.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
edges&nbsp;:&nbsp;return&nbsp;a&nbsp;list&nbsp;of&nbsp;edges<br>
&nbsp;<br>
Notes<br>
-----<br>
Nodes&nbsp;in&nbsp;nbunch&nbsp;that&nbsp;are&nbsp;not&nbsp;in&nbsp;the&nbsp;graph&nbsp;will&nbsp;be&nbsp;(quietly)&nbsp;ignored.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;MultiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;[e&nbsp;for&nbsp;e&nbsp;in&nbsp;G.<a href="#noc-edges_iter">edges_iter</a>()]<br>
[(0,&nbsp;1),&nbsp;(1,&nbsp;2),&nbsp;(2,&nbsp;3)]<br>
&gt;&gt;&gt;&nbsp;list(G.<a href="#noc-edges_iter">edges_iter</a>(data=True))&nbsp;#&nbsp;default&nbsp;data&nbsp;is&nbsp;{}&nbsp;(empty&nbsp;<a href="__builtin__.html#dict">dict</a>)<br>
[(0,&nbsp;1,&nbsp;{}),&nbsp;(1,&nbsp;2,&nbsp;{}),&nbsp;(2,&nbsp;3,&nbsp;{})]<br>
&gt;&gt;&gt;&nbsp;list(G.<a href="#noc-edges_iter">edges_iter</a>([0,3]))<br>
[(0,&nbsp;1),&nbsp;(3,&nbsp;2)]<br>
&gt;&gt;&gt;&nbsp;list(G.<a href="#noc-edges_iter">edges_iter</a>(0))<br>
[(0,&nbsp;1)]</tt></dd></dl>
 
<dl><dt><a name="noc-get_edge_data"><strong>get_edge_data</strong></a>(self, u, v, default<font color="#909090">=None</font>)</dt><dd><tt>Return&nbsp;the&nbsp;attribute&nbsp;dictionary&nbsp;associated&nbsp;with&nbsp;edge&nbsp;(u,v).<br>
&nbsp;<br>
Parameters<br>
----------<br>
u,v&nbsp;:&nbsp;nodes<br>
default:&nbsp;&nbsp;any&nbsp;Python&nbsp;object&nbsp;(default=None)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Value&nbsp;to&nbsp;return&nbsp;if&nbsp;the&nbsp;edge&nbsp;(u,v)&nbsp;is&nbsp;not&nbsp;found.&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
Returns<br>
-------<br>
edge_dict&nbsp;:&nbsp;dictionary<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;edge&nbsp;attribute&nbsp;dictionary.<br>
&nbsp;<br>
Notes<br>
-----<br>
It&nbsp;is&nbsp;faster&nbsp;to&nbsp;use&nbsp;G[u][v].<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G[0][1]<br>
{}<br>
&nbsp;<br>
Warning:&nbsp;Assigning&nbsp;G[u][v]&nbsp;corrupts&nbsp;the&nbsp;graph&nbsp;data&nbsp;structure.<br>
But&nbsp;it&nbsp;is&nbsp;safe&nbsp;to&nbsp;assign&nbsp;attributes&nbsp;to&nbsp;that&nbsp;dictionary,<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G[0][1]['weight']&nbsp;=&nbsp;7<br>
&gt;&gt;&gt;&nbsp;G[0][1]['weight']<br>
7<br>
&gt;&gt;&gt;&nbsp;G[1][0]['weight']<br>
7<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-get_edge_data">get_edge_data</a>(0,1)&nbsp;#&nbsp;default&nbsp;edge&nbsp;data&nbsp;is&nbsp;{}<br>
{}<br>
&gt;&gt;&gt;&nbsp;e&nbsp;=&nbsp;(0,1)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-get_edge_data">get_edge_data</a>(*e)&nbsp;#&nbsp;tuple&nbsp;form<br>
{}<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-get_edge_data">get_edge_data</a>('a','b',default=0)&nbsp;#&nbsp;edge&nbsp;not&nbsp;in&nbsp;graph,&nbsp;return&nbsp;0<br>
0</tt></dd></dl>
 
<dl><dt><a name="noc-has_edge"><strong>has_edge</strong></a>(self, u, v)</dt><dd><tt>Return&nbsp;True&nbsp;if&nbsp;the&nbsp;edge&nbsp;(u,v)&nbsp;is&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Parameters<br>
----------<br>
u,v&nbsp;:&nbsp;nodes<br>
&nbsp;&nbsp;&nbsp;&nbsp;Nodes&nbsp;can&nbsp;be,&nbsp;for&nbsp;example,&nbsp;strings&nbsp;or&nbsp;numbers.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Nodes&nbsp;must&nbsp;be&nbsp;hashable&nbsp;(and&nbsp;not&nbsp;None)&nbsp;Python&nbsp;objects.<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
Returns<br>
-------<br>
edge_ind&nbsp;:&nbsp;bool<br>
&nbsp;&nbsp;&nbsp;&nbsp;True&nbsp;if&nbsp;edge&nbsp;is&nbsp;in&nbsp;the&nbsp;graph,&nbsp;False&nbsp;otherwise.<br>
&nbsp;<br>
Examples<br>
--------<br>
Can&nbsp;be&nbsp;called&nbsp;either&nbsp;using&nbsp;two&nbsp;nodes&nbsp;u,v&nbsp;or&nbsp;edge&nbsp;tuple&nbsp;(u,v)<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-has_edge">has_edge</a>(0,1)&nbsp;&nbsp;#&nbsp;using&nbsp;two&nbsp;nodes<br>
True<br>
&gt;&gt;&gt;&nbsp;e&nbsp;=&nbsp;(0,1)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-has_edge">has_edge</a>(*e)&nbsp;&nbsp;#&nbsp;&nbsp;e&nbsp;is&nbsp;a&nbsp;2-tuple&nbsp;(u,v)<br>
True<br>
&gt;&gt;&gt;&nbsp;e&nbsp;=&nbsp;(0,1,{'weight':7})<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-has_edge">has_edge</a>(*e[:2])&nbsp;&nbsp;#&nbsp;e&nbsp;is&nbsp;a&nbsp;3-tuple&nbsp;(u,v,data_dictionary)<br>
True<br>
&nbsp;<br>
The&nbsp;following&nbsp;syntax&nbsp;are&nbsp;all&nbsp;equivalent:&nbsp;<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-has_edge">has_edge</a>(0,1)<br>
True<br>
&gt;&gt;&gt;&nbsp;1&nbsp;in&nbsp;G[0]&nbsp;&nbsp;#&nbsp;though&nbsp;this&nbsp;gives&nbsp;KeyError&nbsp;if&nbsp;0&nbsp;not&nbsp;in&nbsp;G<br>
True</tt></dd></dl>
 
<dl><dt><a name="noc-has_node"><strong>has_node</strong></a>(self, n)</dt><dd><tt>Return&nbsp;True&nbsp;if&nbsp;the&nbsp;graph&nbsp;contains&nbsp;the&nbsp;node&nbsp;n.<br>
&nbsp;<br>
Parameters<br>
----------<br>
n&nbsp;:&nbsp;node<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2])<br>
&gt;&gt;&gt;&nbsp;print&nbsp;G.<a href="#noc-has_node">has_node</a>(0)<br>
True<br>
&nbsp;<br>
It&nbsp;is&nbsp;more&nbsp;readable&nbsp;and&nbsp;simpler&nbsp;to&nbsp;use<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;0&nbsp;in&nbsp;G<br>
True</tt></dd></dl>
 
<dl><dt><a name="noc-is_directed"><strong>is_directed</strong></a>(self)</dt><dd><tt>Return&nbsp;True&nbsp;if&nbsp;graph&nbsp;is&nbsp;directed,&nbsp;False&nbsp;otherwise.</tt></dd></dl>
 
<dl><dt><a name="noc-is_multigraph"><strong>is_multigraph</strong></a>(self)</dt><dd><tt>Return&nbsp;True&nbsp;if&nbsp;graph&nbsp;is&nbsp;a&nbsp;multigraph,&nbsp;False&nbsp;otherwise.</tt></dd></dl>
 
<dl><dt><a name="noc-nbunch_iter"><strong>nbunch_iter</strong></a>(self, nbunch<font color="#909090">=None</font>)</dt><dd><tt>Return&nbsp;an&nbsp;iterator&nbsp;of&nbsp;nodes&nbsp;contained&nbsp;in&nbsp;nbunch&nbsp;that&nbsp;are&nbsp;<br>
also&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
The&nbsp;nodes&nbsp;in&nbsp;nbunch&nbsp;are&nbsp;checked&nbsp;for&nbsp;membership&nbsp;in&nbsp;the&nbsp;graph<br>
and&nbsp;if&nbsp;not&nbsp;are&nbsp;silently&nbsp;ignored.<br>
&nbsp;<br>
Parameters<br>
----------<br>
nbunch&nbsp;:&nbsp;iterable&nbsp;container,&nbsp;optional&nbsp;(default=all&nbsp;nodes)<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;container&nbsp;of&nbsp;nodes.&nbsp;&nbsp;The&nbsp;container&nbsp;will&nbsp;be&nbsp;iterated<br>
&nbsp;&nbsp;&nbsp;&nbsp;through&nbsp;once.&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;<br>
Returns<br>
-------<br>
niter&nbsp;:&nbsp;iterator<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;iterator&nbsp;over&nbsp;nodes&nbsp;in&nbsp;nbunch&nbsp;that&nbsp;are&nbsp;also&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;nbunch&nbsp;is&nbsp;None,&nbsp;iterate&nbsp;over&nbsp;all&nbsp;nodes&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Raises<br>
------<br>
NetworkXError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;nbunch&nbsp;is&nbsp;not&nbsp;a&nbsp;node&nbsp;or&nbsp;or&nbsp;sequence&nbsp;of&nbsp;nodes.<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;a&nbsp;node&nbsp;in&nbsp;nbunch&nbsp;is&nbsp;not&nbsp;hashable.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
<a href="networkx.classes.graph.html#Graph">Graph</a>.__iter__<br>
&nbsp;<br>
Notes&nbsp;<br>
-----<br>
When&nbsp;nbunch&nbsp;is&nbsp;an&nbsp;iterator,&nbsp;the&nbsp;returned&nbsp;iterator&nbsp;yields&nbsp;values&nbsp;<br>
directly&nbsp;from&nbsp;nbunch,&nbsp;becoming&nbsp;exhausted&nbsp;when&nbsp;nbunch&nbsp;is&nbsp;exhausted.<br>
&nbsp;<br>
To&nbsp;test&nbsp;whether&nbsp;nbunch&nbsp;is&nbsp;a&nbsp;single&nbsp;node,&nbsp;one&nbsp;can&nbsp;use&nbsp;<br>
"if&nbsp;nbunch&nbsp;in&nbsp;self:",&nbsp;even&nbsp;after&nbsp;processing&nbsp;with&nbsp;this&nbsp;routine.<br>
&nbsp;<br>
If&nbsp;nbunch&nbsp;is&nbsp;not&nbsp;a&nbsp;node&nbsp;or&nbsp;a&nbsp;(possibly&nbsp;empty)&nbsp;sequence/iterator<br>
or&nbsp;None,&nbsp;a&nbsp;NetworkXError&nbsp;is&nbsp;raised.&nbsp;&nbsp;Also,&nbsp;if&nbsp;any&nbsp;object&nbsp;in<br>
nbunch&nbsp;is&nbsp;not&nbsp;hashable,&nbsp;a&nbsp;NetworkXError&nbsp;is&nbsp;raised.</tt></dd></dl>
 
<dl><dt><a name="noc-neighbors"><strong>neighbors</strong></a>(self, n)</dt><dd><tt>Return&nbsp;a&nbsp;list&nbsp;of&nbsp;the&nbsp;nodes&nbsp;connected&nbsp;to&nbsp;the&nbsp;node&nbsp;n.<br>
&nbsp;<br>
Parameters<br>
----------<br>
n&nbsp;:&nbsp;node<br>
&nbsp;&nbsp;&nbsp;A&nbsp;node&nbsp;in&nbsp;the&nbsp;graph<br>
&nbsp;<br>
Returns<br>
-------<br>
nlist&nbsp;:&nbsp;list<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;nodes&nbsp;that&nbsp;are&nbsp;adjacent&nbsp;to&nbsp;n.<br>
&nbsp;<br>
Raises<br>
------<br>
NetworkXError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;the&nbsp;node&nbsp;n&nbsp;is&nbsp;not&nbsp;in&nbsp;the&nbsp;graph.&nbsp;&nbsp;<br>
&nbsp;<br>
Notes<br>
-----<br>
It&nbsp;is&nbsp;usually&nbsp;more&nbsp;convenient&nbsp;(and&nbsp;faster)&nbsp;to&nbsp;access&nbsp;the<br>
adjacency&nbsp;dictionary&nbsp;as&nbsp;G[n]:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>('a','b',weight=7)<br>
&gt;&gt;&gt;&nbsp;G['a']<br>
{'b':&nbsp;{'weight':&nbsp;7}}<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-neighbors">neighbors</a>(0)<br>
[1]</tt></dd></dl>
 
<dl><dt><a name="noc-neighbors_iter"><strong>neighbors_iter</strong></a>(self, n)</dt><dd><tt>Return&nbsp;an&nbsp;iterator&nbsp;over&nbsp;all&nbsp;neighbors&nbsp;of&nbsp;node&nbsp;n.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;print&nbsp;[n&nbsp;for&nbsp;n&nbsp;in&nbsp;G.<a href="#noc-neighbors_iter">neighbors_iter</a>(0)]<br>
[1]<br>
&nbsp;<br>
Notes<br>
-----<br>
It&nbsp;is&nbsp;faster&nbsp;to&nbsp;use&nbsp;the&nbsp;idiom&nbsp;"in&nbsp;G[0]",&nbsp;e.g.<br>
&gt;&gt;&gt;&nbsp;for&nbsp;n&nbsp;in&nbsp;G[0]:<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;n<br>
1</tt></dd></dl>
 
<dl><dt><a name="noc-nodes"><strong>nodes</strong></a>(self, data<font color="#909090">=False</font>)</dt><dd><tt>Return&nbsp;a&nbsp;list&nbsp;of&nbsp;the&nbsp;nodes&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Parameters<br>
----------<br>
data&nbsp;:&nbsp;boolean,&nbsp;optional&nbsp;(default=False)&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;False&nbsp;return&nbsp;a&nbsp;list&nbsp;of&nbsp;nodes.&nbsp;&nbsp;If&nbsp;True&nbsp;return&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;two-tuple&nbsp;of&nbsp;node&nbsp;and&nbsp;node&nbsp;data&nbsp;dictionary<br>
&nbsp;<br>
Returns<br>
-------<br>
nlist&nbsp;:&nbsp;list<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;nodes.&nbsp;&nbsp;If&nbsp;data=True&nbsp;a&nbsp;list&nbsp;of&nbsp;two-tuples&nbsp;containing<br>
&nbsp;&nbsp;&nbsp;&nbsp;(node,&nbsp;node&nbsp;data&nbsp;dictionary).&nbsp;<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2])<br>
&gt;&gt;&gt;&nbsp;print&nbsp;G.<a href="#noc-nodes">nodes</a>()<br>
[0,&nbsp;1,&nbsp;2]<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_node">add_node</a>(1,&nbsp;time='5pm')<br>
&gt;&gt;&gt;&nbsp;print&nbsp;G.<a href="#noc-nodes">nodes</a>(data=True)<br>
[(0,&nbsp;{}),&nbsp;(1,&nbsp;{'time':&nbsp;'5pm'}),&nbsp;(2,&nbsp;{})]</tt></dd></dl>
 
<dl><dt><a name="noc-nodes_iter"><strong>nodes_iter</strong></a>(self, data<font color="#909090">=False</font>)</dt><dd><tt>Return&nbsp;an&nbsp;iterator&nbsp;over&nbsp;the&nbsp;nodes.<br>
&nbsp;<br>
Parameters<br>
----------<br>
data&nbsp;:&nbsp;boolean,&nbsp;optional&nbsp;(default=False)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;False&nbsp;the&nbsp;iterator&nbsp;returns&nbsp;nodes.&nbsp;&nbsp;If&nbsp;True<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;a&nbsp;two-tuple&nbsp;of&nbsp;node&nbsp;and&nbsp;node&nbsp;data&nbsp;dictionary<br>
&nbsp;<br>
Returns<br>
-------<br>
niter&nbsp;:&nbsp;iterator<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;iterator&nbsp;over&nbsp;nodes.&nbsp;&nbsp;If&nbsp;data=True&nbsp;the&nbsp;iterator&nbsp;gives&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;two-tuples&nbsp;containing&nbsp;(node,&nbsp;node&nbsp;data,&nbsp;dictionary)&nbsp;<br>
&nbsp;<br>
Notes<br>
-----<br>
If&nbsp;the&nbsp;node&nbsp;data&nbsp;is&nbsp;not&nbsp;required&nbsp;it&nbsp;is&nbsp;simpler&nbsp;and&nbsp;equivalent&nbsp;<br>
to&nbsp;use&nbsp;the&nbsp;expression&nbsp;'for&nbsp;n&nbsp;in&nbsp;G'.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2])<br>
&gt;&gt;&gt;&nbsp;for&nbsp;n&nbsp;in&nbsp;G:<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;n,<br>
0&nbsp;1&nbsp;2<br>
&nbsp;<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2])<br>
&gt;&gt;&gt;&nbsp;for&nbsp;n&nbsp;in&nbsp;G.<a href="#noc-nodes_iter">nodes_iter</a>():<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;n,<br>
0&nbsp;1&nbsp;2<br>
&gt;&gt;&gt;&nbsp;for&nbsp;n,d&nbsp;in&nbsp;G.<a href="#noc-nodes_iter">nodes_iter</a>(data=True):<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;d,<br>
{}&nbsp;{}&nbsp;{}</tt></dd></dl>
 
<dl><dt><a name="noc-nodes_with_selfloops"><strong>nodes_with_selfloops</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;list&nbsp;of&nbsp;nodes&nbsp;with&nbsp;self&nbsp;loops.<br>
&nbsp;<br>
A&nbsp;node&nbsp;with&nbsp;a&nbsp;self&nbsp;loop&nbsp;has&nbsp;an&nbsp;edge&nbsp;with&nbsp;both&nbsp;ends&nbsp;adjacent<br>
to&nbsp;that&nbsp;node.<br>
&nbsp;<br>
Returns<br>
-------<br>
nodelist&nbsp;:&nbsp;list<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;nodes&nbsp;with&nbsp;self&nbsp;loops.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
selfloop_edges,&nbsp;number_of_selfloops<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>(1,1)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>(1,2)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-nodes_with_selfloops">nodes_with_selfloops</a>()<br>
[1]</tt></dd></dl>
 
<dl><dt><a name="noc-number_of_edges"><strong>number_of_edges</strong></a>(self, u<font color="#909090">=None</font>, v<font color="#909090">=None</font>)</dt><dd><tt>Return&nbsp;the&nbsp;number&nbsp;of&nbsp;edges&nbsp;between&nbsp;two&nbsp;nodes.<br>
&nbsp;<br>
Parameters<br>
----------<br>
u,v&nbsp;:&nbsp;nodes,&nbsp;optional&nbsp;(default=all&nbsp;edges)<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;u&nbsp;and&nbsp;v&nbsp;are&nbsp;specified,&nbsp;return&nbsp;the&nbsp;number&nbsp;of&nbsp;edges&nbsp;between&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;u&nbsp;and&nbsp;v.&nbsp;Otherwise&nbsp;return&nbsp;the&nbsp;total&nbsp;number&nbsp;of&nbsp;all&nbsp;edges.<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
Returns<br>
-------<br>
nedges&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;number&nbsp;of&nbsp;edges&nbsp;in&nbsp;the&nbsp;graph.&nbsp;&nbsp;If&nbsp;nodes&nbsp;u&nbsp;and&nbsp;v&nbsp;are&nbsp;specified<br>
&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;the&nbsp;number&nbsp;of&nbsp;edges&nbsp;between&nbsp;those&nbsp;nodes.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
size<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-number_of_edges">number_of_edges</a>()<br>
3<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-number_of_edges">number_of_edges</a>(0,1)&nbsp;<br>
1<br>
&gt;&gt;&gt;&nbsp;e&nbsp;=&nbsp;(0,1)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-number_of_edges">number_of_edges</a>(*e)<br>
1</tt></dd></dl>
 
<dl><dt><a name="noc-number_of_nodes"><strong>number_of_nodes</strong></a>(self)</dt><dd><tt>Return&nbsp;the&nbsp;number&nbsp;of&nbsp;nodes&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Returns<br>
-------<br>
nnodes&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;number&nbsp;of&nbsp;nodes&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
order,&nbsp;__len__&nbsp;&nbsp;which&nbsp;are&nbsp;identical&nbsp;<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2])<br>
&gt;&gt;&gt;&nbsp;print&nbsp;len(G)<br>
3</tt></dd></dl>
 
<dl><dt><a name="noc-number_of_selfloops"><strong>number_of_selfloops</strong></a>(self)</dt><dd><tt>Return&nbsp;the&nbsp;number&nbsp;of&nbsp;selfloop&nbsp;edges.<br>
&nbsp;<br>
A&nbsp;selfloop&nbsp;edge&nbsp;has&nbsp;the&nbsp;same&nbsp;node&nbsp;at&nbsp;both&nbsp;ends.<br>
&nbsp;<br>
Returns<br>
-------<br>
nloops&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;number&nbsp;of&nbsp;selfloops.&nbsp;&nbsp;&nbsp;<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
selfloop_nodes,&nbsp;selfloop_edges<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G=nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>(1,1)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>(1,2)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-number_of_selfloops">number_of_selfloops</a>()<br>
1</tt></dd></dl>
 
<dl><dt><a name="noc-order"><strong>order</strong></a>(self)</dt><dd><tt>Return&nbsp;the&nbsp;number&nbsp;of&nbsp;nodes&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Returns<br>
-------<br>
nnodes&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;number&nbsp;of&nbsp;nodes&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
number_of_nodes,&nbsp;__len__&nbsp;&nbsp;which&nbsp;are&nbsp;identical</tt></dd></dl>
 
<dl><dt><a name="noc-remove_edge"><strong>remove_edge</strong></a>(self, u, v)</dt><dd><tt>Remove&nbsp;the&nbsp;edge&nbsp;between&nbsp;u&nbsp;and&nbsp;v.<br>
&nbsp;<br>
Parameters<br>
----------<br>
u,v:&nbsp;nodes&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Remove&nbsp;the&nbsp;edge&nbsp;between&nbsp;nodes&nbsp;u&nbsp;and&nbsp;v.<br>
&nbsp;<br>
Raises<br>
------<br>
NetworkXError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;there&nbsp;is&nbsp;not&nbsp;an&nbsp;edge&nbsp;between&nbsp;u&nbsp;and&nbsp;v.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
remove_edges_from&nbsp;:&nbsp;remove&nbsp;a&nbsp;collection&nbsp;of&nbsp;edges<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-remove_edge">remove_edge</a>(0,1)<br>
&gt;&gt;&gt;&nbsp;e&nbsp;=&nbsp;(1,2)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-remove_edge">remove_edge</a>(*e)&nbsp;#&nbsp;unpacks&nbsp;e&nbsp;from&nbsp;an&nbsp;edge&nbsp;tuple<br>
&gt;&gt;&gt;&nbsp;e&nbsp;=&nbsp;(2,3,{'weight':7})&nbsp;#&nbsp;an&nbsp;edge&nbsp;with&nbsp;attribute&nbsp;data<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-remove_edge">remove_edge</a>(*e[:2])&nbsp;#&nbsp;select&nbsp;first&nbsp;part&nbsp;of&nbsp;edge&nbsp;tuple</tt></dd></dl>
 
<dl><dt><a name="noc-remove_edges_from"><strong>remove_edges_from</strong></a>(self, ebunch)</dt><dd><tt>Remove&nbsp;all&nbsp;edges&nbsp;specified&nbsp;in&nbsp;ebunch.<br>
&nbsp;<br>
Parameters<br>
----------<br>
ebunch:&nbsp;list&nbsp;or&nbsp;container&nbsp;of&nbsp;edge&nbsp;tuples<br>
&nbsp;&nbsp;&nbsp;&nbsp;Each&nbsp;edge&nbsp;given&nbsp;in&nbsp;the&nbsp;list&nbsp;or&nbsp;container&nbsp;will&nbsp;be&nbsp;removed&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;the&nbsp;graph.&nbsp;The&nbsp;edges&nbsp;can&nbsp;be:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;2-tuples&nbsp;(u,v)&nbsp;edge&nbsp;between&nbsp;u&nbsp;and&nbsp;v.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;3-tuples&nbsp;(u,v,k)&nbsp;where&nbsp;k&nbsp;is&nbsp;ignored.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
remove_edge&nbsp;:&nbsp;remove&nbsp;a&nbsp;single&nbsp;edge<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
Notes<br>
-----<br>
Will&nbsp;fail&nbsp;silently&nbsp;if&nbsp;an&nbsp;edge&nbsp;in&nbsp;ebunch&nbsp;is&nbsp;not&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;ebunch=[(1,2),(2,3)]<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-remove_edges_from">remove_edges_from</a>(ebunch)</tt></dd></dl>
 
<dl><dt><a name="noc-remove_node"><strong>remove_node</strong></a>(self, n)</dt><dd><tt>Remove&nbsp;node&nbsp;n.<br>
&nbsp;<br>
Removes&nbsp;the&nbsp;node&nbsp;n&nbsp;and&nbsp;all&nbsp;adjacent&nbsp;edges.<br>
Attempting&nbsp;to&nbsp;remove&nbsp;a&nbsp;non-existent&nbsp;node&nbsp;will&nbsp;raise&nbsp;an&nbsp;exception.<br>
&nbsp;<br>
Parameters<br>
----------<br>
n&nbsp;:&nbsp;node<br>
&nbsp;&nbsp;&nbsp;A&nbsp;node&nbsp;in&nbsp;the&nbsp;graph<br>
&nbsp;<br>
Raises<br>
-------<br>
NetworkXError<br>
&nbsp;&nbsp;&nbsp;If&nbsp;n&nbsp;is&nbsp;not&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
remove_nodes_from<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-edges">edges</a>()<br>
[(0,&nbsp;1),&nbsp;(1,&nbsp;2)]<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-remove_node">remove_node</a>(1)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-edges">edges</a>()<br>
[]</tt></dd></dl>
 
<dl><dt><a name="noc-remove_nodes_from"><strong>remove_nodes_from</strong></a>(self, nodes)</dt><dd><tt>Remove&nbsp;multiple&nbsp;nodes.<br>
&nbsp;<br>
Parameters<br>
----------<br>
nodes&nbsp;:&nbsp;iterable&nbsp;container<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;container&nbsp;of&nbsp;nodes&nbsp;(list,&nbsp;<a href="__builtin__.html#dict">dict</a>,&nbsp;set,&nbsp;etc.).&nbsp;&nbsp;If&nbsp;a&nbsp;node<br>
&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;the&nbsp;container&nbsp;is&nbsp;not&nbsp;in&nbsp;the&nbsp;graph&nbsp;it&nbsp;is&nbsp;silently<br>
&nbsp;&nbsp;&nbsp;&nbsp;ignored.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
remove_node<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2])<br>
&gt;&gt;&gt;&nbsp;e&nbsp;=&nbsp;G.<a href="#noc-nodes">nodes</a>()<br>
&gt;&gt;&gt;&nbsp;e<br>
[0,&nbsp;1,&nbsp;2]<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-remove_nodes_from">remove_nodes_from</a>(e)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-nodes">nodes</a>()<br>
[]</tt></dd></dl>
 
<dl><dt><a name="noc-selfloop_edges"><strong>selfloop_edges</strong></a>(self, data<font color="#909090">=False</font>)</dt><dd><tt>Return&nbsp;a&nbsp;list&nbsp;of&nbsp;selfloop&nbsp;edges.<br>
&nbsp;<br>
A&nbsp;selfloop&nbsp;edge&nbsp;has&nbsp;the&nbsp;same&nbsp;node&nbsp;at&nbsp;both&nbsp;ends.<br>
&nbsp;<br>
Parameters<br>
-----------<br>
data&nbsp;:&nbsp;bool,&nbsp;optional&nbsp;(default=False)<br>
&nbsp;&nbsp;&nbsp;&nbsp;Return&nbsp;selfloop&nbsp;edges&nbsp;as&nbsp;two&nbsp;tuples&nbsp;(u,v)&nbsp;(data=False)<br>
&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;three-tuples&nbsp;(u,v,data)&nbsp;(data=True)<br>
&nbsp;<br>
Returns<br>
-------<br>
edgelist&nbsp;:&nbsp;list&nbsp;of&nbsp;edge&nbsp;tuples<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;all&nbsp;selfloop&nbsp;edges.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
selfloop_nodes,&nbsp;number_of_selfloops<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>(1,1)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>(1,2)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-selfloop_edges">selfloop_edges</a>()<br>
[(1,&nbsp;1)]<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-selfloop_edges">selfloop_edges</a>(data=True)<br>
[(1,&nbsp;1,&nbsp;{})]</tt></dd></dl>
 
<dl><dt><a name="noc-size"><strong>size</strong></a>(self, weighted<font color="#909090">=False</font>)</dt><dd><tt>Return&nbsp;the&nbsp;number&nbsp;of&nbsp;edges.<br>
&nbsp;<br>
Parameters<br>
----------<br>
weighted&nbsp;:&nbsp;boolean,&nbsp;optional&nbsp;(default=False)<br>
&nbsp;&nbsp;&nbsp;If&nbsp;True&nbsp;return&nbsp;the&nbsp;sum&nbsp;of&nbsp;the&nbsp;edge&nbsp;weights.<br>
&nbsp;<br>
Returns<br>
-------<br>
nedges&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;number&nbsp;of&nbsp;edges&nbsp;in&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
number_of_edges<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-size">size</a>()<br>
3<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>('a','b',weight=2)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_edge">add_edge</a>('b','c',weight=4)<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-size">size</a>()<br>
2<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-size">size</a>(weighted=True)<br>
6</tt></dd></dl>
 
<dl><dt><a name="noc-subgraph"><strong>subgraph</strong></a>(self, nbunch)</dt><dd><tt>Return&nbsp;the&nbsp;subgraph&nbsp;induced&nbsp;on&nbsp;nodes&nbsp;in&nbsp;nbunch.<br>
&nbsp;<br>
The&nbsp;induced&nbsp;subgraph&nbsp;of&nbsp;the&nbsp;graph&nbsp;contains&nbsp;the&nbsp;nodes&nbsp;in&nbsp;nbunch&nbsp;<br>
and&nbsp;the&nbsp;edges&nbsp;between&nbsp;those&nbsp;nodes.&nbsp;&nbsp;<br>
&nbsp;<br>
Parameters<br>
----------<br>
nbunch&nbsp;:&nbsp;list,&nbsp;iterable<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;container&nbsp;of&nbsp;nodes&nbsp;which&nbsp;will&nbsp;be&nbsp;iterated&nbsp;through&nbsp;once.&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;<br>
Returns<br>
-------<br>
G&nbsp;:&nbsp;<a href="networkx.classes.graph.html#Graph">Graph</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;subgraph&nbsp;of&nbsp;the&nbsp;graph&nbsp;with&nbsp;the&nbsp;same&nbsp;edge&nbsp;attributes.&nbsp;&nbsp;<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;graph,&nbsp;edge&nbsp;or&nbsp;node&nbsp;attributes&nbsp;just&nbsp;point&nbsp;to&nbsp;the&nbsp;original&nbsp;graph.<br>
So&nbsp;changes&nbsp;to&nbsp;the&nbsp;node&nbsp;or&nbsp;edge&nbsp;structure&nbsp;will&nbsp;not&nbsp;be&nbsp;reflected&nbsp;in<br>
the&nbsp;original&nbsp;graph&nbsp;while&nbsp;changes&nbsp;to&nbsp;the&nbsp;attributes&nbsp;will.<br>
&nbsp;<br>
To&nbsp;create&nbsp;a&nbsp;subgraph&nbsp;with&nbsp;its&nbsp;own&nbsp;copy&nbsp;of&nbsp;the&nbsp;edge/node&nbsp;attributes&nbsp;use:<br>
nx.<a href="networkx.classes.graph.html#Graph">Graph</a>(G.<a href="#noc-subgraph">subgraph</a>(nbunch))<br>
&nbsp;<br>
If&nbsp;edge&nbsp;attributes&nbsp;are&nbsp;containers,&nbsp;a&nbsp;deep&nbsp;copy&nbsp;can&nbsp;be&nbsp;obtained&nbsp;using:<br>
G.<a href="#noc-subgraph">subgraph</a>(nbunch).<a href="#noc-copy">copy</a>()<br>
&nbsp;<br>
For&nbsp;an&nbsp;in-place&nbsp;reduction&nbsp;of&nbsp;a&nbsp;graph&nbsp;to&nbsp;a&nbsp;subgraph&nbsp;you&nbsp;can&nbsp;remove&nbsp;nodes:<br>
G.<a href="#noc-remove_nodes_from">remove_nodes_from</a>([&nbsp;n&nbsp;in&nbsp;G&nbsp;if&nbsp;n&nbsp;not&nbsp;in&nbsp;set(nbunch)])&nbsp;&nbsp;<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;DiGraph,&nbsp;MultiGraph,&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1,2,3])<br>
&gt;&gt;&gt;&nbsp;H&nbsp;=&nbsp;G.<a href="#noc-subgraph">subgraph</a>([0,1,2])<br>
&gt;&gt;&gt;&nbsp;print&nbsp;H.<a href="#noc-edges">edges</a>()<br>
[(0,&nbsp;1),&nbsp;(1,&nbsp;2)]</tt></dd></dl>
 
<dl><dt><a name="noc-to_directed"><strong>to_directed</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;directed&nbsp;representation&nbsp;of&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
Returns<br>
-------<br>
G&nbsp;:&nbsp;DiGraph<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;directed&nbsp;graph&nbsp;with&nbsp;the&nbsp;same&nbsp;name,&nbsp;same&nbsp;nodes,&nbsp;and&nbsp;with<br>
&nbsp;&nbsp;&nbsp;&nbsp;each&nbsp;edge&nbsp;(u,v,data)&nbsp;replaced&nbsp;by&nbsp;two&nbsp;directed&nbsp;edges<br>
&nbsp;&nbsp;&nbsp;&nbsp;(u,v,data)&nbsp;and&nbsp;(v,u,data).<br>
&nbsp;<br>
Notes<br>
-----<br>
This&nbsp;returns&nbsp;a&nbsp;"deepcopy"&nbsp;of&nbsp;the&nbsp;edge,&nbsp;node,&nbsp;and&nbsp;<br>
graph&nbsp;attributes&nbsp;which&nbsp;attempts&nbsp;to&nbsp;completely&nbsp;copy<br>
all&nbsp;of&nbsp;the&nbsp;data&nbsp;and&nbsp;references.<br>
&nbsp;<br>
This&nbsp;is&nbsp;in&nbsp;contrast&nbsp;to&nbsp;the&nbsp;similar&nbsp;D=DiGraph(G)&nbsp;which&nbsp;returns&nbsp;a&nbsp;<br>
shallow&nbsp;copy&nbsp;of&nbsp;the&nbsp;data.&nbsp;<br>
&nbsp;<br>
See&nbsp;the&nbsp;Python&nbsp;copy&nbsp;module&nbsp;for&nbsp;more&nbsp;information&nbsp;on&nbsp;shallow<br>
and&nbsp;deep&nbsp;copies,&nbsp;<a href="http://docs.python.org/library/copy.html">http://docs.python.org/library/copy.html</a>.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;MultiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1])<br>
&gt;&gt;&gt;&nbsp;H&nbsp;=&nbsp;G.<a href="#noc-to_directed">to_directed</a>()<br>
&gt;&gt;&gt;&nbsp;H.<a href="#noc-edges">edges</a>()<br>
[(0,&nbsp;1),&nbsp;(1,&nbsp;0)]<br>
&nbsp;<br>
If&nbsp;already&nbsp;directed,&nbsp;return&nbsp;a&nbsp;(deep)&nbsp;copy<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.DiGraph()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;MultiDiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1])<br>
&gt;&gt;&gt;&nbsp;H&nbsp;=&nbsp;G.<a href="#noc-to_directed">to_directed</a>()<br>
&gt;&gt;&gt;&nbsp;H.<a href="#noc-edges">edges</a>()<br>
[(0,&nbsp;1)]</tt></dd></dl>
 
<dl><dt><a name="noc-to_undirected"><strong>to_undirected</strong></a>(self)</dt><dd><tt>Return&nbsp;an&nbsp;undirected&nbsp;copy&nbsp;of&nbsp;the&nbsp;graph.&nbsp;<br>
&nbsp;<br>
Returns<br>
-------<br>
G&nbsp;:&nbsp;<a href="networkx.classes.graph.html#Graph">Graph</a>/MultiGraph<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;deepcopy&nbsp;of&nbsp;the&nbsp;graph.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
copy,&nbsp;add_edge,&nbsp;add_edges_from<br>
&nbsp;<br>
Notes<br>
-----<br>
This&nbsp;returns&nbsp;a&nbsp;"deepcopy"&nbsp;of&nbsp;the&nbsp;edge,&nbsp;node,&nbsp;and&nbsp;<br>
graph&nbsp;attributes&nbsp;which&nbsp;attempts&nbsp;to&nbsp;completely&nbsp;copy<br>
all&nbsp;of&nbsp;the&nbsp;data&nbsp;and&nbsp;references.<br>
&nbsp;<br>
This&nbsp;is&nbsp;in&nbsp;contrast&nbsp;to&nbsp;the&nbsp;similar&nbsp;G=DiGraph(D)&nbsp;which&nbsp;returns&nbsp;a&nbsp;<br>
shallow&nbsp;copy&nbsp;of&nbsp;the&nbsp;data.&nbsp;<br>
&nbsp;<br>
See&nbsp;the&nbsp;Python&nbsp;copy&nbsp;module&nbsp;for&nbsp;more&nbsp;information&nbsp;on&nbsp;shallow<br>
and&nbsp;deep&nbsp;copies,&nbsp;<a href="http://docs.python.org/library/copy.html">http://docs.python.org/library/copy.html</a>.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;G&nbsp;=&nbsp;nx.<a href="networkx.classes.graph.html#Graph">Graph</a>()&nbsp;&nbsp;&nbsp;#&nbsp;or&nbsp;MultiGraph,&nbsp;etc<br>
&gt;&gt;&gt;&nbsp;G.<a href="#noc-add_path">add_path</a>([0,1])<br>
&gt;&gt;&gt;&nbsp;H&nbsp;=&nbsp;G.<a href="#noc-to_directed">to_directed</a>()<br>
&gt;&gt;&gt;&nbsp;H.<a href="#noc-edges">edges</a>()<br>
[(0,&nbsp;1),&nbsp;(1,&nbsp;0)]<br>
&gt;&gt;&gt;&nbsp;G2&nbsp;=&nbsp;H.<a href="#noc-to_undirected">to_undirected</a>()<br>
&gt;&gt;&gt;&nbsp;G2.<a href="#noc-edges">edges</a>()<br>
[(0,&nbsp;1)]</tt></dd></dl>
 
<hr>
Data descriptors inherited from <a href="networkx.classes.graph.html#Graph">networkx.classes.graph.Graph</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="nocobject">class <strong>nocobject</strong></a></font></td></tr>
 
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>NoC&nbsp;base&nbsp;object<br>
&nbsp;<br>
This&nbsp;base&nbsp;class&nbsp;is&nbsp;used&nbsp;to&nbsp;implement&nbsp;common&nbsp;methods&nbsp;for&nbsp;NoC&nbsp;objects.<br>
Don't&nbsp;use&nbsp;directly.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="nocobject-get_protocol_ref"><strong>get_protocol_ref</strong></a>(self)</dt><dd><tt>Get&nbsp;<a href="#protocol">protocol</a>&nbsp;object&nbsp;for&nbsp;this&nbsp;instance</tt></dd></dl>
 
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="packet">class <strong>packet</strong></a>(<a href="__builtin__.html#dict">__builtin__.dict</a>)</font></td></tr>
 
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Packet&nbsp;base&nbsp;object<br>
&nbsp;<br>
This&nbsp;object&nbsp;represents&nbsp;a&nbsp;<a href="#packet">packet</a>&nbsp;data,&nbsp;related&nbsp;to&nbsp;a&nbsp;<a href="#protocol">protocol</a>&nbsp;object.&nbsp;It&nbsp;<br>
behaves&nbsp;exactly&nbsp;like&nbsp;a&nbsp;Python&nbsp;dictionary,&nbsp;but&nbsp;adds&nbsp;methods&nbsp;to&nbsp;simplify&nbsp;<br>
<a href="#packet">packet</a>&nbsp;transformations.&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;<br>
Relations&nbsp;with&nbsp;other&nbsp;objects:<br>
*&nbsp;It&nbsp;should&nbsp;be&nbsp;generated&nbsp;by&nbsp;a&nbsp;<a href="#protocol">protocol</a>&nbsp;object&nbsp;(and&nbsp;will&nbsp;have&nbsp;a&nbsp;reference&nbsp;<br>
&nbsp;&nbsp;in&nbsp;self.<strong>protocol_ref</strong>)<br>
&nbsp;<br>
Attributes:<br>
*&nbsp;protocol_ref:&nbsp;<a href="#protocol">protocol</a>&nbsp;object&nbsp;that&nbsp;created&nbsp;this&nbsp;object.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="nocmodel.noc_base.html#packet">packet</a></dd>
<dd><a href="__builtin__.html#dict">__builtin__.dict</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="packet-__init__"><strong>__init__</strong></a>(self, *args, **kwargs)</dt><dd><tt>#&nbsp;the&nbsp;constructor</tt></dd></dl>
 
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Methods inherited from <a href="__builtin__.html#dict">__builtin__.dict</a>:<br>
<dl><dt><a name="packet-__cmp__"><strong>__cmp__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__cmp__">__cmp__</a>(y)&nbsp;&lt;==&gt;&nbsp;cmp(x,y)</tt></dd></dl>
 
<dl><dt><a name="packet-__contains__"><strong>__contains__</strong></a>(...)</dt><dd><tt>D.<a href="#packet-__contains__">__contains__</a>(k)&nbsp;-&gt;&nbsp;True&nbsp;if&nbsp;D&nbsp;has&nbsp;a&nbsp;key&nbsp;k,&nbsp;else&nbsp;False</tt></dd></dl>
 
<dl><dt><a name="packet-__delitem__"><strong>__delitem__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__delitem__">__delitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;del&nbsp;x[y]</tt></dd></dl>
 
<dl><dt><a name="packet-__eq__"><strong>__eq__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__eq__">__eq__</a>(y)&nbsp;&lt;==&gt;&nbsp;x==y</tt></dd></dl>
 
<dl><dt><a name="packet-__ge__"><strong>__ge__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__ge__">__ge__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&gt;=y</tt></dd></dl>
 
<dl><dt><a name="packet-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>
 
<dl><dt><a name="packet-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>
 
<dl><dt><a name="packet-__gt__"><strong>__gt__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__gt__">__gt__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&gt;y</tt></dd></dl>
 
<dl><dt><a name="packet-__iter__"><strong>__iter__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__iter__">__iter__</a>()&nbsp;&lt;==&gt;&nbsp;iter(x)</tt></dd></dl>
 
<dl><dt><a name="packet-__le__"><strong>__le__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__le__">__le__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&lt;=y</tt></dd></dl>
 
<dl><dt><a name="packet-__len__"><strong>__len__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__len__">__len__</a>()&nbsp;&lt;==&gt;&nbsp;len(x)</tt></dd></dl>
 
<dl><dt><a name="packet-__lt__"><strong>__lt__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__lt__">__lt__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&lt;y</tt></dd></dl>
 
<dl><dt><a name="packet-__ne__"><strong>__ne__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__ne__">__ne__</a>(y)&nbsp;&lt;==&gt;&nbsp;x!=y</tt></dd></dl>
 
<dl><dt><a name="packet-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>
 
<dl><dt><a name="packet-__setitem__"><strong>__setitem__</strong></a>(...)</dt><dd><tt>x.<a href="#packet-__setitem__">__setitem__</a>(i,&nbsp;y)&nbsp;&lt;==&gt;&nbsp;x[i]=y</tt></dd></dl>
 
<dl><dt><a name="packet-__sizeof__"><strong>__sizeof__</strong></a>(...)</dt><dd><tt>D.<a href="#packet-__sizeof__">__sizeof__</a>()&nbsp;-&gt;&nbsp;size&nbsp;of&nbsp;D&nbsp;in&nbsp;memory,&nbsp;in&nbsp;bytes</tt></dd></dl>
 
<dl><dt><a name="packet-clear"><strong>clear</strong></a>(...)</dt><dd><tt>D.<a href="#packet-clear">clear</a>()&nbsp;-&gt;&nbsp;None.&nbsp;&nbsp;Remove&nbsp;all&nbsp;items&nbsp;from&nbsp;D.</tt></dd></dl>
 
<dl><dt><a name="packet-copy"><strong>copy</strong></a>(...)</dt><dd><tt>D.<a href="#packet-copy">copy</a>()&nbsp;-&gt;&nbsp;a&nbsp;shallow&nbsp;copy&nbsp;of&nbsp;D</tt></dd></dl>
 
<dl><dt><a name="packet-get"><strong>get</strong></a>(...)</dt><dd><tt>D.<a href="#packet-get">get</a>(k[,d])&nbsp;-&gt;&nbsp;D[k]&nbsp;if&nbsp;k&nbsp;in&nbsp;D,&nbsp;else&nbsp;d.&nbsp;&nbsp;d&nbsp;defaults&nbsp;to&nbsp;None.</tt></dd></dl>
 
<dl><dt><a name="packet-has_key"><strong>has_key</strong></a>(...)</dt><dd><tt>D.<a href="#packet-has_key">has_key</a>(k)&nbsp;-&gt;&nbsp;True&nbsp;if&nbsp;D&nbsp;has&nbsp;a&nbsp;key&nbsp;k,&nbsp;else&nbsp;False</tt></dd></dl>
 
<dl><dt><a name="packet-items"><strong>items</strong></a>(...)</dt><dd><tt>D.<a href="#packet-items">items</a>()&nbsp;-&gt;&nbsp;list&nbsp;of&nbsp;D's&nbsp;(key,&nbsp;value)&nbsp;pairs,&nbsp;as&nbsp;2-tuples</tt></dd></dl>
 
<dl><dt><a name="packet-iteritems"><strong>iteritems</strong></a>(...)</dt><dd><tt>D.<a href="#packet-iteritems">iteritems</a>()&nbsp;-&gt;&nbsp;an&nbsp;iterator&nbsp;over&nbsp;the&nbsp;(key,&nbsp;value)&nbsp;items&nbsp;of&nbsp;D</tt></dd></dl>
 
<dl><dt><a name="packet-iterkeys"><strong>iterkeys</strong></a>(...)</dt><dd><tt>D.<a href="#packet-iterkeys">iterkeys</a>()&nbsp;-&gt;&nbsp;an&nbsp;iterator&nbsp;over&nbsp;the&nbsp;keys&nbsp;of&nbsp;D</tt></dd></dl>
 
<dl><dt><a name="packet-itervalues"><strong>itervalues</strong></a>(...)</dt><dd><tt>D.<a href="#packet-itervalues">itervalues</a>()&nbsp;-&gt;&nbsp;an&nbsp;iterator&nbsp;over&nbsp;the&nbsp;values&nbsp;of&nbsp;D</tt></dd></dl>
 
<dl><dt><a name="packet-keys"><strong>keys</strong></a>(...)</dt><dd><tt>D.<a href="#packet-keys">keys</a>()&nbsp;-&gt;&nbsp;list&nbsp;of&nbsp;D's&nbsp;keys</tt></dd></dl>
 
<dl><dt><a name="packet-pop"><strong>pop</strong></a>(...)</dt><dd><tt>D.<a href="#packet-pop">pop</a>(k[,d])&nbsp;-&gt;&nbsp;v,&nbsp;remove&nbsp;specified&nbsp;key&nbsp;and&nbsp;return&nbsp;the&nbsp;corresponding&nbsp;value.<br>
If&nbsp;key&nbsp;is&nbsp;not&nbsp;found,&nbsp;d&nbsp;is&nbsp;returned&nbsp;if&nbsp;given,&nbsp;otherwise&nbsp;KeyError&nbsp;is&nbsp;raised</tt></dd></dl>
 
<dl><dt><a name="packet-popitem"><strong>popitem</strong></a>(...)</dt><dd><tt>D.<a href="#packet-popitem">popitem</a>()&nbsp;-&gt;&nbsp;(k,&nbsp;v),&nbsp;remove&nbsp;and&nbsp;return&nbsp;some&nbsp;(key,&nbsp;value)&nbsp;pair&nbsp;as&nbsp;a<br>
2-tuple;&nbsp;but&nbsp;raise&nbsp;KeyError&nbsp;if&nbsp;D&nbsp;is&nbsp;empty.</tt></dd></dl>
 
<dl><dt><a name="packet-setdefault"><strong>setdefault</strong></a>(...)</dt><dd><tt>D.<a href="#packet-setdefault">setdefault</a>(k[,d])&nbsp;-&gt;&nbsp;D.<a href="#packet-get">get</a>(k,d),&nbsp;also&nbsp;set&nbsp;D[k]=d&nbsp;if&nbsp;k&nbsp;not&nbsp;in&nbsp;D</tt></dd></dl>
 
<dl><dt><a name="packet-update"><strong>update</strong></a>(...)</dt><dd><tt>D.<a href="#packet-update">update</a>(E,&nbsp;**F)&nbsp;-&gt;&nbsp;None.&nbsp;&nbsp;Update&nbsp;D&nbsp;from&nbsp;<a href="__builtin__.html#dict">dict</a>/iterable&nbsp;E&nbsp;and&nbsp;F.<br>
If&nbsp;E&nbsp;has&nbsp;a&nbsp;.<a href="#packet-keys">keys</a>()&nbsp;method,&nbsp;does:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;k&nbsp;in&nbsp;E:&nbsp;D[k]&nbsp;=&nbsp;E[k]<br>
If&nbsp;E&nbsp;lacks&nbsp;.<a href="#packet-keys">keys</a>()&nbsp;method,&nbsp;does:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(k,&nbsp;v)&nbsp;in&nbsp;E:&nbsp;D[k]&nbsp;=&nbsp;v<br>
In&nbsp;either&nbsp;case,&nbsp;this&nbsp;is&nbsp;followed&nbsp;by:&nbsp;for&nbsp;k&nbsp;in&nbsp;F:&nbsp;D[k]&nbsp;=&nbsp;F[k]</tt></dd></dl>
 
<dl><dt><a name="packet-values"><strong>values</strong></a>(...)</dt><dd><tt>D.<a href="#packet-values">values</a>()&nbsp;-&gt;&nbsp;list&nbsp;of&nbsp;D's&nbsp;values</tt></dd></dl>
 
<hr>
Data and other attributes inherited from <a href="__builtin__.html#dict">__builtin__.dict</a>:<br>
<dl><dt><strong>__hash__</strong> = None</dl>
 
<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#packet-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;object&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>
 
<dl><dt><strong>fromkeys</strong> = &lt;built-in method fromkeys of type object&gt;<dd><tt><a href="__builtin__.html#dict">dict</a>.<a href="#packet-fromkeys">fromkeys</a>(S[,v])&nbsp;-&gt;&nbsp;New&nbsp;<a href="__builtin__.html#dict">dict</a>&nbsp;with&nbsp;keys&nbsp;from&nbsp;S&nbsp;and&nbsp;values&nbsp;equal&nbsp;to&nbsp;v.<br>
v&nbsp;defaults&nbsp;to&nbsp;None.</tt></dl>
 
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="protocol">class <strong>protocol</strong></a>(<a href="nocmodel.noc_base.html#nocobject">nocobject</a>)</font></td></tr>
 
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Protocol&nbsp;base&nbsp;object<br>
&nbsp;<br>
This&nbsp;object&nbsp;represents&nbsp;the&nbsp;<a href="#protocol">protocol</a>&nbsp;that&nbsp;the&nbsp;NoC&nbsp;objects&nbsp;use.&nbsp;This&nbsp;<br>
object&nbsp;has&nbsp;attributes&nbsp;that&nbsp;define&nbsp;the&nbsp;<a href="#protocol">protocol</a>&nbsp;used,&nbsp;mainly&nbsp;it&nbsp;can&nbsp;be<br>
used&nbsp;to&nbsp;generate,&nbsp;encode,&nbsp;decode&nbsp;or&nbsp;interpret&nbsp;packets&nbsp;on&nbsp;the&nbsp;NoC.<br>
This&nbsp;base&nbsp;class&nbsp;can&nbsp;be&nbsp;either&nbsp;be&nbsp;inherited&nbsp;or&nbsp;extended&nbsp;by&nbsp;adding&nbsp;<br>
other&nbsp;attributes.<br>
&nbsp;<br>
Relations&nbsp;with&nbsp;other&nbsp;objects:<br>
*&nbsp;Each&nbsp;object&nbsp;on&nbsp;the&nbsp;NoC&nbsp;(routers,&nbsp;channels&nbsp;and&nbsp;ipcores)&nbsp;may&nbsp;have<br>
&nbsp;&nbsp;one&nbsp;reference&nbsp;to&nbsp;a&nbsp;<a href="#protocol">protocol</a>&nbsp;object&nbsp;(object.protocol_ref)<br>
*&nbsp;A&nbsp;NoC&nbsp;model&nbsp;may&nbsp;have&nbsp;a&nbsp;<a href="#protocol">protocol</a>&nbsp;object:&nbsp;in&nbsp;this&nbsp;case,&nbsp;all&nbsp;objects&nbsp;in<br>
&nbsp;&nbsp;the&nbsp;model&nbsp;will&nbsp;use&nbsp;this&nbsp;<a href="#protocol">protocol</a>&nbsp;(nocmodel.protocol_ref)<br>
*&nbsp;A&nbsp;<a href="#protocol">protocol</a>&nbsp;object&nbsp;is&nbsp;a&nbsp;generator&nbsp;of&nbsp;<a href="#packet">packet</a>&nbsp;objects<br>
&nbsp;<br>
Attributes:<br>
*&nbsp;name<br>
&nbsp;<br>
Notes:&nbsp;<br>
*&nbsp;Optional&nbsp;arguments&nbsp;"packet_format"&nbsp;and&nbsp;"packet_order"&nbsp;can&nbsp;be<br>
&nbsp;&nbsp;added&nbsp;at&nbsp;object&nbsp;construction,&nbsp;but&nbsp;will&nbsp;not&nbsp;check&nbsp;its&nbsp;data&nbsp;consistency.&nbsp;<br>
&nbsp;&nbsp;At&nbsp;the&nbsp;moment,&nbsp;we&nbsp;recommend&nbsp;using&nbsp;<a href="#protocol-update_packet_field">update_packet_field</a>()&nbsp;method&nbsp;to<br>
&nbsp;&nbsp;fill&nbsp;this&nbsp;data&nbsp;structures.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="protocol-__init__"><strong>__init__</strong></a>(self, name<font color="#909090">=''</font>, **kwargs)</dt><dd><tt>Constructor<br>
&nbsp;<br>
Notes:<br>
*&nbsp;Optional&nbsp;arguments&nbsp;will&nbsp;be&nbsp;added&nbsp;as&nbsp;object&nbsp;attributes.</tt></dd></dl>
 
<dl><dt><a name="protocol-get_protocol_ref"><strong>get_protocol_ref</strong></a>(self)</dt></dl>
 
<dl><dt><a name="protocol-newpacket"><strong>newpacket</strong></a>(self, zerodefault<font color="#909090">=True</font>, *args, **kwargs)</dt><dd><tt>Return&nbsp;a&nbsp;new&nbsp;<a href="#packet">packet</a>&nbsp;with&nbsp;all&nbsp;required&nbsp;fields.<br>
&nbsp;<br>
Arguments:<br>
*&nbsp;zerodefault:&nbsp;If&nbsp;True,&nbsp;all&nbsp;missing&nbsp;fields&nbsp;will&nbsp;be&nbsp;zeroed&nbsp;by&nbsp;default.<br>
&nbsp;&nbsp;If&nbsp;False,&nbsp;a&nbsp;missing&nbsp;value&nbsp;in&nbsp;arguments&nbsp;will&nbsp;throw&nbsp;an&nbsp;exception.<br>
*&nbsp;args:&nbsp;Nameless&nbsp;arguments&nbsp;will&nbsp;add&nbsp;field&nbsp;values&nbsp;based&nbsp;on&nbsp;<a href="#packet">packet</a>&nbsp;field<br>
&nbsp;&nbsp;order.<br>
*&nbsp;kwargs:&nbsp;Key-based&nbsp;arguments&nbsp;will&nbsp;add&nbsp;specified&nbsp;field&nbsp;values&nbsp;based&nbsp;in&nbsp;<br>
&nbsp;&nbsp;its&nbsp;keys<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
Notes:&nbsp;<br>
*&nbsp;kwargs&nbsp;takes&nbsp;precedence&nbsp;over&nbsp;args:&nbsp;i.e.&nbsp;named&nbsp;arguments&nbsp;can&nbsp;overwrite<br>
&nbsp;&nbsp;nameless&nbsp;arguments.</tt></dd></dl>
 
<dl><dt><a name="protocol-register_packet_generator"><strong>register_packet_generator</strong></a>(self, packet_class)</dt><dd><tt>Register&nbsp;a&nbsp;special&nbsp;<a href="#packet">packet</a>&nbsp;generator&nbsp;class.<br>
&nbsp;<br>
Must&nbsp;be&nbsp;a&nbsp;derived&nbsp;class&nbsp;of&nbsp;<a href="#packet">packet</a></tt></dd></dl>
 
<dl><dt><a name="protocol-update_packet_field"><strong>update_packet_field</strong></a>(self, name, type, bitlen, description<font color="#909090">=''</font>)</dt><dd><tt>Add&nbsp;or&nbsp;update&nbsp;a&nbsp;<a href="#packet">packet</a>&nbsp;field.<br>
&nbsp;<br>
Arguments<br>
*&nbsp;name<br>
*&nbsp;type:&nbsp;string&nbsp;that&nbsp;can&nbsp;be&nbsp;"int",&nbsp;"fixed"&nbsp;or&nbsp;"float"<br>
*&nbsp;bitlen:&nbsp;bit&nbsp;length&nbsp;of&nbsp;this&nbsp;field<br>
*&nbsp;description:&nbsp;optional&nbsp;description&nbsp;of&nbsp;this&nbsp;field<br>
&nbsp;<br>
Notes:&nbsp;<br>
*&nbsp;Each&nbsp;new&nbsp;field&nbsp;will&nbsp;be&nbsp;added&nbsp;at&nbsp;the&nbsp;end.</tt></dd></dl>
 
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="router">class <strong>router</strong></a>(<a href="nocmodel.noc_base.html#nocobject">nocobject</a>)</font></td></tr>
 
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Router&nbsp;base&nbsp;object<br>
&nbsp;<br>
This&nbsp;object&nbsp;represents&nbsp;a&nbsp;<a href="#router">router</a>&nbsp;object&nbsp;and&nbsp;its&nbsp;properties.&nbsp;This&nbsp;base&nbsp;class<br>
is&nbsp;meant&nbsp;to&nbsp;either&nbsp;be&nbsp;inherited&nbsp;or&nbsp;extended&nbsp;by&nbsp;adding&nbsp;other&nbsp;attributes.<br>
&nbsp;<br>
Relations&nbsp;with&nbsp;other&nbsp;objects:<br>
*&nbsp;It&nbsp;should&nbsp;be&nbsp;related&nbsp;to&nbsp;one&nbsp;NoC&nbsp;model&nbsp;object&nbsp;(self.<strong>graph_ref</strong>)<br>
*&nbsp;It&nbsp;should&nbsp;be&nbsp;one&nbsp;of&nbsp;the&nbsp;node&nbsp;attributes&nbsp;in&nbsp;the&nbsp;graph&nbsp;model&nbsp;<br>
&nbsp;&nbsp;(node["router_ref"])<br>
*&nbsp;It&nbsp;may&nbsp;have&nbsp;one&nbsp;reference&nbsp;to&nbsp;an&nbsp;<a href="#ipcore">ipcore</a>&nbsp;object&nbsp;(self.<strong>ipcore_ref</strong>)<br>
*&nbsp;It&nbsp;has&nbsp;a&nbsp;port&nbsp;list&nbsp;with&nbsp;relations&nbsp;to&nbsp;other&nbsp;routers&nbsp;through&nbsp;<a href="#channel">channel</a>&nbsp;objects,<br>
&nbsp;&nbsp;and&nbsp;only&nbsp;one&nbsp;relation&nbsp;to&nbsp;its&nbsp;<a href="#ipcore">ipcore</a>&nbsp;object&nbsp;through&nbsp;one&nbsp;<a href="#channel">channel</a>.<br>
&nbsp;&nbsp;(self.<strong>ports</strong>).&nbsp;Note&nbsp;that&nbsp;this&nbsp;attribute&nbsp;must&nbsp;be&nbsp;updated&nbsp;after&nbsp;changing&nbsp;<br>
&nbsp;&nbsp;the&nbsp;NoC&nbsp;model.<br>
&nbsp;<br>
Attributes:<br>
*&nbsp;index:&nbsp;index&nbsp;on&nbsp;a&nbsp;<a href="#noc">noc</a>&nbsp;object.&nbsp;Essential&nbsp;to&nbsp;search&nbsp;for&nbsp;a&nbsp;<a href="#router">router</a>&nbsp;object<br>
*&nbsp;name<br>
*&nbsp;ipcore_ref:&nbsp;optional&nbsp;reference&nbsp;to&nbsp;its&nbsp;related&nbsp;<a href="#ipcore">ipcore</a><br>
*&nbsp;graph_ref:&nbsp;optional&nbsp;reference&nbsp;to&nbsp;its&nbsp;graph&nbsp;model<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="router-__init__"><strong>__init__</strong></a>(self, index, name, **kwargs)</dt></dl>
 
<dl><dt><a name="router-update_ports_info"><strong>update_ports_info</strong></a>(self)</dt><dd><tt>Update&nbsp;the&nbsp;dictionary&nbsp;"ports":&nbsp;information&nbsp;about&nbsp;<a href="#router">router</a>&nbsp;neighbors,<br>
the&nbsp;channels&nbsp;that&nbsp;connect&nbsp;them&nbsp;and&nbsp;its&nbsp;references.<br>
&nbsp;<br>
Ports&nbsp;dictionary&nbsp;has&nbsp;the&nbsp;following&nbsp;structure:<br>
*&nbsp;key:&nbsp;address&nbsp;of&nbsp;the&nbsp;neighbor&nbsp;<a href="#router">router</a>&nbsp;that&nbsp;this&nbsp;port&nbsp;connects.<br>
*&nbsp;value:&nbsp;dictionary&nbsp;with&nbsp;the&nbsp;following&nbsp;keys:<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;"peer"&nbsp;(required):&nbsp;reference&nbsp;to&nbsp;the&nbsp;neighbor&nbsp;<a href="#router">router</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;"<a href="#channel">channel</a>"&nbsp;(required):&nbsp;reference&nbsp;to&nbsp;the&nbsp;<a href="#channel">channel</a>&nbsp;that&nbsp;connects&nbsp;this&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#router">router</a>&nbsp;and&nbsp;its&nbsp;neighbor&nbsp;<a href="#router">router</a>.<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Optional&nbsp;keys&nbsp;can&nbsp;be&nbsp;added&nbsp;to&nbsp;this&nbsp;dictionary.<br>
*&nbsp;Also,&nbsp;the&nbsp;special&nbsp;key&nbsp;"local&nbsp;address"&nbsp;holds&nbsp;the&nbsp;port&nbsp;to&nbsp;<br>
&nbsp;&nbsp;<a href="#router">router</a>'s&nbsp;<a href="#ipcore">ipcore</a>.&nbsp;Its&nbsp;values&nbsp;are:<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;"peer"&nbsp;(required):&nbsp;reference&nbsp;to&nbsp;its&nbsp;<a href="#ipcore">ipcore</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;"<a href="#channel">channel</a>"&nbsp;(required):&nbsp;reference&nbsp;to&nbsp;the&nbsp;<a href="#channel">channel</a>&nbsp;that&nbsp;connects&nbsp;this&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#router">router</a>&nbsp;and&nbsp;its&nbsp;<a href="#ipcore">ipcore</a>.<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Optional&nbsp;keys&nbsp;can&nbsp;be&nbsp;added&nbsp;to&nbsp;this&nbsp;dictionary&nbsp;with&nbsp;the&nbsp;same&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;meaning&nbsp;as&nbsp;other&nbsp;ports.</tt></dd></dl>
 
<dl><dt><a name="router-update_routes_info"><strong>update_routes_info</strong></a>(self)</dt><dd><tt>Update&nbsp;the&nbsp;dictionary&nbsp;"routes_info":&nbsp;it&nbsp;is&nbsp;a&nbsp;table&nbsp;with&nbsp;information&nbsp;<br>
about&nbsp;how&nbsp;a&nbsp;package,&nbsp;starting&nbsp;from&nbsp;this&nbsp;<a href="#router">router</a>,&nbsp;can&nbsp;reach&nbsp;another&nbsp;one.<br>
&nbsp;<br>
routes_info&nbsp;dictionary&nbsp;has&nbsp;the&nbsp;following&nbsp;structure:<br>
*&nbsp;keys&nbsp;:&nbsp;the&nbsp;address&nbsp;of&nbsp;all&nbsp;the&nbsp;routers&nbsp;in&nbsp;NoC<br>
*&nbsp;values&nbsp;:&nbsp;an&nbsp;ordered&nbsp;list&nbsp;of&nbsp;dictionaries&nbsp;with&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;"next"&nbsp;:&nbsp;address&nbsp;of&nbsp;the&nbsp;next&nbsp;<a href="#router">router</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;"paths"&nbsp;:&nbsp;list&nbsp;of&nbsp;possible&nbsp;paths&nbsp;for&nbsp;key&nbsp;destination</tt></dd></dl>
 
<hr>
Methods inherited from <a href="nocmodel.noc_base.html#nocobject">nocobject</a>:<br>
<dl><dt><a name="router-get_protocol_ref"><strong>get_protocol_ref</strong></a>(self)</dt><dd><tt>Get&nbsp;<a href="#protocol">protocol</a>&nbsp;object&nbsp;for&nbsp;this&nbsp;instance</tt></dd></dl>
 
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
 
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-all_shortest_paths"><strong>all_shortest_paths</strong></a>(G, a, b)</dt><dd><tt>Return&nbsp;a&nbsp;list&nbsp;of&nbsp;all&nbsp;shortest&nbsp;paths&nbsp;in&nbsp;graph&nbsp;G&nbsp;between&nbsp;nodes&nbsp;a&nbsp;and&nbsp;b<br>
This&nbsp;is&nbsp;a&nbsp;function&nbsp;not&nbsp;available&nbsp;in&nbsp;NetworkX&nbsp;(checked&nbsp;at&nbsp;22-02-2011)<br>
&nbsp;<br>
Taken&nbsp;from:&nbsp;<br>
<a href="http://groups.google.com/group/networkx-discuss/browse_thread/thread/55465e6bb9bae12e">http://groups.google.com/group/networkx-discuss/browse_thread/thread/55465e6bb9bae12e</a></tt></dd></dl>
</td></tr></table>
</body></html>

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.