.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/05_structure/plot_18_wire_harness_centrality.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_18_wire_harness_centrality.py: Critical elements of the manufacturing space ============================================ Nagy et al. (2022) ranked the elements of the intelligent collaborative manufacturing space by the :math:`s`-betweenness and :math:`s`-closeness of the vertices, averaged over several :math:`s`. The same analysis on the reconstructed benchmark identifies the sensors and the crimping competence as the most central elements, and shows how the ranking changes from :math:`s=1` to :math:`s=2`. .. GENERATED FROM PYTHON SOURCE LINES 14-29 .. code-block:: Python import matplotlib.pyplot as plt import hatvis as hv from hatvis.plotting import plot_ranking H = hv.datasets.load_wire_harness() # [snippet:table] table = hv.s_centrality_table(H, s_values=(1, 2, 3), edges=False) avg_bc = hv.average_s_centrality(H, hv.s_betweenness, s_max=3, edges=False) avg_hc = hv.average_s_centrality(H, hv.s_harmonic_closeness, s_max=3, edges=False) # [/snippet:table] print(table.sort_values("BC s=1", ascending=False).head(8).round(3)) print("rank of C7 by BC: s=1 ->", int(table["BC s=1"].rank(ascending=False)["C7"]), " s=2 ->", int(table["BC s=2"].rank(ascending=False)["C7"])) .. rst-class:: sphx-glr-script-out .. code-block:: none BC s=1 HCC s=1 BC s=2 HCC s=2 BC s=3 HCC s=3 S3 0.185 0.844 0.167 0.607 0.074 0.432 S2 0.177 0.867 0.395 0.738 0.542 0.753 O4 0.050 0.717 0.020 0.542 0.014 0.515 O7 0.050 0.717 0.020 0.542 0.014 0.515 O3 0.042 0.717 0.020 0.542 0.014 0.515 O6 0.042 0.717 0.020 0.542 0.014 0.515 AGV 0.036 0.700 0.031 0.524 0.046 0.534 C6 0.030 0.694 0.000 0.390 0.000 0.311 rank of C7 by BC: s=1 -> 11 s=2 -> 2 .. GENERATED FROM PYTHON SOURCE LINES 30-36 .. code-block:: Python fig, axes = plt.subplots(1, 3, figsize=(14, 4.6)) plot_ranking(table["BC s=1"], top=10, ax=axes[0], title="s-betweenness, s = 1") plot_ranking(table["BC s=2"], top=10, ax=axes[1], title="s-betweenness, s = 2", color=hv.plotting.PALETTE[1]) plot_ranking(avg_hc, top=10, ax=axes[2], title="harmonic s-closeness, mean over s = 1..3", color=hv.plotting.PALETTE[2]) plt.tight_layout() .. image-sg:: /auto_examples/05_structure/images/sphx_glr_plot_18_wire_harness_centrality_001.png :alt: s-betweenness, s = 1, s-betweenness, s = 2, harmonic s-closeness, mean over s = 1..3 :srcset: /auto_examples/05_structure/images/sphx_glr_plot_18_wire_harness_centrality_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.338 seconds) .. _sphx_glr_download_auto_examples_05_structure_plot_18_wire_harness_centrality.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_18_wire_harness_centrality.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_18_wire_harness_centrality.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_18_wire_harness_centrality.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_18_wire_harness_centrality.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_