hiperwalk.Multigraph#
- class hiperwalk.Multigraph(adj_matrix, copy=False)[source]#
Constructs an arbitrary multigraph.
- Parameters:
- adj_matrix
The adjacency matrix of the graph (any integer Hermitian matrix). Two input types are accepted:
- Any matrix – for instance,
list of lists.
networkx.Graph
.The adjacency matrix is extracted from the graph.
- copybool, default=False
If
True
, a hard copy ofadj_matrix
is stored.
- Raises:
- TypeError
If
adj_matrix
is not a square matrix.
Notes
The
adj_matrix.data
attribute is changed for more efficient manipulation. If the original matrix is needed, invoke the constructor withcopy=True
or calladjacency_matrix()
after creating the multigraph.Methods
Return the graph's adjacency matrix.
adjacent
(u, v)Return True if vertex
u
is adjacent tov
.degree
(vertex)Return the degree of the given vertex.
Return True if instance of simple graph.
Return the graph's Laplacian matrix.
neighbors
(vertex)Return all neighbors of the given vertex.
number_of_edges
([u, v])Return number of edges.
Return the number of loops in the graph.
Determine the cardinality of the vertex set.
vertex_number
(vertex)Return the vertex number given any vertex representation.