1

JGraphT has a GraphMLExporter that enables to export a graph to a GraphML file. There doesn't seem to be a GraphMLImporter.

Is there a simple way to generate a graph in JGraphT from a .grphml file?

OOP
  • 293
  • 4
  • 16
  • I didn't find any GraphMLImporter and the GraphMLExporter did not provide the expected information about the generic objects held by jgrapht. Therefore I used JAXB to import and export my graph to XML file. – OOP Jan 13 '15 at 15:09

2 Answers2

3

Starting from version 1.0.0 JGraphT has both an importer and an exporter for GraphML. The classes are named GraphMLImporter and GraphMLExporter inside the jgrapht-ext package.

Starting from version 1.1 all importers and exporters are located in the jgrapht-io package. Additionally, a simpler version called SimpleGraphMLImporter which provides less functionality in favor of greater speed is also available in latest versions.

A demo is also available, see GraphMLDemo.

D. Michail
  • 81
  • 1
  • 6
0

Check out jgrapht-sna project. Beside implementations of SNA algorithms, it has GraphMLImporter class.

Infeligo
  • 11,715
  • 8
  • 38
  • 50