1.4. MapperGraph class
This is the mapper graph class which is inherited from the Reeb graph class. The main differences are
The Mapper graph is a graph with a function, but all function values are stored as integers. There is also a stored
delta
value which is can be used for scaling, so that all function values can be thought of asdelta * f(v)
.All edges have adjacent integer values. This equivalently means that no integer has a point in the interior of an edge in its inverse image.
Note that this class can be imported as:
import cereeberus
R = cereeberus.MapperGraph()
- class cereeberus.reeb.mapper.MapperGraph(G=None, f={}, delta=None, seed=None, verbose=False)[source]
A mapper graph structure. This inherits the properties of the Reeb graph in that it is a graph with a function given on the vertices, but with some additional requirements.
The values are integers in some range, [n_low, n_low+1, cdots, n_high], although we consider the funciton values to be [delta * n_low, delta* (n_low+1), cdots, delta * n_high] for a stored delta
If an edge crosses a value, it has a vertex (so that the inverse image of any integer is only vertices, not interiors of edges)
An internal delta is stored so that this can be interpreted as function values [delta * n_low, delta* (n_low+1), cdots, delta * n_high]
- __init__(G=None, f={}, delta=None, seed=None, verbose=False)[source]
Initializes a Reeb graph object.
- Parameters:
G – nx.graph, optional. If not None, a graph to initialize the Reeb graph.
f – dict, optional. If not an empty dictionary, a dictionary of function values associated with the graph nodes.
seed – int, optional. If not None, a seed to pass to the spring layout.
verbose – bool, optional. If True, will print out additional information during initialization.
- add_edge(u, v, reset_pos=True)[source]
Add an edge to the graph. This will also update the internal structure to make sure it satisfies the mapper properties.
- mapperify()[source]
Take the internal structure and make sure it satisfies the requirement that all edges have adjacent function values.
- add_node(vertex, f_vertex, reset_pos=True)[source]
Same as adding a node in Reeb, but with the additional requirement that the function value is an integer.