cdlib.utils.convert_graph_formats

convert_graph_formats(graph: object, desired_format: object, directed: bool = None) → object

Converts from/to networkx/igraph

Parameters:
  • graph – original graph object
  • desired_format – desired final type. Either nx.Graph or ig.Graph
  • directed – boolean, default False
Returns:

the converted graph

Raises:

TypeError – if input graph is neither an instance of nx.Graph nor ig.Graph