s-walks: how strongly are hyperedges connected?#

Two hyperedges are \(s\)-adjacent if they share at least \(s\) vertices. As \(s\) grows, the \(s\)-line graph thins out and only strongly overlapping groups remain connected. The s-profile of hatvis shows the \(s\)-connected component of every activity of the wire harness space for \(s=1,\dots,4\), and the vertex \(s\)-line graphs show the resources that share at least one or two activities.

import matplotlib.pyplot as plt

import hatvis as hv
from hatvis.plotting import plot_s_profile, plot_s_walks

H = hv.datasets.load_wire_harness()
# [snippet:profile]
print(hv.s_component_profile(H, s_values=range(1, 5)))
print(hv.s_component_profile(H, s_values=range(1, 5), edges=False))
# [/snippet:profile]
   elements  components  largest  diameter of largest  links
s
1        70           1       70                    2   1031
2        70           4       24                    3    253
3        56          17       12                    1    143
4        40          29        4                    1     14
   elements  components  largest  diameter of largest  links
s
1        31           1       31                    3    141
2        29           1       29                    4     73
3        28           1       28                    5     47
4        28           1       28                    5     35
fig, ax = plt.subplots(figsize=(5, 11))
plot_s_profile(H, s_values=range(1, 5), ax=ax, labels=True)
plt.tight_layout()
s-connected components
plot_s_walks(H, s_values=(1, 2))
plt.gcf().set_size_inches(13, 5.5)
plt.tight_layout()
s = 1, s = 2

Total running time of the script: (0 minutes 0.538 seconds)

Gallery generated by Sphinx-Gallery