Skip to main content

get_edgelist

Function get_edgelist 

Source
pub fn get_edgelist(graph: &Graph) -> IgraphResult<Vec<(VertexId, VertexId)>>
Expand description

Return all edges of the graph as a list of (source, target) pairs.

Edges are returned in edge-ID order (0, 1, 2, …).

§Examples

use rust_igraph::{create, get_edgelist};

let g = create(&[(0, 1), (1, 2), (2, 0)], 3, false).unwrap();
let el = get_edgelist(&g).unwrap();
assert_eq!(el.len(), 3);