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 and leftLimit = 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 if not e.

edge

(Read-only) The hyperedge to calculate vertex maps for.

Type:

DG.HyperEdge

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:

UnionGraph

__iter__()
Returns:

an iterator over the vertex maps, see __getitem__() for the specific type.

size

(Read-only) The number of vertex maps calculated.

Type:

int

__len__()
Returns:

size

Return type:

int

__getitem__(i)
Parameters:

i (int) – the index of the map to retrieve.

Returns:

the ith vertex map.

Return type:

Result

Raises:

LogicError if i is out of range.

class DGVertexMapper.Result

The value type returned for each vertex map. the rule used to generate the map, and then the actual map.

rule

The rule used to generate the map.

Type:

Rule

map

The actual vertex map \(V(G) \rightarrow V(H)\).

Type:

VertexMapUnionGraphUnionGraph