pub trait GraphMapping {
type DomV: Eq + Clone;
type DomE: Eq + Clone;
type CodV: Eq + Clone;
type CodE: Eq + Clone;
type VertexMap: Mapping<Dom = Self::DomV, Cod = Self::CodV>;
type EdgeMap: Mapping<Dom = Self::DomE, Cod = Self::CodE>;
// Required methods
fn vertex_map(&self) -> &Self::VertexMap;
fn edge_map(&self) -> &Self::EdgeMap;
// Provided methods
fn apply_vertex(&self, v: Self::DomV) -> Option<Self::CodV> { ... }
fn apply_edge(&self, e: Self::DomE) -> Option<Self::CodE> { ... }
fn is_vertex_assigned(&self, v: &Self::DomV) -> bool { ... }
fn is_edge_assigned(&self, e: &Self::DomE) -> bool { ... }
}
Expand description
A mapping between graphs.
Just as a Mapping
is the data of a function without specified domain or
codomain sets, a graph mapping is the data of a graph homomorphism without
specified domain or codomain graphs. Turning this around, a graph morphism is
a pair of graphs with a compatible graph mapping.
The data of a graph mapping is a pair of mappings, one on vertices and the other
edges. Use a ColumnarGraphMapping
to supply this data directly.
Required Associated Types§
Required Methods§
Sourcefn vertex_map(&self) -> &Self::VertexMap
fn vertex_map(&self) -> &Self::VertexMap
Gets the underlying mapping on vertices.
Provided Methods§
Sourcefn apply_vertex(&self, v: Self::DomV) -> Option<Self::CodV>
fn apply_vertex(&self, v: Self::DomV) -> Option<Self::CodV>
Applies the graph mapping at a vertex.
Sourcefn apply_edge(&self, e: Self::DomE) -> Option<Self::CodE>
fn apply_edge(&self, e: Self::DomE) -> Option<Self::CodE>
Applies the graph mapping at an edge.
Sourcefn is_vertex_assigned(&self, v: &Self::DomV) -> bool
fn is_vertex_assigned(&self, v: &Self::DomV) -> bool
Is the mapping defined at a vertex?
Sourcefn is_edge_assigned(&self, e: &Self::DomE) -> bool
fn is_edge_assigned(&self, e: &Self::DomE) -> bool
Is the mapping defined at an edge?