This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.



Returns a NetworkX MultiGraph or MultiDiGraph from the dot file with the passed path.

If this file contains multiple graphs, only the first such graph is returned. All graphs _except_ the first are silently ignored.

Parameters:path (str or file) – Filename or file handle.
Returns:G – A MultiGraph or MultiDiGraph.
Return type:MultiGraph or MultiDiGraph


Use G = nx.Graph(read_dot(path)) to return a Graph instead of a MultiGraph.