This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.
Read an undirected graph in sparse6 format from path.
Parameters: path (file or string) – File or filename to write. Returns: G – If the file contains multple lines then a list of graphs is returned Return type: Graph/Multigraph or list of Graphs/MultiGraphs Raises:
NetworkXError– If the string is unable to be parsed in sparse6 format
>>> nx.write_sparse6(nx.Graph([(0,1),(0,1),(0,1)]), 'test.s6') >>> G = nx.read_sparse6('test.s6') >>> sorted(G.edges()) [(0, 1)]
Sparse6 specification: http://cs.anu.edu.au/~bdm/data/formats.txt