classmethod graphicle.data.AdjacencyList.from_matrix(adj_matrix: ndarray[Any, dtype[float64]] | ndarray[Any, dtype[bool_]] | ndarray[Any, dtype[int32]], weighted: bool = False, self_loop: bool = False) AdjacencyList[source]

Construct an AdjacencyList object from an optionally weighted adjacency matrix.

Parameters:
adj_matrix : ndarray[int32] or ndarray[bool] or ndarray[float64]

2D array, providing a dense square matrix representation of the particle set’s adjacency.

weighted : bool

Whether or not to propogate the numerical values in the elements of the adjacency matrix as the edge weights. Default is False.

self_loop : bool

If True will include self-loops for each node. ie. an edge connecting a node to itself.

Returns:

Instance created from a dense adjacency matrix.

Return type:

AdjacencyList


Last update: Jun 27, 2025