Graphs
jaxscape.graph.AbstractGraph
¤
Abstract base class for graphs.
jaxscape.graph.Graph
¤
A simple graph defined by an adjacency matrix.
Arguments:
adjacency_matrix: Ajax.experimental.sparse.BCOOadjacency matrix.
get_adjacency_matrix() -> BCOO
¤
jaxscape.graph.GridGraph
¤
Grid graph where vertices are defined by a rectangular grid.
Arguments:
gridis a 2D array of shape(height, width)used to define edge weights. When calculating distances, edge weights are assume to represent permeability (i.e., 1/resistance, higher values indicate easier movement).funis a function applied to the source and target node values to define the edge weight. It takes two arrays and returns an array of the same size. Defaults to assigning the target vertex weight (fun = lambda x, y: y).neighborsdefines the contiguity pattern, and can be eitherROOK_CONTIGUITYorQUEEN_CONTIGUITY.
coord_to_index(i: Array, j: Array) -> Array
¤
Convert (i, j) grid coordinates to the associated passive vertex index.
index_to_coord(v: Array) -> Array
¤
Convert passive vertex index v to (i, j) grid coordinates.
node_values_to_array(values: Array) -> Array
¤
Reshapes the 1D array values of vertices to the underlying 2D grid.
array_to_node_values(array: Array) -> Array
¤
Reshapes the 1D array values of vertices to the underlying 2D grid.