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:
grid: 2D array with shape(height, width)used to define edge weights. When calculating distances, edge weights are assumed to represent permeability (1/resistance; higher values indicate easier movement).fun: Function applied to the source and target node values to define the edge weight. Takes two arrays and returns an array of the same size. Defaults to the target vertex weight (fun = lambda x, y: y).neighbors: Contiguity pattern, 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.