Mininet Python API Reference Manual
Public Member Functions | Public Attributes | List of all members
mininet.topo.MultiGraph Class Reference

Utility class to track nodes and edges - replaces networkx.MultiGraph. More...

Inheritance diagram for mininet.topo.MultiGraph:

Public Member Functions

def __init__ (self)
 
def add_node (self, node, attr_dict=None, **attrs)
 Add node to graph. More...
 
def add_edge (self, src, dst, key=None, attr_dict=None, **attrs)
 Add edge to graph. More...
 
def nodes (self, data=False)
 Return list of graph nodes. More...
 
def edges_iter (self, data=False, keys=False)
 Iterator: return graph edges, optionally with data and keys.
 
def edges (self, data=False, keys=False)
 Return list of graph edges.
 
def __getitem__ (self, node)
 Return link dict for given src node.
 
def __len__ (self)
 Return the number of nodes.
 
def convertTo (self, cls, data=False, keys=False)
 Convert to a new object of networkx.MultiGraph-like class cls. More...
 

Public Attributes

 node
 
 edge
 

Detailed Description

Utility class to track nodes and edges - replaces networkx.MultiGraph.

Member Function Documentation

◆ add_edge()

def mininet.topo.MultiGraph.add_edge (   self,
  src,
  dst,
  key = None,
  attr_dict = None,
**  attrs 
)

Add edge to graph.

Parameters
keyoptional key
attr_dictoptional attribute dict
attrsmore attributes
warningupdates attr_dict with attrs

◆ add_node()

def mininet.topo.MultiGraph.add_node (   self,
  node,
  attr_dict = None,
**  attrs 
)

Add node to graph.

Parameters
attr_dictattribute dict (optional)
attrsmore attributes (optional)
warningupdates attr_dict with attrs

◆ convertTo()

def mininet.topo.MultiGraph.convertTo (   self,
  cls,
  data = False,
  keys = False 
)

Convert to a new object of networkx.MultiGraph-like class cls.

Parameters
datainclude node and edge data
keysinclude edge keys as well as edge data

◆ nodes()

def mininet.topo.MultiGraph.nodes (   self,
  data = False 
)

Return list of graph nodes.

Parameters
datareturn list of ( node, attrs)

The documentation for this class was generated from the following file: