Hi,
You can access graphs’ nodes with indices, so it becomes trivial to create a graph from such matrix or create a matrix from a graph.
From the the "Getting Started" tutorial (first link in google when looking for « graphstream adjacency matrix ») :
int n = graph.getNodeCount();
byte adjacencyMatrix[][] = new byte[n][n];
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
adjacencyMatrix[i][j] = graph.getNode(i).hasEdgeBetween(j) ? 1 : 0;
Yoann
> On Aug 11, 2016, at 10:18 AM, Suhas Bhairav <suhasbhairav AT gmail.com> wrote:
>
> Hi All,
>
> Is there an adjacency matrix feature in graphstream with respect to graphs?
>
> Regards
> Suhas Bhairav
Archives gérées par MHonArc 2.6.16.