public DirectedGraph transpose()
throws GraphException
{
try
{
DefaultDirectedGraph RC = new DefaultDirectedGraph();
Set vertexSet = getVertices();
Set edgeSet = getEdges();
Iterator vertices = vertexSet.iterator();
while ( vertices.hasNext() )
{
RC.addVertex( (Vertex) vertices.next() );
}
Iterator edges = edgeSet.iterator();
while ( edges.hasNext() )
{
Edge edge = (Edge) edges.next();
RC.addEdge( edge, getTarget( edge ), getSource( edge ) );
}
return RC;
}
catch ( GraphException e )