GraphStream Users

Archives de la liste Aide

Help regarding saving the Graph object state in a file.

Chronologique Discussions 
  • From: Ravi Prakash <cs14mtech11013 AT>
  • To: users AT, dev AT
  • Subject: Help regarding saving the Graph object state in a file.
  • Date: Fri, 10 Jun 2016 03:08:01 +0530

Dear GraphStream Team,
Warm Greeting!.

I am using GraphStream Library in one of my java projects , where I have a requirement of storing(serializing) the Graph object generated for later use.
I create graph using SingleGraph(). I have tried GSON as well as readObject and writeObject technique of serialising and deserealiszing the java objects. But didn't got any success :(.

following is the code snippet :

public class SerializablePerson implements Serializable  
   private String lastName;  
   SingleGraph graph;
                this.graph = new SingleGraph();

                Generator gen = new WattsStrogatzGenerator(10,2,.5);

while(gen.nextEvents()) {}


when I try to serialize above field lastName gets serialized properly but graph isn't.
I am stuck.  I will appreciate any help from your end.

An alternate solution where i won't be needing to serialize my graph object is , if i can somehow get same graph every time  i generate a graph  using :

Generator gen = new WattsStrogatzGenerator(10,2,.5);

but unfortunately the above snippet generates random graphs as obvious. Is there any alternative to achieve the same.


Ravi Prakash


  • Help regarding saving the Graph object state in a file., Ravi Prakash, 09/06/2016

Archives gérées par MHonArc 2.6.16.

Top of page