Skip to content

AdjacencyMatrix

AdjacencyMatrix(graph)

convert the graph into a adjacency matrix in sparse array format.

See:

Examples

The sparse array can be converted to an adjacency matrix in List format with the Normal function:

>> AdjacencyMatrix(Graph({1 -> 2, 2 -> 3, 1 -> 3, 4 -> 2})) // Normal
{{0,1,1,0},
{0,0,1,0},
{0,0,0,0},
{0,1,0,0}}

GraphCenter, GraphDiameter, GraphPeriphery, GraphRadius, EdgeList, EdgeQ, EulerianGraphQ, FindEulerianCycle, FindHamiltonianCycle, FindVertexCover, FindShortestPath, FindSpanningTree, Graph, GraphQ, HamiltonianGraphQ, Normal, VertexEccentricity, VertexList, VertexQ, WeightedAdjacencyMatrix

Implementation status

  • ✅ - full supported

Github