Skip to content

F3kilo/easy_graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Easy graph

Easy rust realization of generic graph

Description

Data structure that represent generic vertices and undirected connections

Example

let verts = vec![0, 1, 2, 3, 4, 10];
let conns = vec![(0, 1), (1, 2), (2, 3), (3, 4), (10, 0), (4, 10)];

let graph = Graph::from_data(verts.into_iter(), conns.into_iter());
assert_eq!(verts.len(), graph.len());

let new_vertex = 15;
assert!(graph.add_vertex(new_vertex));
assert!(graph.contains(&new_vertex));

graph.add_edge(&1, &4);
assert!(graph.is_connected(&1, &4));
assert!(graph.is_connected(&4, &1));

About

Easy rust realization of generic graph

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages