igraph_bfshandler_t

Type Alias igraph_bfshandler_t 

Source
pub type igraph_bfshandler_t = Option<unsafe extern "C" fn(graph: *const igraph_t, vid: igraph_int_t, pred: igraph_int_t, succ: igraph_int_t, rank: igraph_int_t, dist: igraph_int_t, extra: *mut c_void) -> igraph_error_t>;
Expand description

\typedef igraph_bfshandler_t \brief Callback type for BFS function.

\ref igraph_bfs() is able to call a callback function, whenever a new vertex is found, while doing the breadth-first search. This callback function must be of type \c igraph_bfshandler_t. It has the following arguments:

\param graph The graph that the algorithm is working on. Of course this must not be modified. \param vid The id of the vertex just found by the breadth-first search. \param pred The id of the previous vertex visited. It is -1 if there is no previous vertex, because the current vertex is the root is a search tree. \param succ The id of the next vertex that will be visited. It is -1 if there is no next vertex, because the current vertex is the last one in a search tree. \param rank The rank of the current vertex, it starts with zero. \param dist The distance (number of hops) of the current vertex from the root of the current search tree. \param extra The extra argument that was passed to \ref igraph_bfs(). \return \c IGRAPH_SUCCESS if the BFS should continue, \c IGRAPH_STOP if the BFS should stop and return to the caller normally. Any other value is treated as an igraph error code, terminating the search and returning to the caller with the same error code. If a BFS is is terminated prematurely, then all elements of the result vectors that were not yet calculated at the point of the termination contain negative values.

\sa \ref igraph_bfs()

Aliased Type§

pub enum igraph_bfshandler_t {
    None,
    Some(unsafe extern "C" fn(*const igraph_t, i64, i64, i64, i64, i64, *mut c_void) -> u32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(*const igraph_t, i64, i64, i64, i64, i64, *mut c_void) -> u32)

Some value of type T.