4.1.8.6. dg/VertexMapper¶
- class mod.DGVertexMapper¶
A class for enumerating all valid vertex maps for a given
DG.HyperEdge
. That is, for such a hyperedge, collect the graphs associated with respectively the source and target vertices, and create the disjoint union of those graphs. Let the result be the graphs \(G'\) and \(H'\). Then each rule \(p = (L\leftarrow K\rightarrow R)\) associated with the hyperedge, generate direct derivations \(G\overset{p, m}{\Rightarrow} H\) where \(G\) is isomorphic to \(G'\) and \(H\) is isomorphic to \(H'\).Each recorded vertex map is a map \(V(G) \rightarrow V(H)\). Those maps are available in this class.
- __init__(e, upToIsomorphismG=True, leftLimit=1, rightLimit=2**30)¶
Construct a vertex map holder. It will immediately calculate all vertex maps for the derivations underlying the given hyperedge. By default all maps \(V(G) \rightarrow V(H)\) are enumerated. To only enumerate a singular vertex map per rule, use
upToIsomorphismG = True
andleftLimit = rightLimit = 1
.- Parameters:
e (DG.HyperEdge) – the hyperedge to construct vertex maps for.
upToIsomrophismG (bool) – whether to enumerate all \(m\), or just those such that all bottom spans \((G\leftarrow D\rightarrow H)\) up to isomorphism are generated.
leftLimit (int) – after bottom span generation, find this many isomorphisms back to the sources of the hyperedge.
rightLimit (int) – after bottom span generation, find this many isomorphisms back to the targets of the hyperedge.
- Raises:
LogicError
ifnot e
.
- edge¶
(Read-only) The hyperedge to calculate vertex maps for.
- Type:
- left¶
- right¶
- Returns:
the disjoint union of graphs from respectively the source and target vertices of the hyperedge. That is, the graphs \(G\) and \(H\) that are the domain and codomain graphs of the calculated vertex maps.
- Type:
- __iter__()¶
- Returns:
an iterator over the vertex maps, see
__getitem__()
for the specific type.
- __getitem__(i)¶
- Parameters:
i (int) – the index of the map to retrieve.
- Returns:
the
i
th vertex map.- Return type:
- Raises:
LogicError
ifi
is out of range.