DynGraph.__init__(data=None, edge_removal=True, **attr)

Initialize a graph with interaction, name, graph attributes.

  • data (input graph) – Data to initialize graph. If data=None (default) an empty graph is created. The data can be an interaction list, or any NetworkX/DyNetx graph object. If the corresponding optional Python packages are installed the data can also be a NumPy matrix or 2d ndarray, a SciPy sparse matrix, or a PyGraphviz graph.
  • edge_removal (bool, optional (default=True)) – Specify if the dynamic graph instance should allows edge removal or not.
  • attr (keyword arguments, optional (default= no attributes)) – Attributes to add to graph as key=value pairs.


>>> import dynetx as dn
>>> G = dn.DynGraph()
>>> G1 = dn.DynGraph(edge_removal=True)