Change GraphTopologyConversion::convert return value to include the new GraphIsomorphism
This allows to convert maps for the converted graph.
This commit is contained in:
+22
-22
@@ -185,16 +185,16 @@ impl MakeTestGraph for FrozenGraph {
|
||||
[Vec<Incidence<Self::Vertex, Self::Edge>>; 10],
|
||||
) {
|
||||
let (build, vertices, edges, incidences) = AppendGraph::standard();
|
||||
let (graph, vertex_map, edge_map) = FrozenGraph::convert(&build);
|
||||
let (graph, iso) = FrozenGraph::convert(&build);
|
||||
(
|
||||
graph,
|
||||
vertices.map(|v| vertex_map[v]),
|
||||
edges.map(|(e, u, v)| (edge_map[e], vertex_map[u], vertex_map[v])),
|
||||
vertices.map(|v| iso.vertex(v)),
|
||||
edges.map(|(e, u, v)| (iso.edge(e), iso.vertex(u), iso.vertex(v))),
|
||||
incidences.map(|vec| {
|
||||
vec.iter()
|
||||
.map(|i| Incidence {
|
||||
vertex: vertex_map[i.vertex],
|
||||
edge: edge_map[i.edge],
|
||||
vertex: iso.vertex(i.vertex),
|
||||
edge: iso.edge(i.edge),
|
||||
})
|
||||
.collect()
|
||||
}),
|
||||
@@ -207,55 +207,55 @@ impl MakeTestGraph for FrozenGraph {
|
||||
|
||||
fn single_vertex() -> (Self, Self::Vertex) {
|
||||
let (build, v) = AppendGraph::single_vertex();
|
||||
let (graph, vertex_map, _) = FrozenGraph::convert(&build);
|
||||
(graph, vertex_map[v])
|
||||
let (graph, iso) = FrozenGraph::convert(&build);
|
||||
(graph, iso.vertex(v))
|
||||
}
|
||||
|
||||
fn single_edge() -> (Self, [Self::Vertex; 2], Self::Edge) {
|
||||
let (build, vertices, e) = AppendGraph::single_edge();
|
||||
let (graph, vertex_map, edge_map) = FrozenGraph::convert(&build);
|
||||
(graph, vertices.map(|v| vertex_map[v]), edge_map[e])
|
||||
let (graph, iso) = FrozenGraph::convert(&build);
|
||||
(graph, vertices.map(|v| iso.vertex(v)), iso.edge(e))
|
||||
}
|
||||
|
||||
fn disconnected() -> (Self, [Self::Vertex; 3]) {
|
||||
let (build, vertices) = AppendGraph::disconnected();
|
||||
let (graph, vertex_map, _) = FrozenGraph::convert(&build);
|
||||
(graph, vertices.map(|v| vertex_map[v]))
|
||||
let (graph, iso) = FrozenGraph::convert(&build);
|
||||
(graph, vertices.map(|v| iso.vertex(v)))
|
||||
}
|
||||
|
||||
fn loop_edge() -> (Self, Self::Vertex, Self::Edge) {
|
||||
let (build, v, e) = AppendGraph::loop_edge();
|
||||
let (graph, vertex_map, edge_map) = FrozenGraph::convert(&build);
|
||||
(graph, vertex_map[v], edge_map[e])
|
||||
let (graph, iso) = FrozenGraph::convert(&build);
|
||||
(graph, iso.vertex(v), iso.edge(e))
|
||||
}
|
||||
|
||||
fn multiple_edges<const K: usize>() -> (Self, [Self::Vertex; 2], [Self::Edge; K]) {
|
||||
let (build, vertices, edges) = AppendGraph::multiple_edges();
|
||||
let (graph, vertex_map, edge_map) = FrozenGraph::convert(&build);
|
||||
let (graph, iso) = FrozenGraph::convert(&build);
|
||||
(
|
||||
graph,
|
||||
vertices.map(|v| vertex_map[v]),
|
||||
edges.map(|e| edge_map[e]),
|
||||
vertices.map(|v| iso.vertex(v)),
|
||||
edges.map(|e| iso.edge(e)),
|
||||
)
|
||||
}
|
||||
|
||||
fn two_edge_path() -> (Self, [Self::Vertex; 3], [Self::Edge; 2]) {
|
||||
let (build, vertices, edges) = AppendGraph::two_edge_path();
|
||||
let (graph, vertex_map, edge_map) = FrozenGraph::convert(&build);
|
||||
let (graph, iso) = FrozenGraph::convert(&build);
|
||||
(
|
||||
graph,
|
||||
vertices.map(|v| vertex_map[v]),
|
||||
edges.map(|e| edge_map[e]),
|
||||
vertices.map(|v| iso.vertex(v)),
|
||||
edges.map(|e| iso.edge(e)),
|
||||
)
|
||||
}
|
||||
|
||||
fn two_edge_path_with_loops() -> (Self, [Self::Vertex; 3], [Self::Edge; 4]) {
|
||||
let (build, vertices, edges) = AppendGraph::two_edge_path_with_loops();
|
||||
let (graph, vertex_map, edge_map) = FrozenGraph::convert(&build);
|
||||
let (graph, iso) = FrozenGraph::convert(&build);
|
||||
(
|
||||
graph,
|
||||
vertices.map(|v| vertex_map[v]),
|
||||
edges.map(|e| edge_map[e]),
|
||||
vertices.map(|v| iso.vertex(v)),
|
||||
edges.map(|e| iso.edge(e)),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user