grapharray.classes.NodeArray¶
- class grapharray.classes.NodeArray(base_graph: grapharray.classes.BaseGraph, init_val=0, is_array_2d: bool = False)[source]¶
Object of variables defined on the nodes.
- __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.
Return a nx.DiGraph with the array elements as its node attributes.
get_copy()Make a copy of self.
Attributes
TTranspose the array
arrayCore array
base_graphBaseGraph object on that this array itself is defined
edge_to_indexCorrespondence between edges and array indices
edgesTuple of all edges
Correspondence between the array indices and the nodes.
is_2dWhether the array is 2-dimensional or not
is_transposedWhether the array is transposed or not.
node_to_indexCorrespondence between nodes and array indices
nodesTuple of all nodes
number_of_edgesThe number of edges in the base graph
number_of_nodesThe number of nodes in the base graph