<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>structify_net.scoring.modularity &mdash; structify_net 2 documentation</title>
      <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
      <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script src="../_static/jquery.js"></script>
        <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/sphinx_highlight.js"></script>
    <script src="../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="structify_net.scoring.degree_heterogeneity" href="structify_net.scoring.degree_heterogeneity.html" />
    <link rel="prev" title="structify_net.scoring.average_shortest_path_length" href="structify_net.scoring.average_shortest_path_length.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../index.html" class="icon icon-home">
            structify_net
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../index.html">Welcome to Structify_net’s documentation!</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Tutorial/Tutorial.html">Introduction to Structify_Net</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Classes.html">Classes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Zoo.html">Structure Zoo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Visualization.html">Visualization</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../Scoring.html">Scoring</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="../Scoring.html#individual-scoring-functions">Individual scoring functions</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="structify_net.scoring.has_giant_component.html">structify_net.scoring.has_giant_component</a></li>
<li class="toctree-l3"><a class="reference internal" href="structify_net.scoring.giant_component_ratio.html">structify_net.scoring.giant_component_ratio</a></li>
<li class="toctree-l3"><a class="reference internal" href="structify_net.scoring.transitivity.html">structify_net.scoring.transitivity</a></li>
<li class="toctree-l3"><a class="reference internal" href="structify_net.scoring.average_clustering.html">structify_net.scoring.average_clustering</a></li>
<li class="toctree-l3"><a class="reference internal" href="structify_net.scoring.average_shortest_path_length.html">structify_net.scoring.average_shortest_path_length</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">structify_net.scoring.modularity</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#structify_net.scoring.modularity"><code class="docutils literal notranslate"><span class="pre">modularity()</span></code></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="structify_net.scoring.degree_heterogeneity.html">structify_net.scoring.degree_heterogeneity</a></li>
<li class="toctree-l3"><a class="reference internal" href="structify_net.scoring.is_degree_heterogeneous.html">structify_net.scoring.is_degree_heterogeneous</a></li>
<li class="toctree-l3"><a class="reference internal" href="structify_net.scoring.robustness.html">structify_net.scoring.robustness</a></li>
<li class="toctree-l3"><a class="reference internal" href="structify_net.scoring.degree_assortativity.html">structify_net.scoring.degree_assortativity</a></li>
<li class="toctree-l3"><a class="reference internal" href="structify_net.scoring.hierarchy.html">structify_net.scoring.hierarchy</a></li>
<li class="toctree-l3"><a class="reference internal" href="structify_net.scoring.boundaries.html">structify_net.scoring.boundaries</a></li>
<li class="toctree-l3"><a class="reference internal" href="structify_net.scoring.coreness.html">structify_net.scoring.coreness</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../Scoring.html#useful-functions">Useful functions</a></li>
</ul>
</li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">structify_net</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../Scoring.html">Scoring</a></li>
      <li class="breadcrumb-item active">structify_net.scoring.modularity</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../_sources/generated/structify_net.scoring.modularity.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="structify-net-scoring-modularity">
<h1>structify_net.scoring.modularity<a class="headerlink" href="#structify-net-scoring-modularity" title="Permalink to this heading"></a></h1>
<dl class="py function">
<dt class="sig sig-object py" id="structify_net.scoring.modularity">
<span class="sig-prename descclassname"><span class="pre">structify_net.scoring.</span></span><span class="sig-name descname"><span class="pre">modularity</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">graph</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">normalized</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#structify_net.scoring.modularity" title="Permalink to this definition"></a></dt>
<dd><p>Returns the modularity of the graph</p>
<p>If normalized=True, it is computed as the difference between the modularity of the partition of highest modularity found by Louvain algorithm on this graph and the modularity of a random graph with the same number of nodes and edges, divided by the difference between the modularity of the random graph and the maximum possible modularity (1). If normalized is false, it simply returns the modularity of the graph.</p>
<dl class="simple">
<dt>Args:</dt><dd><p>graph (_type_): a graph
normalized (bool, optional): if True, returns a normalized modularity. Defaults to True.</p>
</dd>
<dt>Returns:</dt><dd><p>_type_: The modularity of the graph</p>
</dd>
</dl>
</dd></dl>

</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="structify_net.scoring.average_shortest_path_length.html" class="btn btn-neutral float-left" title="structify_net.scoring.average_shortest_path_length" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="structify_net.scoring.degree_heterogeneity.html" class="btn btn-neutral float-right" title="structify_net.scoring.degree_heterogeneity" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2023, Rémy Cazabet.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>