Rename Graph to AppendGraph for future other graph models
This commit is contained in:
+5
-5
@@ -1,10 +1,10 @@
|
||||
use grapherity::algorithms;
|
||||
use grapherity::models::Graph;
|
||||
use grapherity::models::AppendGraph;
|
||||
use grapherity::traits::GraphTopology;
|
||||
|
||||
#[test]
|
||||
fn dijkstra_single_vertex() {
|
||||
let mut graph = Graph::new();
|
||||
let mut graph = AppendGraph::new();
|
||||
let v1 = graph.add_vertex();
|
||||
let (distances, predecessors) = algorithms::dijkstra(&graph, v1);
|
||||
assert_eq!(
|
||||
@@ -30,7 +30,7 @@ fn dijkstra_single_vertex() {
|
||||
|
||||
#[test]
|
||||
fn dijkstra_disconnected() {
|
||||
let mut graph = Graph::new();
|
||||
let mut graph = AppendGraph::new();
|
||||
let v1 = graph.add_vertex();
|
||||
graph.add_vertex();
|
||||
let (distances, predecessors) = algorithms::dijkstra(&graph, v1);
|
||||
@@ -107,8 +107,8 @@ fn dijkstra() {
|
||||
}
|
||||
}
|
||||
|
||||
fn make_test_graph() -> (Graph, [<Graph as GraphTopology>::Vertex; 10]) {
|
||||
let mut graph = Graph::new();
|
||||
fn make_test_graph() -> (AppendGraph, [<AppendGraph as GraphTopology>::Vertex; 10]) {
|
||||
let mut graph = AppendGraph::new();
|
||||
let vertices = core::array::from_fn::<_, 10, _>(|_| graph.add_vertex());
|
||||
graph.add_edge(vertices[0], vertices[1]);
|
||||
graph.add_edge(vertices[1], vertices[2]);
|
||||
|
||||
Reference in New Issue
Block a user