Skip to content

Commit

Permalink
add references
Browse files Browse the repository at this point in the history
  • Loading branch information
nwlandry committed Sep 8, 2024
1 parent b875fa6 commit 49e6977
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 1 deletion.
26 changes: 25 additions & 1 deletion xgi/algorithms/simpliciality.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ def edit_simpliciality(H, min_size=2, exclude_min_size=True):
-------
float
The edit simpliciality
References
----------
"The simpliciality of higher-order order networks"
by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier,
*EPJ Data Science* **13**, 17 (2024).
"""
edges = H.edges.filterby("size", min_size, "geq").members()

Expand Down Expand Up @@ -100,6 +106,12 @@ def simplicial_edit_distance(H, min_size=2, exclude_min_size=True, normalize=Tru
-------
float
The edit simpliciality
References
----------
"The simpliciality of higher-order order networks"
by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier,
*EPJ Data Science* **13**, 17 (2024).
"""
edges = H.edges.filterby("size", min_size, "geq").members()

Expand Down Expand Up @@ -165,6 +177,12 @@ def face_edit_simpliciality(H, min_size=2, exclude_min_size=True):
-------
float
The face edit simpliciality
References
----------
"The simpliciality of higher-order order networks"
by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier,
*EPJ Data Science* **13**, 17 (2024).
"""
edges = (
H.edges.maximal().filterby("size", min_size + exclude_min_size, "geq").members()
Expand Down Expand Up @@ -210,7 +228,7 @@ def mean_face_edit_distance(H, min_size=2, exclude_min_size=True, normalize=True
----------
"The simpliciality of higher-order order networks"
by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier,
*EPJ Data Science* **13**, 17 (2024)
*EPJ Data Science* **13**, 17 (2024).
"""
t = Trie()
t.build_trie(H.edges.filterby("size", min_size, "geq").members())
Expand Down Expand Up @@ -248,6 +266,12 @@ def simplicial_fraction(H, min_size=2, exclude_min_size=True):
-------
float
The simplicial fraction
References
----------
"The simpliciality of higher-order order networks"
by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier,
*EPJ Data Science* **13**, 17 (2024).
"""
try:
ns = _count_simplices(H, min_size, exclude_min_size)
Expand Down
75 changes: 75 additions & 0 deletions xgi/stats/nodestats.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,31 @@ def katz_centrality(net, bunch, cutoff=100):


def local_simplicial_fraction(net, bunch, min_size=2, exclude_min_size=True):
"""The local simplicial fraction.
Parameters
----------
net : xgi.Hypergraph
The network.
bunch : Iterable
Nodes in `net`.
min_size: int, default: 2
The minimum hyperedge size to include when
calculating whether a hyperedge is a simplex
by counting subfaces.
exclude_min_size : bool, optional
Whether to include minimal simplices when counting simplices, by default True
Returns
-------
dict
References
----------
"The simpliciality of higher-order order networks"
by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier,
*EPJ Data Science* **13**, 17 (2024).
"""
s = dict()
for n in bunch:
nbrs = net.nodes.neighbors(n)
Expand All @@ -509,6 +534,31 @@ def local_simplicial_fraction(net, bunch, min_size=2, exclude_min_size=True):


def local_edit_simpliciality(net, bunch, min_size=2, exclude_min_size=True):
"""The local edit simpliciality.
Parameters
----------
net : xgi.Hypergraph
The network.
bunch : Iterable
Nodes in `net`.
min_size: int, default: 2
The minimum hyperedge size to include when
calculating whether a hyperedge is a simplex
by counting subfaces.
exclude_min_size : bool, optional
Whether to include minimal simplices when counting simplices, by default True
Returns
-------
dict
References
----------
"The simpliciality of higher-order order networks"
by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier,
*EPJ Data Science* **13**, 17 (2024).
"""
s = dict()
for n in bunch:
nbrs = net.nodes.neighbors(n)
Expand All @@ -522,6 +572,31 @@ def local_edit_simpliciality(net, bunch, min_size=2, exclude_min_size=True):


def local_face_edit_simpliciality(net, bunch, min_size=2, exclude_min_size=True):
"""The local face edit simpliciality.
Parameters
----------
net : xgi.Hypergraph
The network.
bunch : Iterable
Nodes in `net`.
min_size: int, default: 2
The minimum hyperedge size to include when
calculating whether a hyperedge is a simplex
by counting subfaces.
exclude_min_size : bool, optional
Whether to include minimal simplices when counting simplices, by default True
Returns
-------
dict
References
----------
"The simpliciality of higher-order order networks"
by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier,
*EPJ Data Science* **13**, 17 (2024).
"""
s = dict()
for n in bunch:
nbrs = net.nodes.neighbors(n)
Expand Down

0 comments on commit 49e6977

Please sign in to comment.