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

def networkx::xbase::XDiGraph::__init__ (   self,
  data = None,
  kwds 
)

Initialize XDiGraph.

Optional arguments::
name: digraph name (default="No Name")
selfloops: if True then selfloops are allowed (default=False)
multiedges: if True then multiple edges are allowed (default=False)

Reimplemented from networkx::base::DiGraph.

Definition at line 925 of file xbase.py.

00925                                        :
        """Initialize XDiGraph.

        Optional arguments::
        name: digraph name (default="No Name")
        selfloops: if True then selfloops are allowed (default=False)
        multiedges: if True then multiple edges are allowed (default=False)

        """
        self.name=kwds.get("name","No Name")
        self.selfloops=kwds.get("selfloops",False)    # no self-loops
        self.multiedges=kwds.get("multiedges",False)  # no multiedges

        # dna is a dictionary attached to each graph and used to store
        # information about the graph structure. In this version the
        # dna is provided as a user-defined variable and should not be
        # relied on.
        self.dna={}
        self.dna["datastructure"]="xgraph_dict_of_dicts"
        
        self.adj={}         # adjacency list
        self.pred={}        # predecessor
        self.succ=self.adj  # successor is same as adj

        if data is not None:
            self=convert.from_whatever(data,create_using=self)




    def add_edge(self, n1, n2=None, x=None):  


Generated by  Doxygen 1.6.0   Back to index