Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find the volumes of successively larger neighborhoods around nodes in a hypergraph
| ResourceFunction["HypergraphNeighborhoodVolumes"][graph] finds the count of neighbors within successive distances for each vertex in graph. | |
| ResourceFunction["HypergraphNeighborhoodVolumes"][graph,{v1,v2,…}] finds the counts for the vertices vi. | |
| ResourceFunction["HypergraphNeighborhoodVolumes"][graph,All,r] finds counts from all vertices out to maximum radius r. | |
| ResourceFunction["HypergraphNeighborhoodVolumes"][graph,{v1,v2,…},Automatic] finds counts only out to the minimum radius for any of the vertices vi. | |
| ResourceFunction["HypergraphNeighborhoodVolumes"][graph,"Random"→n,…] finds counts for n randomly chosen vertices. | 
Neighbor counts for each vertex of a hypergraph:
| In[1]:= | ![ResourceFunction[
 "HypergraphNeighborhoodVolumes"][{{1, 3, 2}, {2, 1, 3}}]](https://www.wolframcloud.com/obj/resourcesystem/images/97e/97e81c0e-db91-4d08-9b54-b9de4dacc8b2/688c7a300f841d71.png)  | 
| Out[1]= |   | 
Count neighbors for each vertex:
| In[2]:= | ![ResourceFunction[
 "HypergraphNeighborhoodVolumes"][{{1, 4, 2}, {1, 5, 4}, {5, 2, 4}, {1, 6, 3}, {2, 7, 6}, {7, 3, 6}, {3, 8, 1}, {2, 9, 8}, {9, 1, 8}}]](https://www.wolframcloud.com/obj/resourcesystem/images/97e/97e81c0e-db91-4d08-9b54-b9de4dacc8b2/07b0e9bbf1c98d5a.png)  | 
| Out[2]= |   | 
Count neighbors for a subset of vertices:
| In[3]:= | ![ResourceFunction[
 "HypergraphNeighborhoodVolumes"][{{1, 4, 2}, {1, 5, 4}, {5, 2, 4}, {1, 6, 3}, {2, 7, 6}, {7, 3, 6}, {3, 8, 1}, {2, 9, 8}, {9, 1, 8}}, {3, 5, 9}]](https://www.wolframcloud.com/obj/resourcesystem/images/97e/97e81c0e-db91-4d08-9b54-b9de4dacc8b2/6c535c2873b5d953.png)  | 
| Out[3]= |   | 
Count neighbors for a random sampling of vertices:
| In[4]:= | ![ResourceFunction[
 "HypergraphNeighborhoodVolumes"][{{1, 4, 2}, {1, 5, 4}, {5, 2, 4}, {1, 6, 3}, {2, 7, 6}, {7, 3, 6}, {3, 8, 1}, {2, 9, 8}, {9, 1, 8}}, "Random" -> 2]](https://www.wolframcloud.com/obj/resourcesystem/images/97e/97e81c0e-db91-4d08-9b54-b9de4dacc8b2/4a5388b26ba84328.png)  | 
| Out[4]= |   | 
This work is licensed under a Creative Commons Attribution 4.0 International License