FubarDevelopment / QuickGraph

Fork of https://quickgraph.codeplex.com/
Microsoft Public License
9 stars 2 forks source link

CP-15504: Having problems with Serialize and Deserialize using GraphML #96

Open fubar-coder opened 6 years ago

fubar-coder commented 6 years ago

From unknown CodePlex user on Friday, 18 December 2009 00:08:22

Hi,   I am new in Quick Graph and trying to Serialize and Deserialize but I'm currently having problems with it. Here is the overall scenario. I am generating a route from shape file data using dijkstra algorithm and undirected graph object. This is working but it is providing me severe performance problems. I planned to prepare and serialize a set of undirected graph object and edge factory object so that I can deserialize the same for routing and hopefully resolve the performance issue.   First, I tried to use .NET serialization and deserialization for these two objects. When I tried this approach, the serialization and deserialization seems to happen but upon using the deserialized undirected graph object and edgeCost object, I get "The given key was not present in the dictionary" error.   Second, I tried to do serialization and deserialization using GraphML options in QuickGraph but received the following error below.  

The type 'QuickGraph.UndirectedGraph<int,QuickGraph.Edge<int>>' cannot be used as type parameter 'TGraph' in the generic type or method 'QuickGraph.Serialization.GraphMLExtensions.DeserializeFromGraphML<TVertex,TEdge,TGraph>(TGraph, System.Xml.XmlReader, QuickGraph.IdentifiableVertexFactory<TVertex>, QuickGraph.IdentifiableEdgeFactory<TVertex,TEdge>)'. There is no implicit reference conversion from 'QuickGraph.UndirectedGraph<int,QuickGraph.Edge<int>>' to 'QuickGraph.IMutableVertexAndEdgeListGraph<int,QuickGraph.Edge<int>>'.

  I have created a small sample to shows these issues. Any input in this regard will be very helpful. If you feel I should take a completely different approach for the performance problem, please let me know.   Sample Code is attached with this Issue   Regards,   Sudip

Serialization.zip

fubar-coder commented 6 years ago

Form unknown CodePlex user on Thursday, 03 July 2014 05:47:29

hello barman, did you manage to serialize or deserialize your UndirectedGraph?

I'm having the same issues as you did.