Adjacency and indicator matrices

Functions for building adjacency and indicator matrices are in motifcluster.indicators.

_build_G(adj_mat)

Build sparse adjacency matrix.

Build the sparse adjacency matrix G from a graph adjacency matrix.

Parameters:adj_mat (matrix) – The original adjacency matrix.
Returns:G – The adjacency matrix in sparse form.
Return type:sparse matrix
_build_Gd(adj_mat)

Build double-edge adjacency matrix.

Build the sparse double-edge adjacency matrix Gd from a graph adjacency matrix.

Parameters:adj_mat (matrix) – The original adjacency matrix.
Returns:Gd – A double-edge adjacency matrix in sparse form.
Return type:sparse matrix
_build_Gp(adj_mat)

Build product matrix.

Build the sparse product matrix Gp from a graph adjacency matrix.

Parameters:adj_mat (matrix) – The original adjacency matrix.
Returns:Gp – A product matrix in sparse form.
Return type:sparse matrix
_build_Gs(adj_mat)

Build single-edge indicator matrix.

Build the sparse single-edge adjacency matrix Gs from a graph adjacency matrix.

Parameters:adj_mat (matrix) – The original adjacency matrix.
Returns:Gs – A single-edge adjacency matrix in sparse form.
Return type:sparse matrix
_build_Id(adj_mat)

Build identity matrix.

Build the sparse identity matrix Id from a graph adjacency matrix.

Parameters:adj_mat (matrix) – The original adjacency matrix.
Returns:Id – An identity matrix in sparse form.
Return type:sparse matrix
_build_J(adj_mat)

Build directed indicator matrix.

Build the sparse directed indicator matrix J from a graph adjacency matrix.

Parameters:adj_mat (matrix) – The original adjacency matrix.
Returns:J – A directed indicator matrix in sparse form.
Return type:sparse matrix
_build_J0(adj_mat)

Build missing-edge indicator matrix.

Build the missing-edge indicator matrix J0 from a graph adjacency matrix.

Parameters:adj_mat (matrix) – The original adjacency matrix.
Returns:J0 – A missing-edge indicator matrix.
Return type:sparse matrix
_build_Jd(adj_mat)

Build double-edge indicator matrix.

Build the sparse double-edge indicator matrix Jd from a graph adjacency matrix.

Parameters:adj_mat (matrix) – The original adjacency matrix.
Returns:Jd – A double-edge indicator matrix in sparse form.
Return type:sparse matrix
_build_Je(adj_mat)

Build edge-and-diagonal matrix.

Build the sparse edge-and-diagonal matrix Ie from a graph adjacency matrix.

Parameters:adj_mat (matrix) – The original adjacency matrix.
Returns:Ie – An edge-and-diagonal matrix in sparse form.
Return type:sparse matrix
_build_Jn(adj_mat)

Build vertex-distinct indicator matrix.

Build the vertex-distinct indicator matrix Jn from a graph adjacency matrix.

Parameters:adj_mat (matrix) – The original adjacency matrix.
Returns:Jn – A vertex-distinct indicator matrix.
Return type:sparse matrix
_build_Js(adj_mat)

Build single-edge indicator matrix.

Build the sparse single-edge indicator matrix Js from a graph adjacency matrix.

Parameters:adj_mat (matrix) – The original adjacency matrix.
Returns:Js – A single-edge indicator matrix in sparse form.
Return type:sparse matrix