cdlib.utils.convert_graph_formats

convert_graph_formats(graph, desired_format, directed=None)

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