Fix ElementMap capacity in FrozenGraph::edge_map
This commit is contained in:
@@ -142,8 +142,9 @@ impl GraphTopology for FrozenGraph {
|
||||
self.incidences.len() / 2
|
||||
}
|
||||
|
||||
// TODO: Find a way to reduce the needed capacity for the edge ElementMap. This could be improved by finding a small vertex cover and store those vertices first. See https://en.wikipedia.org/wiki/Vertex_cover#Approximate_evaluation
|
||||
fn edge_map<T: Clone>(&self, default: T) -> ElementMap<Self::Edge, T> {
|
||||
ElementMap::new(default, |e| e.0, self.edge_count())
|
||||
ElementMap::new(default, |e| e.0, self.incidences.len() - 1)
|
||||
}
|
||||
|
||||
fn degree(&self, v: Self::Vertex) -> usize {
|
||||
|
||||
Reference in New Issue
Block a user