Graphs#
Classes#
There are three classes of graph.
Constructs an arbitrary simple graph with loops. |
|
Constructs an arbitrary multigraph. |
|
Constructs an arbitrary weighted graph. |
hiperwalk.Multigraph is used as input for the
hiperwalk.Coined quantum walk model.
hiperwalk.WeightedGraph is used as input for the
hiperwalk.ContinuousTime quantum walk model.
hiperwalk.Graph is used as input for
both quantum walk models.
Graph Constructors#
The graph constructors [1] return an instance of commonly used graphs.
The graph constructors are used to change the default behavior of specific graphs. For instance, the order of the neighbors changes depending on the graph.
Every constructor has the following template:
>>> GraphConstructor(args, multiedges=None, weights=None)
where multiedges and weights are optional arguments
whose default value is None.
Every graph constructor returns an instance of
hiperwalk.Graphifmultiedges is Noneandweights is None.hiperwalk.Multigraphifmultiedges is not Noneandweights is None.hiperwalk.WeightedGraphifmultiedges is Noneandweights is not None.
Both multiedges and weights are expected to be
instances of scipy.sparse.csr_array such that
multiedges[u, v]is the number of edges incident to both verticesuandv.weights[u, v]is the weight of the edge incident to both verticesuandv.
If multiedges is not None and weights is not None,
a ValueError exception
is raised.
List of Graph Constructors#
The following is the list of all available graph constructors.