Class NetworkXFormat


  • public final class NetworkXFormat
    extends Object
    Utilities for handling pickled NetworkX graphs.
    See Also:
    NetworkX, Pickle
    • Method Detail

      • parse

        public static net.razorvine.pickle.objects.ClassDict parse​(InputStream stream)
                                                            throws IOException
        Unpickle the NetworkX graph from the input stream.
        Parameters:
        stream - the input stream with pickled data
        Returns:
        an unpickled NetworkX graph
        Throws:
        IOException - if an I/O error occurs
      • load

        public static <V> org.jgrapht.Graph<V,​org.jgrapht.graph.DefaultWeightedEdge> load​(net.razorvine.pickle.objects.ClassDict nx)
        Reconstruct a Graph object from the unpickled NetworkX graph.

        Please be careful with the type of the nodes.

        Type Parameters:
        V - the type of nodes in the graph
        Parameters:
        nx - the unpickled NetworkX graph
        Returns:
        a graph represented in the unpickled graph