Skip to main content

compute_transition_prob

Function compute_transition_prob 

Source
pub fn compute_transition_prob(
    adjacency: &FxHashMap<u32, Vec<(u32, f32)>>,
    p: f32,
    q: f32,
) -> FxHashMap<(u32, u32), Vec<(u32, f32)>>
Expand description

Compute the transition probabilities

§Params

  • adjacency - The adjacency of the graph stored as a HashMap
  • p - p parameter in node2vec that controls probability to return to origin node.
  • q - q parameter in node2vec that controls probability to reach out futher in the graph.

§Returns

The transition probabilities as an FxHashMap.