.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/05_structure/plot_17_s_walks.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_05_structure_plot_17_s_walks.py: s-walks: how strongly are hyperedges connected? =============================================== Two hyperedges are :math:`s`-adjacent if they share at least :math:`s` vertices. As :math:`s` grows, the :math:`s`-line graph thins out and only strongly overlapping groups remain connected. The *s-profile* of hatvis shows the :math:`s`-connected component of every activity of the wire harness space for :math:`s=1,\dots,4`, and the vertex :math:`s`-line graphs show the resources that share at least one or two activities. .. GENERATED FROM PYTHON SOURCE LINES 14-25 .. code-block:: Python 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] .. rst-class:: sphx-glr-script-out .. code-block:: none 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 .. GENERATED FROM PYTHON SOURCE LINES 26-30 .. code-block:: Python fig, ax = plt.subplots(figsize=(5, 11)) plot_s_profile(H, s_values=range(1, 5), ax=ax, labels=True) plt.tight_layout() .. image-sg:: /auto_examples/05_structure/images/sphx_glr_plot_17_s_walks_001.png :alt: s-connected components :srcset: /auto_examples/05_structure/images/sphx_glr_plot_17_s_walks_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 31-34 .. code-block:: Python plot_s_walks(H, s_values=(1, 2)) plt.gcf().set_size_inches(13, 5.5) plt.tight_layout() .. image-sg:: /auto_examples/05_structure/images/sphx_glr_plot_17_s_walks_002.png :alt: s = 1, s = 2 :srcset: /auto_examples/05_structure/images/sphx_glr_plot_17_s_walks_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.538 seconds) .. _sphx_glr_download_auto_examples_05_structure_plot_17_s_walks.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/ComplexSystemsIntelligence/hatvis/main?urlpath=lab/tree/notebooks/auto_examples/05_structure/plot_17_s_walks.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_17_s_walks.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_17_s_walks.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_17_s_walks.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_