Creating an adjacency Matrix from a JUNG Graph.
Posted
by prince
on Stack Overflow
See other posts from Stack Overflow
or by prince
Published on 2010-03-08T03:18:52Z
Indexed on
2010/03/08
3:30 UTC
Read the original article
Hit count: 409
Graph < Integer, Integer> g = new SparseMultigraph<Integer, Integer>();
g.addVertex(1);g.addVertex(2);g.addVertex(3);
g.addEdge(0,1,2 ,EdgeType.DIRECTED);g.addEdge(1,2,3 ,EdgeType.DIRECTED);g.addEdge(2,3,1 ,EdgeType.DIRECTED);g.addEdge(3,1,3 ,EdgeType.DIRECTED);
How can I convert this graph into an adjacency matrix taking into consideration that it is a directed graph.
© Stack Overflow or respective owner