Initial release #1

Merged
warrence merged 102 commits from dev into main 2026-06-30 10:26:52 +02:00
Showing only changes of commit 761920b2c0 - Show all commits
+1 -13
View File
@@ -61,20 +61,8 @@ impl Graph {
self.incidence_headers[v.0].incidence_count self.incidence_headers[v.0].incidence_count
} }
// TODO: 'fn are_adjacent()' could probably be done with a neighbor vertex iterator.
pub fn are_adjacent(&self, v1: Vertex, v2: Vertex) -> bool { pub fn are_adjacent(&self, v1: Vertex, v2: Vertex) -> bool {
let Some(mut incidence) = self.incidence_headers[v1.0].first_incidence else { self.neighbors(v1).find(|&x| x == v2).is_some()
return false;
};
loop {
if self.incidence_vertices[incidence.0] == v2 {
return true;
}
let Some(next) = self.next_incidences[incidence.0] else {
return false;
};
incidence = next;
}
} }
// TODO: 'fn add_vertex()' needs variants for custom vertex data. // TODO: 'fn add_vertex()' needs variants for custom vertex data.