Building a Graph with a Custom Vertex and Edge classes, and using the interface? & GraphImport
I have been troubled by these issues over the last few days.
I am looking to build the graph outlined in the attached Graphml document. Initially i tried to use GraphMLImporter, this came to no avail i was continually receiving Parsing error my initial enquiry can be seen here:
If anyone can show me how to import my graph that would solve my problem immediately as i wouldn't have to go through the process of building and trying to add my vertices and edges manually. I am at my wits end with this some help on that would be really appreciated. I can send you any data or the documents you need to help.
Failing that i have been trying to build the graph myself as i need to run Dijkstra on the graph, i have created an ArrayList<Node> and ArrayList<Edge> and i am trying to add them to a directed graph, I think i may be missing the vertex interface at some point. Any help and pointers would really help and you might save a man form pulling the rest of his hair out.
Caused by: java.lang.NullPointerException: throw with null exception at org.jgrapht.graph.AbstractGraph.assertVertexExist(AbstractGraph.java:129) at org.jgrapht.graph.AbstractBaseGraph.addEdge(AbstractBaseGraph.java:214) at com.app.WayGraph.WayGraph.createWayGraph(WayGraph.java:65)
I hope someone can help, Importing the graph would be the ideal option as it will be the way i need to work.