Skip to content

Latest commit

 

History

History
39 lines (23 loc) · 1.41 KB

File metadata and controls

39 lines (23 loc) · 1.41 KB

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}}

Related terms

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