grapharray.classes.AdjacencyMatrix

class grapharray.classes.AdjacencyMatrix(weight: grapharray.classes.EdgeArray, sparse_format: str = 'csr')[source]

N x N matrix

__init__(weight: grapharray.classes.EdgeArray, sparse_format: str = 'csr')[source]

Create a matrix

Parameters
  • weight – the element values of the matrix. The value of weight[init, term] is set to the (init, term) element of the matrix.

  • sparse_format – str in {‘bsr’, ‘csr’, ‘csc’, ‘coo’, ‘lil’, ‘dia’,

  • ‘dok’}

  • matrix. (the format of the sparse) –

Methods

__init__(weight[, sparse_format])

Create a matrix

Attributes

T

Transpose the array

array

Core array

base_graph

BaseGraph object on that this array itself is defined

edge_to_index

Correspondence between edges and array indices

edges

Tuple of all edges

is_transposed

Whether the array is transposed or not.

node_to_index

Correspondence between nodes and array indices

nodes

Tuple of all nodes

number_of_edges

The number of edges in the base graph

number_of_nodes

The number of nodes in the base graph