Python package for Random and Dynamical Hypergraph Computation
- mandatory:
random
,itertools
,numpy
- optional:
networkx
,hypernetx
,xgi
HyperRD.Hgraph
: store allclass
objectsHgraph.Create
: undirected hypergraph object, including the following features and methods:- Features:
vertices
: python set of verticesvertices_dict
: python dictionary of verticesvertices_weight
: python list of vertex weights (still developed)edges
: python set of hyperedgesedges_dict
: python dictionary of hyperedgesedges_weight
: python list of hyperedge weights (still developed)inci_matrix
: numpy matrix of an incidence matrix representation
- Methods:
add_vertex()
: add a vertexadd_edge()
: add a hyperedgedict_of_vertices()
: return vertices in terms of an encoded dictionarydict_of_edges()
: return hyperedges in terms of an encoded dictionarydegree_vertex()
: return a degree of a vertexdegree_edge()
: return a degree of a hyperedgediag_vertex()
: return a numpy diagonal matrix of vertex degreesdiag_edge()
: return a numpy diagonal matrix of hyperedge degreesremove_vertex()
: remove a vertexremove_edge()
: remove a hyperedgeincidence_matrix()
: calculate an incidence matrix and store this matrix ininci_matrix
copy()
: make a copy of graph
- Features:
Hgraph.Create_Normal
: undirected normal graph object, including the following features and methods:- Features:
vertices
: number of verticesadj
: adjacency list of graph
- Methods:
add_edge()
: add edgedfs_utility()
: depth-first search algorithm to traverse the graphconnected_components()
: return a list of connected componentscopy()
: make a copy of graph
- Features:
Hgraph.Create_Direct
: directed hypergraph object (inherit class of Create), including the following features and methods:- Features:
edges_direct
: set of directed hyperedges, in form[start, end]
, wherestart
andend
are subsets of vertex set
- Methods:
add_edge_direct()
: add a directed hyperedge
- Features:
Hgraph.Multilayer
: multilayer hypergraph object, including the following features and methods:- Features:
layers
: list of hypergraphsinterlink
: set of interlinking hyperedge
- Methods:
add_graph()
: add layeradd_interlink()
: add interlinking hyperedgenumber_of_layer
: return number of layers
- Features:
HyperRD.Halgorithm
: tools to analyze hypergraphsvertex_connected()
: check if two vertices are connectedgraph_connected()
: check if a hypergraph is fully connectedcomponents_connected()
: return a list of connected components in the hypergraphsimple_reduction()
: reduce hypergraph to simple hypergraph (has no repeated hyperedge)graph_expansion()
: expand a hypergraph to a normal graph, based on chapter 2 of this book Hypergraph Computationmode == 'clique'
: clique expansionmode == 'star'
: star expansion or birpartite equivalencemode == 'line'
: line expansion (still developed)
HyperRD.Hmetric
: metrics on hypergraphsdensity()
: return the density of hypergraphgirth()
: return the size of the smallest non-empty hyperedge in the hypergraphaverage_vertex_degree()
: return the average degree across all vertices in the hypergraphaverage_edge_size()
: return the average size across all edges in the hypergraph
HyperRD.Hrandom
: generate random hypergraphssimple_matrix()
: each element of an incidence matrix will be set value 1 randomly with probability p (uniform distribution)simple_bipartite()
: create a random hypergraph with probability p (uniform distribution)simple_powersets()
: create a random hypergraph with probability p, based on the random choice of all possible edges (power set of vertices) (uniform distribution)simple_order()
: similar tosimple_powersets()
, but the degree of each hyperedge has a bound (the cardinality of the hyperedge is less than a fixed integer) (uniform distribution)k_uniform()
: create a k-uniform hypergraph with probability p (uniform distribution)
HyperRD.Hdynamic
: analyze stochastic processes on hypergraphtransit_prob_matrix()
: return a uniform transition probability matrix of hypergraph (simple random walk)
HyperRD.Htranslate
: change to other platforms (check the optional section of library requirement)