Logo Search packages:      
Sourcecode: python-networkx version File versions  Download package

def networkx::base::Graph::__init__ (   self,
  data = None,
  kwds 
)

Initialize Graph.

>>> G=Graph(name="empty")

creates empty graph G with G.name="empty"

Reimplemented in networkx::base::DiGraph, networkx::tree::Tree, networkx::tree::DirectedTree, networkx::tree::Forest, networkx::xbase::XGraph, and networkx::xbase::XDiGraph.

Definition at line 291 of file base.py.

00291                                          :
        """Initialize Graph.
        
        >>> G=Graph(name="empty")

        creates empty graph G with G.name="empty"

        """
        self.name=kwds.get("name","No Name")
        # dna is a dictionary attached to each graph and used to store
        # information about the graph structure
        self.dna={}
        self.dna["datastructure"]="vdict_of_dicts"

        self.adj={}  # empty adjacency hash

        # attempt to load graph with data
        if data is not None:
            self=convert.from_whatever(data,create_using=self)
            
    def __str__(self):


Generated by  Doxygen 1.6.0   Back to index