[−][src]Trait btree_graph::AddEdge
AddEdge
add an edge from the vertex x to the vertex y, if it is not there.
Example
use btree_graph::{BTreeGraph, AddVertex, AddEdge, Edges}; let mut graph: BTreeGraph<String, usize> = BTreeGraph::new(); graph.add_vertex(String::from("origin")); graph.add_vertex(String::from("destination")); let old_edge_value: Option<(String, String)> = graph.add_edge(String::from("origin"), String::from("destination"), 10).unwrap(); assert!(old_edge_value.is_none()); assert_eq!(graph.edges().len(), 1)
Associated Types
Loading content...Required methods
Loading content...Implementors
impl<V, E> AddEdge<V, E> for BTreeGraph<V, E> where
V: Ord + Clone,
E: Ord + Clone,
[src]
V: Ord + Clone,
E: Ord + Clone,
When you add an edge, you should make sure that the x, and y vertices exist.