graph_tool.load_graph#

graph_tool.load_graph(file_name, fmt='auto', ignore_vp=None, ignore_ep=None, ignore_gp=None)[source]#

Load a graph from file_name (which can be either a string or a file-like object).

The format is guessed from file_name, or can be specified by fmt, which can be either “gt”, “graphml”, “xml”, “dot” or “gml”. (Note that “graphml” and “xml” are synonyms).

If provided, the parameters ignore_vp, ignore_ep and ignore_gp, should contain a list of property names (vertex, edge or graph, respectively) which should be ignored when reading the file.

Warning

The only file formats which are capable of perfectly preserving the internal property maps are “gt” and “graphml”. Because of this, they should be preferred over the other formats whenever possible.