to_adjacency_list

Function to_adjacency_list 

Source
pub fn to_adjacency_list<T, S>(
    matrix: &S,
    directed: bool,
) -> SparseResult<Vec<Vec<(usize, T)>>>
where T: Float + Debug + Copy + 'static, S: SparseArray<T>,
Expand description

Convert a sparse matrix to adjacency list representation

§Arguments

  • matrix - The sparse matrix
  • directed - Whether the graph is directed

§Returns

Adjacency list as a vector of vectors of (neighbor, weight) pairs