0

I use jgrapht. I will generate subgraphs.

I think jgrapht-0.8.2/jgrapht-0.8.2/src/org/jgrapht/graph/DirectedSubgraph.java is useful for this purpose. But I could not find how can I use this class? Can you help me ?

For example: jgrapht-0.8.2/jgrapht-0.8.2/src/org/jgrapht/demo/HelloJGraphT.java A directed graph constructor is used like that in HelloJGraphT.java class

DirectedGraph<String, DefaultEdge> g =
            new DefaultDirectedGraph<String, DefaultEdge>(DefaultEdge.class);
pad
  • 41,040
  • 7
  • 92
  • 166
eyiht
  • 1
  • 2

1 Answers1

0

if you want to create your new sub graph, you have to write this code:

DirectedSubgraph<String, DefaultEdge> YouSubGraph = new DirectedSubgraph<String, DefaultEdge>(arg0, arg1, arg2)

Where arg0, is your main graph, arg1 is the set of your vertex in your sub graph, and arg2 is the set of your edges in your sub graph.

You can obtain the edged set using:

Set<DefaultEdge> YourEdges = YouSubGraph.edgeSet();

I think that you could obtain the vertex on the same way.

Sorry for mi English I hope it helps you.