Graphs#

Classes#

There are three classes of graph.

Graph

Constructs an arbitrary simple graph with loops.

Multigraph

Constructs an arbitrary multigraph.

WeightedGraph

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

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 vertices u and v.

  • weights[u, v] is the weight of the edge incident to both vertices u and v.

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.