I am new to Neo4j and I am trying to extract the adjacency matrix of my graph. I found this cypher query (https://github.com/michelcaradec/Graph-Theory#adjacency-matrix) to get the adjacency matrix but it return the matrix without the row names and column names. How is it possible to save the names too?
Here is the cypher query:
// Get all vertices.
WITH collect(n) AS Nodes
// For each vertices combination...
WITH [n IN Nodes |
[m IN Nodes |
// ...Check for edge existence.
WHEN 0 THEN 0
] AS AdjacencyMatrix
// Unroll rows.
UNWIND AdjacencyMatrix AS AdjacencyRows