How can one save a JUNG graph with a custom node and edge? Problem is, till now we have been able to save a JUNG graph of fields with primitive types like integer, string, etc. But the JUNG graph custom node and edge we are working with involves using datatypes like ArrayList and some more complicated datastructures inside the the edge and/or node. I have searched a lot on the web but came across how to save a simple custom node/edge using only int or string or double.
Moreover, my aim is not to save an image file like jpeg, etc. The point is to save it in a format which can easily be loaded again into the JUNG format when required to perform certain operations.
How can one save such a graph?
Thanks.
Here are two links that address saving a Jung Graph in the fashion you have described. The main point being you need to save using GraphML in order to save the data of the nodes.
This link is saving using the GraphML writer. http://halfclosed.wordpress.com/2010/12/04/graphml-with-jung-saving/
This link is about loading from a GraphML file. http://halfclosed.wordpress.com/2010/12/04/graphml-with-jung-loading-from-graphml/
GraphML is a file format for saving graphs, as it stores the data. It is worth noting that it doesn't necessarily save the layout. Unfortunately saving your data in the GraphML format is not completely trivial, but it can be done.