Trait GraphMapping

Source
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§

Source

type DomV: Eq + Clone

Type of vertices in domain graph.

Source

type DomE: Eq + Clone

Type of edges in domain graph.

Source

type CodV: Eq + Clone

Type of vertices in codomain graph.

Source

type CodE: Eq + Clone

Type of edges in codomain graph.

Source

type VertexMap: Mapping<Dom = Self::DomV, Cod = Self::CodV>

Type of underlying mapping on vertices.

Source

type EdgeMap: Mapping<Dom = Self::DomE, Cod = Self::CodE>

Type of underlying mapping on edges.

Required Methods§

Source

fn vertex_map(&self) -> &Self::VertexMap

Gets the underlying mapping on vertices.

Source

fn edge_map(&self) -> &Self::EdgeMap

Gets the underlying mapping on edges.

Provided Methods§

Source

fn apply_vertex(&self, v: Self::DomV) -> Option<Self::CodV>

Applies the graph mapping at a vertex.

Source

fn apply_edge(&self, e: Self::DomE) -> Option<Self::CodE>

Applies the graph mapping at an edge.

Source

fn is_vertex_assigned(&self, v: &Self::DomV) -> bool

Is the mapping defined at a vertex?

Source

fn is_edge_assigned(&self, e: &Self::DomE) -> bool

Is the mapping defined at an edge?

Implementors§

Source§

impl<ObGenMap, MorGenMap> GraphMapping for FpFunctorData<ObGenMap, MorGenMap>
where ObGenMap: Mapping, MorGenMap: Mapping,

Source§

type DomV = <ObGenMap as Mapping>::Dom

Source§

type DomE = <MorGenMap as Mapping>::Dom

Source§

type CodV = <ObGenMap as Mapping>::Cod

Source§

type CodE = <MorGenMap as Mapping>::Cod

Source§

type VertexMap = ObGenMap

Source§

type EdgeMap = MorGenMap

Source§

impl<VMap, EMap> GraphMapping for ColumnarGraphMapping<VMap, EMap>
where VMap: Mapping, EMap: Mapping,

Source§

type DomV = <VMap as Mapping>::Dom

Source§

type DomE = <EMap as Mapping>::Dom

Source§

type CodV = <VMap as Mapping>::Cod

Source§

type CodE = <EMap as Mapping>::Cod

Source§

type VertexMap = VMap

Source§

type EdgeMap = EMap