grapharray.classes.EdgeArray

class grapharray.classes.EdgeArray(base_graph: grapharray.classes.BaseGraph, init_val=0, is_array_2d: bool = False)[source]

Object of variables defined on the edges.

__init__(base_graph: grapharray.classes.BaseGraph, init_val=0, is_array_2d: bool = False)

Set the initial value of array.

Methods

__init__(base_graph[, init_val, is_array_2d])

Set the initial value of array.

as_dict()

Return values of variables as a dictionary keyed by node/edge.

as_nx_graph()

Return a nx.DiGraph with the array elements as its edge attributes.

get_copy()

Make a copy of self.

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

index

Correspondence between the array indices and the edges.

is_2d

Whether the array is 2-dimensional or not

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