heapless_graphs 0.2.3

Implementation of composable graphs for no_alloc environments
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// SPDX-License-Identifier: Apache-2.0

use heapless_graphs::{algorithms::dfs_recursive, edgelist::edge_list::EdgeList};

fn main() {
    // Do DFS traversal, starting from node 5
    let graph = EdgeList::<8, _, _>::new([(1, 5), (5, 3), (7, 7)]);
    let mut visited = [false; 10];
    dfs_recursive(&graph, 5, visited.as_mut_slice(), &mut |x| {
        println!("node: {}", x)
    })
    .unwrap();
}