You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* JGraphT version: 1.4.0
* Java version (java -version)/platform:
openjdk version "18.0.2" 2022-07-19
OpenJDK Runtime Environment (build 18.0.2+9-61)
OpenJDK 64-Bit Server VM (build 18.0.2+9-61, mixed mode, sharing)
Issue
I have used jgrapht to analyse some graph problems. Now I am working with big graph (with more than ten millions nodes ) and use CH algorithm.
What troubles me is the precomputation of CH is so long, more than 2 hours. And I found the preprocessed data is saved in ContractionHierarchy as below.
Steps to reproduce (small coding example)
public static class ContractionHierarchy<V, E>
Expected behaviour
So I wonder is there any way to export ContractionHierarchy to files so that I can use it next time without compiling the precomputation and query directly.
Other information
The text was updated successfully, but these errors were encountered:
It doesn't appear possible, currently. And I agree that it would be very useful to add this.
The simplest way would be to mark the inner class ContractionHierachy as Serializable, and then test to see what else needs to be done to support successful serialization and deserialization.
However, this isn't necessarily the best approach, since it requires serializing the underlying graph as well, which may contain information which isn't relevant to the contraction itself. Also, Java serialization comes with other issues such as incompatibilities across versions.
I can think of other ways which build off of our graph export/import packages, allowing the contraction graph itself to be saved in arbitrary format, separate from the underlying graph. This requires the inner classes to be made public.
It doesn't appear possible, currently. And I agree that it would be very useful to add this.
The simplest way would be to mark the inner class ContractionHierachy as Serializable, and then test to see what else needs to be done to support successful serialization and deserialization.
However, this isn't necessarily the best approach, since it requires serializing the underlying graph as well, which may contain information which isn't relevant to the contraction itself. Also, Java serialization comes with other issues such as incompatibilities across versions.
I can think of other ways which build off of our graph export/import packages, allowing the contraction graph itself to be saved in arbitrary format, separate from the underlying graph. This requires the inner classes to be made public.
Issue
I have used jgrapht to analyse some graph problems. Now I am working with big graph (with more than ten millions nodes ) and use CH algorithm.
What troubles me is the precomputation of CH is so long, more than 2 hours. And I found the preprocessed data is saved in ContractionHierarchy as below.
Steps to reproduce (small coding example)
public static class ContractionHierarchy<V, E>
Expected behaviour
So I wonder is there any way to export ContractionHierarchy to files so that I can use it next time without compiling the precomputation and query directly.
Other information
The text was updated successfully, but these errors were encountered: