HCBE
HCBE.UnionFind
HCBE.edge
HCBE.edge_comp
HCBE.epart2cluster
HCBE.h2txt
HCBE.my_mod
HCBE.partition
HCBE.s_HCBE
HCBE.star_expansion
HCBE.UnionFind
— TypeUnionFind{T <: Integer}
Deprecated!! In the future, using DataStructures.jl's DisjointSet.
HCBE.edge
— Typeedge
Edge of bipartite graph with star expansion of a hypergraph.
Arguments
- from : Vertex number that the edge connects to. It is a number representing a vertex of the hypergraph.
- to : Vertex number that the edge connects to. It is a number representing a hyperedge of the hypergraph.
- weight : Edge weight.
- id : The number of edges that this structure represents.
HCBE.edge_comp
— Methodedge_comp(a::edge, b::edge)
Edge comparison function. Sort in descending order of weight. If the weights are the same, they are compared according to the IDs of the edges.
HCBE.epart2cluster
— Methodepart2cluster(h::Hypergraph, epart::Array{Set{Int}})
HCBE.h2txt
— Methodh2txt(h::Hypergraph, fname::AbstractString)
Translate hypergraph to text file. This is in the following form.
N M
N is number of hypergraph vertices. M is number of hypereedges.
HCBE.my_mod
— Methodmy_mod(h::Hypergraph, part::Array{Set{any}})
Computes the modularity when h
is divided by part
.
HCBE.partition
— Functionpartition(uf::UnionFind{Int}, to::Int=length(uf.parent), from::Int=1, )::Vector{Set{Int}}
Compute the clustering result from the disjoint set.
Arguments
- uf : The disjoint set obtained by clustering.
- to : Disjoint sets up to
to
are used. For example, if you want to get a vertex-only clustering result,
specify the number of vertices.
- from : Use a disjoint set from
from
.
HCBE.s_HCBE
— MethodsHCBE(h::Hypergraph, ncluster::Int=1, modularityf=modularity, weightf::Function=tfidf, freq::Int=Inf)
Clustering the vertices of the h
using soft-Hypergraph Clustering based on Bipartite Expansion.
Arguments
- h : Clustered hypergraph.
- ncluster : When the number of clusters reaches `ncluster`, the clustering process is terminated.
- modularity_f : Modularity function.
- weighted_f : Bipartite graph edge weighting function.
- freq : Once every
freq
times, the modularity is calculated.
HCBE.star_expansion
— Functionstarexpansion(h::Hypergraph, weightedf::Function=tfidf, param=Dict())
Star expandion h
and construct a bipartite graph. Each edge is weighted by weighted_f
.