{
  "id": "task_libraries:graph/python",
  "path": "/exapedia/python-graph-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python graph libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python graph libraries store networks of nodes and edges and run algorithms such as shortest paths, centrality, and community detection on them. A compiled library stores the graph in native memory with integer node indices rather than as Python objects. These libraries let data scientists and AI agents analyze social networks, knowledge graphs, and dependency graphs."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python graph libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#networkx",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F152"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#rustworkx",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F168"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#igraph",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F184"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#leidenalg",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F200"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#python-louvain",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F218"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#networkit",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F236"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#networkx",
          "label": [
            {
              "t": "text",
              "text": "NetworkX"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F153"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Directed graph algorithms",
            "Parallel edges"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#networkx",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F152"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#rustworkx",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F168"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#igraph",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F184"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#leidenalg",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F200"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F210"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#python-louvain",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F218"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F229"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#networkit",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F236"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "networkx",
          "name": [
            {
              "t": "fact",
              "fact": "F152"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/networkx/networkx"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/networkx"
            },
            {
              "label": "Docs",
              "href": "https://networkx.org/documentation/stable/tutorial.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F13"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://networkx.org/documentation/stable/tutorial.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F152"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F21"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/GiulioRossetti/cdlib",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F166"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def girvan_newman(g_original: object, level: int) -> NodeClustering:\n    \"\"\"\n    The Girvan–Newman algorithm detects communities by progressively removing edges from the original graph.\n    The algorithm removes the \"most valuable\" edge, traditionally the edge with the highest betweenness centrality, at each step. As the graph breaks down into pieces, the tightly knit community structure is exposed and the result can be depicted as a dendrogram.\n\n\n    **Supported Graph Types**\n\n    ========== ======== ========\n    Undirected Directed Weighted\n    ========== ======== ========\n    Yes        No       No\n    ========== ======== ========\n\n    :param g_original: a networkx/igraph object\n    :param level: the level where to cut the dendrogram (-1 for highest modularity)\n    :return: NodeClustering object\n\n    :Example:\n\n    >>> from cdlib import algorithms\n    >>> import networkx as nx\n    >>> G = nx.karate_club_graph()\n    >>> com = algorithms.girvan_newman(G, level=3)\n\n    :References:\n\n    Girvan, Michelle, and Mark EJ Newman. `Community structure in social and biological networks. <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC122977/>`_ Proceedings of the national academy of sciences 99.12 (2002): 7821-7826.\n    \"\"\"\n\n    g = convert_graph_formats(g_original, nx.Graph)\n\n    gn_hierarchy = nx.algorithms.community.girvan_newman(g)\n    coms = []\n    if level==-1:\n        max_modularity = -float('inf')\n\n        for current_coms in gn_hierarchy:\n            mod = nx.algorithms.community.modularity(g, current_coms)\n            if mod > max_modularity:\n                max_modularity = mod\n                coms = current_coms\n    else:\n        for _ in range(level):\n            coms = next(gn_hierarchy)\n\n\n    communities = []\n\n    for c in coms:\n        communities.append(list(c))\n\n    return NodeClustering(\n        communities, g_original, \"Girvan Newman\", method_parameters={\"level\": level}\n    )\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/GiulioRossetti/cdlib/blob/cd3380b25633e544c4bfbba91c257fd033176fe1/cdlib/algorithms/crisp_partition.py#L165-L219",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F165"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20that%20use%20networkx&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F152"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import networkx as nx\nG = nx.Graph()\n\nG.add_node(1)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://networkx.org/documentation/stable/tutorial.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "tutorial.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F157"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "rustworkx",
          "name": [
            {
              "t": "fact",
              "fact": "F168"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/Qiskit/rustworkx"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/rustworkx"
            },
            {
              "label": "Docs",
              "href": "https://www.rustworkx.org/apiref/rustworkx.PyDiGraph.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F39"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://www.rustworkx.org/apiref/rustworkx.PyDiGraph.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F168"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F45"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/PennyLaneAI/pennylane",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F182"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _construct_graph_from_queue(queue, all_wires):\n    inds_for_objs = defaultdict(list)  # dict from wrappedobjs to all indices for the objs\n    nodes_on_wires = defaultdict(list)  # wire to list of nodes\n    mid_measure_nodes = {}  # MCMs to their corresponding nodes\n\n    graph = rx.PyDiGraph(multigraph=False)\n\n    for i, obj in enumerate(queue):\n        inds_for_objs[_WrappedObj(obj)].append(i)\n        obj_node = graph.add_node(i)\n        if isinstance(obj, (MidMeasure, PauliMeasure)):\n            mid_measure_nodes[obj] = obj_node\n        for w in _get_wires(obj, all_wires):\n            if w in nodes_on_wires:\n                graph.add_edge(nodes_on_wires[w][-1], obj_node, \"\")\n            nodes_on_wires[w].append(obj_node)\n        if isinstance(obj, Conditional):\n            for m in obj.meas_val.measurements:\n                if not graph.has_edge(mid_measure_nodes[m], obj_node):\n                    graph.add_edge(mid_measure_nodes[m], obj_node, \"\")\n\n    return graph, inds_for_objs, nodes_on_wires\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/PennyLaneAI/pennylane/blob/e39ecae2e0be64bb70e4c2e4ac9a41bb9c47dc8e/pennylane/circuit_graph.py#L82-L103",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F181"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20that%20use%20rustworkx&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F168"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import rustworkx as rx\n\nG = rx.PyGraph()\n\nG.add_node(1)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://www.rustworkx.org/tutorial/introduction.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "introduction.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F173"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "igraph",
          "name": [
            {
              "t": "fact",
              "fact": "F184"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/igraph/python-igraph"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/igraph"
            },
            {
              "label": "Docs",
              "href": "https://python.igraph.org/en/stable/tutorial.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F63"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://python.igraph.org/en/stable/tutorial.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F184"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F69"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/GiulioRossetti/cdlib",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F198"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def walktrap(g_original: object, weights: str = None) -> NodeClustering:\n    \"\"\"\n    walktrap is an approach based on random walks.\n    The general idea is that if you perform random walks on the graph, then the walks are more likely to stay within the same community because there are only a few edges that lead outside a given community. Walktrap runs short random walks and uses the results of these random walks to merge separate communities in a bottom-up manner.\n\n\n    **Supported Graph Types**\n\n    ========== ======== ========\n    Undirected Directed Weighted\n    ========== ======== ========\n    Yes        No       Yes\n    ========== ======== ========\n\n    :param g_original: a networkx/igraph object\n    :param weights: label used for the edge weights. Default, None.\n    :return: NodeClusterint object\n\n    :Example:\n\n    >>> from cdlib import algorithms\n    >>> import networkx as nx\n    >>> G = nx.karate_club_graph()\n    >>> coms = algorithms.walktrap(G)\n\n    :References:\n\n    Pons, Pascal, and Matthieu Latapy. `Computing communities in large networks using random walks. <http://jgaa.info/accepted/2006/PonsLatapy2006.10.2.pdf/>`_ J. Graph Algorithms Appl. 10.2 (2006): 191-218.\n    \"\"\"\n\n    if ig is None:\n        raise ModuleNotFoundError(\n            \"Optional dependency not satisfied: install igraph to use the selected feature.\"\n        )\n\n    g = convert_graph_formats(g_original, ig.Graph)\n    coms = g.community_walktrap(weights=weights).as_clustering()\n    communities = []\n\n    for c in coms:\n        communities.append([g.vs[x][\"name\"] for x in c])\n\n    return NodeClustering(\n        communities, g_original, \"Walktrap\", method_parameters={\"weights\": weights}\n    )\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/GiulioRossetti/cdlib/blob/cd3380b25633e544c4bfbba91c257fd033176fe1/cdlib/algorithms/crisp_partition.py#L1225-L1269",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F197"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20that%20use%20igraph&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F184"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import igraph as ig\ng = ig.Graph(n=10, edges=[[0, 1], [0, 5]])\nprint(g)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://python.igraph.org/en/stable/tutorial.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "tutorial.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F189"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "leidenalg",
          "name": [
            {
              "t": "fact",
              "fact": "F200"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/vtraag/leidenalg"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/leidenalg"
            },
            {
              "label": "Docs",
              "href": "https://leidenalg.readthedocs.io/en/stable/reference.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F207"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://leidenalg.readthedocs.io/en/stable/reference.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F200"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/GiulioRossetti/cdlib",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F216"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def CPM_Bipartite(\n    g_original: object,\n    resolution_parameter_01: float,\n    resolution_parameter_0: float = 0,\n    resolution_parameter_1: float = 0,\n    degree_as_node_size: bool = False,\n    seed: int = 0,\n) -> BiNodeClustering:\n    \"\"\"\n    CPM_Bipartite is the extension of CPM to bipartite graphs\n\n\n    **Supported Graph Types**\n\n    ========== ======== ======== =========\n    Undirected Directed Weighted Bipartite\n    ========== ======== ======== =========\n    Yes        No       No       Yes\n    ========== ======== ======== =========\n\n    :param g_original: a networkx/igraph object\n    :param resolution_parameter_01: Resolution parameter for in between two classes.\n    :param resolution_parameter_0: Resolution parameter for class 0.\n    :param resolution_parameter_1: Resolution parameter for class 1.\n    :param degree_as_node_size: If ``True`` use degree as node size instead of 1, to mimic modularity\n    :param seed: the random seed to be used in CPM method to keep results/partitions replicable\n    :return: BiNodeClustering object\n\n    :Example:\n\n    >>> from cdlib import algorithms\n    >>> import networkx as nx\n    >>> G = nx.algorithms.bipartite.generators.random_graph(100, 20, 0.5)\n    >>> coms = algorithms.CPM_Bipartite(G, 0.5)\n\n    :References:\n\n    Barber, M. J. (2007). Modularity and community detection in bipartite networks. Physical Review E, 76(6), 066102. 10.1103/PhysRevE.76.066102\n\n    .. note:: Reference implementation: https://leidenalg.readthedocs.io/en/stable/multiplex.html?highlight=bipartite#bipartite\n    \"\"\"\n    global leidenalg\n    if ig is None or leidenalg is None:\n        try:\n            import leidenalg\n        except ModuleNotFoundError:\n            raise ModuleNotFoundError(\n                \"Optional dependency not satisfied: install igraph and leidenalg to use the \"\n                \"selected feature.\"\n            )\n\n    g = convert_graph_formats(g_original, ig.Graph)\n\n    try:\n        g.vs[\"name\"]\n    except:\n        g.vs[\"name\"] = [v.index for v in g.vs]\n\n    seed = get_seed(seed)\n\n    optimiser = leidenalg.Optimiser()\n    leidenalg.Optimiser.set_rng_seed(self=optimiser, value=seed)\n\n    p_01, p_0, p_1 = leidenalg.CPMVertexPartition.Bipartite(\n        g,\n        resolution_parameter_01=resolution_parameter_01,\n        resolution_parameter_0=resolution_parameter_0,\n        resolution_parameter_1=resolution_parameter_1,\n        degree_as_node_size=degree_as_node_size,\n    )\n    optimiser.optimise_partition_multiplex([p_01, p_0, p_1], layer_weights=[1, -1, -1])\n\n    coms = defaultdict(list)\n    for n in g.vs:\n        coms[p_01.membership[n.index]].append(n.index)\n\n    return BiNodeClustering(\n        list(coms.values()),\n        [],\n        g_original,\n        \"CPM_Bipartite\",\n        method_parameters={\n            \"resolution_parameter_01\": resolution_parameter_01,\n            \"resolution_parameter_0\": resolution_parameter_0,\n            \"resolution_parameter_1\": resolution_parameter_1,\n            \"degree_as_node_size\": degree_as_node_size,\n            \"seed\": seed,\n        },\n    )\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/GiulioRossetti/cdlib/blob/cd3380b25633e544c4bfbba91c257fd033176fe1/cdlib/algorithms/bipartite_clustering.py#L111-L199",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F215"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=leidenalg%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F200"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import leidenalg\nimport igraph as ig\n\nG = ig.Graph.Erdos_Renyi(100, 0.1);\npart = leidenalg.find_partition(G, leidenalg.ModularityVertexPartition);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://raw.githubusercontent.com/vtraag/leidenalg/0.12.0/README.rst",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F205"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "python-louvain",
          "name": [
            {
              "t": "fact",
              "fact": "F218"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/taynaud/python-louvain"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/python-louvain"
            },
            {
              "label": "Docs",
              "href": "https://python-louvain.readthedocs.io/en/latest/api.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F225"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://python-louvain.readthedocs.io/en/latest/api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F218"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/benedekrozemberczki/karateclub",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F234"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def fit(self, graph: nx.classes.graph.Graph):\n    \"\"\"\n    Fitting an Edge Motif clustering model.\n\n    Arg types:\n        * **graph** *(NetworkX graph)* - The graph to be clustered.\n    \"\"\"\n    self._set_seed()\n    graph = self._check_graph(graph)\n    self._graph = graph\n    self._calculate_motifs()\n    self._extract_components()\n    self._fill_blocks()\n    self._partition = community.best_partition(self._graph, random_state=self.seed)\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/benedekrozemberczki/karateclub/blob/cb46a91df8dcbeb2570debcf6a9d0c518107a2de/karateclub/community_detection/non_overlapping/edmot.py#L78-L91",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F233"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=python-louvain%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F218"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import community as community_louvain\nimport networkx as nx\nG = nx.erdos_renyi_graph(100, 0.01)\npartion = community_louvain.best_partition(G)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://python-louvain.readthedocs.io/en/latest/api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "api.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F223"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "networkit",
          "name": [
            {
              "t": "fact",
              "fact": "F236"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/networkit/networkit"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/networkit"
            },
            {
              "label": "Docs",
              "href": "https://networkit.github.io/dev-docs/notebooks/User-Guide.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F88"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://networkit.github.io/dev-docs/notebooks/User-Guide.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F236"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F89"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F90"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F91"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F92"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F93"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F94"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F251"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/benedekrozemberczki/littleballoffur",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F250"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def get_pagerank(self, graph: NKGraph, alpha: float) -> np.array:\n    \"\"\"\n    Given a graph return the PageRank vector.\n    \"\"\"\n    pagerank = nk.centrality.PageRank(graph, alpha)\n    pagerank.run()\n    pagerank = np.array(pagerank.scores())\n    pagerank = pagerank / pagerank.sum()\n    return pagerank\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/benedekrozemberczki/littleballoffur/blob/67b3f6ba624d94384339eb859417d73ebeca1b02/littleballoffur/backend.py#L86-L94",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F249"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20that%20use%20networkit&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F236"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import networkit as nk\n\nG = nk.Graph(5)\n\nG.addEdge(1, 3)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://networkit.github.io/dev-docs/notebooks/GraphNotebook.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "User-Guide.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F241"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python graph library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#networkx",
          "label": [
            {
              "t": "text",
              "text": "NetworkX"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits most graph work, with any hashable Python object as a node. "
        },
        {
          "t": "link",
          "href": "#rustworkx",
          "label": [
            {
              "t": "text",
              "text": "rustworkx"
            }
          ]
        },
        {
          "t": "text",
          "text": " and "
        },
        {
          "t": "link",
          "href": "#igraph",
          "label": [
            {
              "t": "text",
              "text": "igraph"
            }
          ]
        },
        {
          "t": "text",
          "text": " suit larger graphs that need compiled algorithms. "
        },
        {
          "t": "link",
          "href": "#networkit",
          "label": [
            {
              "t": "text",
              "text": "NetworKit"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits very large networks with parallel algorithms."
        }
      ]
    },
    {
      "q": "What is NetworkX?",
      "a": [
        {
          "t": "link",
          "href": "#networkx",
          "label": [
            {
              "t": "text",
              "text": "NetworkX"
            }
          ]
        },
        {
          "t": "text",
          "text": " builds and analyzes graphs in pure Python with any hashable object as a node. It includes a broad set of graph algorithms and drawing helpers."
        }
      ]
    },
    {
      "q": "NetworkX vs igraph: which should I use?",
      "a": [
        {
          "t": "link",
          "href": "#networkx",
          "label": [
            {
              "t": "text",
              "text": "NetworkX"
            }
          ]
        },
        {
          "t": "text",
          "text": " keeps nodes as Python objects and suits graphs that change often. "
        },
        {
          "t": "link",
          "href": "#igraph",
          "label": [
            {
              "t": "text",
              "text": "igraph"
            }
          ]
        },
        {
          "t": "text",
          "text": " identifies vertices by index and suits relatively static networks that need faster analysis."
        }
      ]
    },
    {
      "q": "How do I detect communities in a graph in Python?",
      "a": [
        {
          "t": "link",
          "href": "#leidenalg",
          "label": [
            {
              "t": "text",
              "text": "leidenalg"
            }
          ]
        },
        {
          "t": "text",
          "text": " runs the Leiden algorithm and supports multiplex and temporal graph layers. "
        },
        {
          "t": "link",
          "href": "#python-louvain",
          "label": [
            {
              "t": "text",
              "text": "python-louvain"
            }
          ]
        },
        {
          "t": "text",
          "text": " runs the Louvain algorithm on an undirected NetworkX graph and returns a node-to-community dictionary."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, networkx",
      "display": "NetworkX",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, networkx",
      "display": "198.4M",
      "asOf": "2026-11-17"
    },
    "F3": {
      "label": "License, networkx",
      "display": "NOASSERTION",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, networkx",
      "display": "3.7, Sep 2026",
      "asOf": "2026-09-21"
    },
    "F5": {
      "label": "Package release date, networkx",
      "display": "Sep 2026",
      "asOf": "2026-09-21"
    },
    "F6": {
      "label": "Repository stars, networkx",
      "display": "17.4K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Shortest paths, networkx",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Community detection, networkx",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Parallel algorithms, networkx",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Directed graphs, networkx",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Output formats, networkx",
      "display": "GraphML",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "Install, networkx",
      "display": "pip install networkx",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "What it does, networkx",
      "display": "Builds and analyzes graphs with Python objects as nodes.",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths lead, networkx",
      "display": "Uses meaningful node labels",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths, networkx",
      "display": "Use strings or other hashable Python objects directly as nodes.",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths lead, networkx",
      "display": "Finds weighted and unweighted paths",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "strengths, networkx",
      "display": "Use one interface for directed, undirected, and weighted shortest paths.",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations lead, networkx",
      "display": "Parallel coverage depends on backend",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations, networkx",
      "display": "Unsupported nx-parallel functions fall back to NetworkX.",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations lead, networkx",
      "display": "GraphML inputs must be trusted",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "limitations, networkx",
      "display": "Only parse GraphML files from trusted sources.",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Quickstart, networkx",
      "display": "import networkx as nx\n\nDG = nx.DiGraph()\nDG.add_edge(2, 1)   # adds the nodes in order 2, 1\nDG.add_edge(1, 3)\nDG.add_edge(2, 4)\nDG.add_edge(1, 2)\nassert list(DG.successors(2)) == [1, 4]\nassert list(DG.edges) == [(2, 1), (2, 4), (1, 3), (1, 2)]\n",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project function, networkx",
      "display": "def girvan_newman(g_original: object, level: int) -> NodeClustering:\n    # ...\n\n    g = convert_graph_formats(g_original, nx.Graph)\n\n    gn_hierarchy = nx.algorithms.community.girvan_newman(g)\n    coms = []\n    if level==-1:\n        max_modularity = -float('inf')\n\n        for current_coms in gn_hierarchy:\n            mod = nx.algorithms.community.modularity(g, current_coms)\n            if mod > max_modularity:\n                max_modularity = mod\n                coms = current_coms\n    else:\n        for _ in range(level):\n            coms = next(gn_hierarchy)\n\n\n    communities = []\n\n    for c in coms:\n        communities.append(list(c))\n\n    return NodeClustering(\n        communities, g_original, \"Girvan Newman\", method_parameters={\"level\": level}\n    )\n",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project function reference, networkx",
      "display": "crisp_partition.py · girvan_newman()",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project repository, networkx",
      "display": "GiulioRossetti/cdlib",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Project stars, GiulioRossetti/cdlib",
      "display": "430",
      "asOf": "2026-11-17"
    },
    "F27": {
      "label": "Project push date, GiulioRossetti/cdlib",
      "display": "Aug 2026",
      "asOf": "2026-08-16"
    },
    "F28": {
      "label": "Library name, rustworkx",
      "display": "rustworkx",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Monthly downloads, rustworkx",
      "display": "5.5M",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "License, rustworkx",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Package release, rustworkx",
      "display": "0.18.1, Jul 2026",
      "asOf": "2026-07-30"
    },
    "F32": {
      "label": "Package release date, rustworkx",
      "display": "Jul 2026",
      "asOf": "2026-07-30"
    },
    "F33": {
      "label": "Repository stars, rustworkx",
      "display": "1.8K",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Shortest paths, rustworkx",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Parallel algorithms, rustworkx",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Directed graphs, rustworkx",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "Output formats, rustworkx",
      "display": "JSON",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "Install, rustworkx",
      "display": "pip install rustworkx",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "What it does, rustworkx",
      "display": "Builds indexed graphs with arbitrary Python data on nodes and edges.",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths lead, rustworkx",
      "display": "Stores Python data on edges",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths, rustworkx",
      "display": "Attach arbitrary Python objects to nodes and edges.",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "strengths lead, rustworkx",
      "display": "Parallelizes all-pairs shortest paths",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "strengths, rustworkx",
      "display": "Dijkstra all-pairs searches use a configurable thread pool.",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations lead, rustworkx",
      "display": "Deleted node IDs get reused",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations, rustworkx",
      "display": "Refresh cached node references after deleting and adding nodes.",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Quickstart, rustworkx",
      "display": "import rustworkx as rx\n\nG = rx.PyGraph()\nG.extend_from_edge_list([(0, 1), (0, 2)])\nnew_node = G.add_node(\"spam\")\nprint(rx.connected_components(G))\ndegrees = {}\nfor node in G.node_indices():\n    degrees[node] = G.degree(node)\nprint(degrees)\n",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project function, rustworkx",
      "display": "def _construct_graph_from_queue(queue, all_wires):\n    inds_for_objs = defaultdict(list)  # dict from wrappedobjs to all indices for the objs\n    nodes_on_wires = defaultdict(list)  # wire to list of nodes\n    mid_measure_nodes = {}  # MCMs to their corresponding nodes\n\n    graph = rx.PyDiGraph(multigraph=False)\n\n    for i, obj in enumerate(queue):\n        inds_for_objs[_WrappedObj(obj)].append(i)\n        obj_node = graph.add_node(i)\n        if isinstance(obj, (MidMeasure, PauliMeasure)):\n            mid_measure_nodes[obj] = obj_node\n        for w in _get_wires(obj, all_wires):\n            if w in nodes_on_wires:\n                graph.add_edge(nodes_on_wires[w][-1], obj_node, \"\")\n            nodes_on_wires[w].append(obj_node)\n        if isinstance(obj, Conditional):\n            for m in obj.meas_val.measurements:\n                if not graph.has_edge(mid_measure_nodes[m], obj_node):\n                    graph.add_edge(mid_measure_nodes[m], obj_node, \"\")\n\n    return graph, inds_for_objs, nodes_on_wires\n",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project function reference, rustworkx",
      "display": "circuit_graph.py · _construct_graph_from_queue()",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project repository, rustworkx",
      "display": "PennyLaneAI/pennylane",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project stars, PennyLaneAI/pennylane",
      "display": "3.5K",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project push date, PennyLaneAI/pennylane",
      "display": "Nov 2026",
      "asOf": "2026-11-12"
    },
    "F52": {
      "label": "Library name, igraph",
      "display": "igraph",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Monthly downloads, igraph",
      "display": "2.8M",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "License, igraph",
      "display": "GPL-2.0",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Package release, igraph",
      "display": "1.0.0, Oct 2025",
      "asOf": "2025-10-23"
    },
    "F56": {
      "label": "Package release date, igraph",
      "display": "Oct 2025",
      "asOf": "2025-10-23"
    },
    "F57": {
      "label": "Repository stars, igraph",
      "display": "1.5K",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Shortest paths, igraph",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Community detection, igraph",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Directed graphs, igraph",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Output formats, igraph",
      "display": "GML",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "Install, igraph",
      "display": "pip install igraph",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "What it does, igraph",
      "display": "Builds, analyzes, and exports graphs through indexed vertices.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths lead, igraph",
      "display": "Includes Leiden community detection",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths, igraph",
      "display": "Find communities with the built-in Leiden algorithm.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths lead, igraph",
      "display": "Reads and writes graph files",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "strengths, igraph",
      "display": "Exchange graphs with other tools through supported graph formats.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "limitations lead, igraph",
      "display": "Vertex deletion changes later IDs",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "limitations, igraph",
      "display": "Store stable labels separately when deleting vertices.",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "Quickstart, igraph",
      "display": "import igraph as ig\ng = ig.Graph(n=10, edges=[[0, 1], [0, 5]])\nprint(g)\n",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Project function, igraph",
      "display": "def walktrap(g_original: object, weights: str = None) -> NodeClustering:\n    # ...\n\n    if ig is None:\n        raise ModuleNotFoundError(\n            \"Optional dependency not satisfied: install igraph to use the selected feature.\"\n        )\n\n    g = convert_graph_formats(g_original, ig.Graph)\n    coms = g.community_walktrap(weights=weights).as_clustering()\n    communities = []\n\n    for c in coms:\n        communities.append([g.vs[x][\"name\"] for x in c])\n\n    return NodeClustering(\n        communities, g_original, \"Walktrap\", method_parameters={\"weights\": weights}\n    )\n",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Project function reference, igraph",
      "display": "crisp_partition.py · walktrap()",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Project repository, igraph",
      "display": "GiulioRossetti/cdlib",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Project stars, GiulioRossetti/cdlib",
      "display": "430",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Project push date, GiulioRossetti/cdlib",
      "display": "Aug 2026",
      "asOf": "2026-08-16"
    },
    "F76": {
      "label": "Library name, networkit",
      "display": "NetworKit",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Monthly downloads, networkit",
      "display": "91.5K",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "License, networkit",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Package release, networkit",
      "display": "11.3, Nov 2026",
      "asOf": "2026-11-06"
    },
    "F80": {
      "label": "Package release date, networkit",
      "display": "Nov 2026",
      "asOf": "2026-11-06"
    },
    "F81": {
      "label": "Repository stars, networkit",
      "display": "886",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Shortest paths, networkit",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "Community detection, networkit",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "Parallel algorithms, networkit",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "Directed graphs, networkit",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "Output formats, networkit",
      "display": "GraphML",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "Install, networkit",
      "display": "pip install networkit",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "What it does, networkit",
      "display": "Analyzes networks with parallel graph algorithms exposed to Python.",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "strengths lead, networkit",
      "display": "Uses multiple CPU cores",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "strengths, networkit",
      "display": "Run parallel graph algorithms through the Python API.",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "strengths lead, networkit",
      "display": "Generates clustered test graphs",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "strengths, networkit",
      "display": "Create clustered random graphs and detect their communities.",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "limitations lead, networkit",
      "display": "Node labels need integer mappings",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "limitations, networkit",
      "display": "Map string identifiers to integer node IDs before building graphs.",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Quickstart, networkit",
      "display": "import networkit as nk\n\nCRG = nk.generators.ClusteredRandomGraphGenerator(200, 4, 0.2, 0.002).generate()\nnk.community.detectCommunities(CRG)\n",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Project function, networkit",
      "display": "def get_pagerank(self, graph: NKGraph, alpha: float) -> np.array:\n    \"\"\"\n    Given a graph return the PageRank vector.\n    \"\"\"\n    pagerank = nk.centrality.PageRank(graph, alpha)\n    pagerank.run()\n    pagerank = np.array(pagerank.scores())\n    pagerank = pagerank / pagerank.sum()\n    return pagerank\n",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Project function reference, networkit",
      "display": "backend.py · get_pagerank()",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Project repository, networkit",
      "display": "benedekrozemberczki/littleballoffur",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Project stars, benedekrozemberczki/littleballoffur",
      "display": "714",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Project push date, benedekrozemberczki/littleballoffur",
      "display": "Dec 2025",
      "asOf": "2025-12-20"
    },
    "F101": {
      "label": "Library name, graph-tool",
      "display": "graph-tool",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Monthly downloads, graph-tool",
      "display": "Conda package",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "License, graph-tool",
      "display": "LGPL-3.0-or-later",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Package release, graph-tool",
      "display": "3.9, Sep 2026",
      "asOf": "2026-09-24"
    },
    "F105": {
      "label": "Package release date, graph-tool",
      "display": "Sep 2026",
      "asOf": "2026-09-24"
    },
    "F106": {
      "label": "Shortest paths, graph-tool",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Community detection, graph-tool",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Parallel algorithms, graph-tool",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Directed graphs, graph-tool",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "Output formats, graph-tool",
      "display": "GraphML",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "Install, graph-tool",
      "display": "conda install -c conda-forge graph-tool",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "What it does, graph-tool",
      "display": "Fits statistical network models and infers community structure.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "strengths lead, graph-tool",
      "display": "Fits statistical community models",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "strengths, graph-tool",
      "display": "Infer communities with stochastic block models.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "strengths lead, graph-tool",
      "display": "Parallelizes supported graph algorithms",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "strengths, graph-tool",
      "display": "Use OpenMP for supported shared-memory graph algorithms.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "limitations lead, graph-tool",
      "display": "Windows installation needs WSL",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "limitations, graph-tool",
      "display": "Install Windows Subsystem for Linux before using graph-tool on Windows.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "limitations lead, graph-tool",
      "display": "Parallelism needs an enabled build",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "limitations, graph-tool",
      "display": "Check openmp_enabled() before relying on OpenMP parallel execution.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "Quickstart, graph-tool",
      "display": "from graph_tool.all import *\ng = Graph()\nv1 = g.add_vertex()\nv2 = g.add_vertex()\ne = g.add_edge(v1, v2)\ngraph_draw(g, vertex_text=g.vertex_index, output=\"two-nodes.svg\")\n",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "Project function, graph-tool",
      "display": "def sbm_dl(\n    g_original: object,\n    weights: object = None,\n    rec_type: str = \"real-normal\",\n    deg_corr: bool = True,\n) -> NodeClustering:\n    # ...\n\n    if gt is None:\n        raise Exception(\n            \"===================================================== \\n\"\n            \"The graph-tool library seems not to be installed (or incorrectly installed). \\n\"\n            \"Please check installation procedure there \"\n            \"https://git.skewed.de/count0/graph-tool/wikis/installation-instructions#native-installation \\n\"\n            \"on linux/mac, you can use package managers to do so \"\n            \"(apt-get install python3-graph-tool, brew install graph-tool, etc.)\"\n        )\n    gt_g = convert_graph_formats(g_original, nx.Graph)\n    weight_attr = __prepare_sbm_weights(gt_g, weights)\n    gt_g, label_map = __from_nx_to_graph_tool(gt_g, weight=weight_attr)\n    state_args = {\"deg_corr\": deg_corr}\n    if weight_attr is not None:\n        state_args[\"recs\"] = [gt_g.ep[weight_attr]]\n        state_args[\"rec_types\"] = [rec_type]\n    state = gt.minimize_blockmodel_dl(gt_g, state_args=state_args)\n\n    affiliations = state.get_blocks().get_array()\n    affiliations = {label_map[i]: affiliations[i] for i in range(len(affiliations))}\n    coms = affiliations2nodesets(affiliations)\n    coms = [list(v) for k, v in coms.items()]\n    return NodeClustering(\n        coms,\n        g_original,\n        \"SBM\",\n        method_parameters={\n            \"weights\": weights,\n            \"rec_type\": rec_type if weights is not None else None,\n            \"deg_corr\": deg_corr,\n        },\n    )\n",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "Project function reference, graph-tool",
      "display": "crisp_partition.py · sbm_dl()",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "Project repository, graph-tool",
      "display": "GiulioRossetti/cdlib",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "Project stars, GiulioRossetti/cdlib",
      "display": "430",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "Project push date, GiulioRossetti/cdlib",
      "display": "Aug 2026",
      "asOf": "2026-08-16"
    },
    "F127": {
      "label": "Developer need",
      "display": "Using Python objects as node labels",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "Why choose networkx",
      "display": "accepts hashable Python node labels",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "Developer need in introduction",
      "display": "using Python objects as node labels",
      "asOf": "2026-11-17"
    },
    "F130": {
      "label": "When to consider rustworkx",
      "display": "indexed nodes hold Python data",
      "asOf": "2026-11-17"
    },
    "F131": {
      "label": "Developer need",
      "display": "Finding Leiden communities",
      "asOf": "2026-11-17"
    },
    "F132": {
      "label": "Why choose igraph",
      "display": "includes Leiden community detection",
      "asOf": "2026-11-17"
    },
    "F133": {
      "label": "Developer need in introduction",
      "display": "finding Leiden communities",
      "asOf": "2026-11-17"
    },
    "F134": {
      "label": "When to consider graph-tool",
      "display": "for stochastic block-model communities",
      "asOf": "2026-11-17"
    },
    "F135": {
      "label": "Developer need",
      "display": "Parallel all-pairs shortest paths",
      "asOf": "2026-11-17"
    },
    "F136": {
      "label": "Why choose rustworkx",
      "display": "runs Dijkstra searches across worker threads",
      "asOf": "2026-11-17"
    },
    "F137": {
      "label": "Developer need in introduction",
      "display": "parallel all-pairs shortest paths",
      "asOf": "2026-11-17"
    },
    "F138": {
      "label": "When to consider networkx",
      "display": "for a unified shortest-path interface",
      "asOf": "2026-11-17"
    },
    "F139": {
      "label": "Developer need",
      "display": "Analyzing networks across CPU cores",
      "asOf": "2026-11-17"
    },
    "F140": {
      "label": "Why choose networkit",
      "display": "supports parallel graph algorithms",
      "asOf": "2026-11-17"
    },
    "F141": {
      "label": "Developer need in introduction",
      "display": "analyzing networks across CPU cores",
      "asOf": "2026-11-17"
    },
    "F142": {
      "label": "When to consider igraph",
      "display": "Leiden communities are the requirement",
      "asOf": "2026-11-17"
    },
    "F143": {
      "label": "Developer need",
      "display": "Fitting statistical community models",
      "asOf": "2026-11-17"
    },
    "F144": {
      "label": "Why choose graph-tool",
      "display": "fits stochastic block models",
      "asOf": "2026-11-17"
    },
    "F145": {
      "label": "Developer need in introduction",
      "display": "fitting statistical community models",
      "asOf": "2026-11-17"
    },
    "F146": {
      "label": "When to consider igraph",
      "display": "for Leiden community detection",
      "asOf": "2026-11-17"
    },
    "F147": {
      "label": "Page introduction",
      "display": "Python graph libraries let developers build and analyze graphs of nodes and edges.",
      "asOf": "2026-11-17"
    },
    "F148": {
      "label": "FAQ: How do I create a Python graph from an edge list?",
      "display": "Create a NetworkX Graph and pass edge tuples to add_edges_from.",
      "asOf": "2026-11-17"
    },
    "F149": {
      "label": "FAQ: How do I find the shortest path between two nodes?",
      "display": "Call NetworkX shortest_path with source and target; set weight when edge weights should matter.",
      "asOf": "2026-11-17"
    },
    "F150": {
      "label": "FAQ: How can I convert a NetworkX graph to igraph?",
      "display": "Use igraph Graph.from_networkx to construct an igraph graph from a NetworkX graph.",
      "asOf": "2026-11-17"
    },
    "F151": {
      "label": "FAQ: How do I create a directed graph in Python?",
      "display": "Use NetworkX DiGraph for directed edges and its in_degree and out_degree properties for directional degree.",
      "asOf": "2026-11-17"
    },
    "F152": {
      "label": "Library name, networkx",
      "display": "NetworkX",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Monthly downloads, networkx",
      "display": "279.1M",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "License, networkx",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Package release, networkx",
      "display": "3.7",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Package release date, networkx",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Install, networkx",
      "display": "pip install networkx",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Quickstart, networkx",
      "display": "import networkx as nx\nG = nx.Graph()\n\nG.add_node(1)\n",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Repository stars, networkx",
      "display": "17.4K",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Directed graph algorithms, networkx",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Parallel edges, networkx",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Algorithm scope, networkx",
      "display": "Graph data structures and general graph algorithms",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Implementation, networkx",
      "display": "Python",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Project function, networkx",
      "display": "def girvan_newman(g_original: object, level: int) -> NodeClustering:\n    \"\"\"\n    The Girvan–Newman algorithm detects communities by progressively removing edges from the original graph.\n    The algorithm removes the \"most valuable\" edge, traditionally the edge with the highest betweenness centrality, at each step. As the graph breaks down into pieces, the tightly knit community structure is exposed and the result can be depicted as a dendrogram.\n\n\n    **Supported Graph Types**\n\n    ========== ======== ========\n    Undirected Directed Weighted\n    ========== ======== ========\n    Yes        No       No\n    ========== ======== ========\n\n    :param g_original: a networkx/igraph object\n    :param level: the level where to cut the dendrogram (-1 for highest modularity)\n    :return: NodeClustering object\n\n    :Example:\n\n    >>> from cdlib import algorithms\n    >>> import networkx as nx\n    >>> G = nx.karate_club_graph()\n    >>> com = algorithms.girvan_newman(G, level=3)\n\n    :References:\n\n    Girvan, Michelle, and Mark EJ Newman. `Community structure in social and biological networks. <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC122977/>`_ Proceedings of the national academy of sciences 99.12 (2002): 7821-7826.\n    \"\"\"\n\n    g = convert_graph_formats(g_original, nx.Graph)\n\n    gn_hierarchy = nx.algorithms.community.girvan_newman(g)\n    coms = []\n    if level==-1:\n        max_modularity = -float('inf')\n\n        for current_coms in gn_hierarchy:\n            mod = nx.algorithms.community.modularity(g, current_coms)\n            if mod > max_modularity:\n                max_modularity = mod\n                coms = current_coms\n    else:\n        for _ in range(level):\n            coms = next(gn_hierarchy)\n\n\n    communities = []\n\n    for c in coms:\n        communities.append(list(c))\n\n    return NodeClustering(\n        communities, g_original, \"Girvan Newman\", method_parameters={\"level\": level}\n    )\n",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Project source file, networkx",
      "display": "cdlib/algorithms/crisp_partition.py",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Project full_name, networkx",
      "display": "GiulioRossetti/cdlib",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Project stargazers_count, networkx",
      "display": "430",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Library name, rustworkx",
      "display": "rustworkx",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Monthly downloads, rustworkx",
      "display": "7.5M",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "License, rustworkx",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Package release, rustworkx",
      "display": "0.18.1",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Package release date, rustworkx",
      "display": "Jul 2026",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Install, rustworkx",
      "display": "pip install rustworkx",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Quickstart, rustworkx",
      "display": "import rustworkx as rx\n\nG = rx.PyGraph()\n\nG.add_node(1)\n",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Repository stars, rustworkx",
      "display": "1.8K",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Directed graph algorithms, rustworkx",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Parallel edges, rustworkx",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Algorithm scope, rustworkx",
      "display": "Graph data structures and general graph algorithms",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Implementation, rustworkx",
      "display": "Rust",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Project function, rustworkx",
      "display": "def _construct_graph_from_queue(queue, all_wires):\n    inds_for_objs = defaultdict(list)  # dict from wrappedobjs to all indices for the objs\n    nodes_on_wires = defaultdict(list)  # wire to list of nodes\n    mid_measure_nodes = {}  # MCMs to their corresponding nodes\n\n    graph = rx.PyDiGraph(multigraph=False)\n\n    for i, obj in enumerate(queue):\n        inds_for_objs[_WrappedObj(obj)].append(i)\n        obj_node = graph.add_node(i)\n        if isinstance(obj, (MidMeasure, PauliMeasure)):\n            mid_measure_nodes[obj] = obj_node\n        for w in _get_wires(obj, all_wires):\n            if w in nodes_on_wires:\n                graph.add_edge(nodes_on_wires[w][-1], obj_node, \"\")\n            nodes_on_wires[w].append(obj_node)\n        if isinstance(obj, Conditional):\n            for m in obj.meas_val.measurements:\n                if not graph.has_edge(mid_measure_nodes[m], obj_node):\n                    graph.add_edge(mid_measure_nodes[m], obj_node, \"\")\n\n    return graph, inds_for_objs, nodes_on_wires\n",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Project source file, rustworkx",
      "display": "pennylane/circuit_graph.py",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Project full_name, rustworkx",
      "display": "PennyLaneAI/pennylane",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Project stargazers_count, rustworkx",
      "display": "3.5K",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Library name, igraph",
      "display": "igraph",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Monthly downloads, igraph",
      "display": "4.3M",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "License, igraph",
      "display": "GPL-2.0",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Package release, igraph",
      "display": "1.0.0",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Package release date, igraph",
      "display": "Oct 2025",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Install, igraph",
      "display": "pip install igraph",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Quickstart, igraph",
      "display": "import igraph as ig\ng = ig.Graph(n=10, edges=[[0, 1], [0, 5]])\nprint(g)\n",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Repository stars, igraph",
      "display": "1.5K",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Directed graph algorithms, igraph",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Parallel edges, igraph",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Algorithm scope, igraph",
      "display": "Graph data structures and general graph algorithms",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Implementation, igraph",
      "display": "C library with Python interface",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Project function, igraph",
      "display": "def walktrap(g_original: object, weights: str = None) -> NodeClustering:\n    \"\"\"\n    walktrap is an approach based on random walks.\n    The general idea is that if you perform random walks on the graph, then the walks are more likely to stay within the same community because there are only a few edges that lead outside a given community. Walktrap runs short random walks and uses the results of these random walks to merge separate communities in a bottom-up manner.\n\n\n    **Supported Graph Types**\n\n    ========== ======== ========\n    Undirected Directed Weighted\n    ========== ======== ========\n    Yes        No       Yes\n    ========== ======== ========\n\n    :param g_original: a networkx/igraph object\n    :param weights: label used for the edge weights. Default, None.\n    :return: NodeClusterint object\n\n    :Example:\n\n    >>> from cdlib import algorithms\n    >>> import networkx as nx\n    >>> G = nx.karate_club_graph()\n    >>> coms = algorithms.walktrap(G)\n\n    :References:\n\n    Pons, Pascal, and Matthieu Latapy. `Computing communities in large networks using random walks. <http://jgaa.info/accepted/2006/PonsLatapy2006.10.2.pdf/>`_ J. Graph Algorithms Appl. 10.2 (2006): 191-218.\n    \"\"\"\n\n    if ig is None:\n        raise ModuleNotFoundError(\n            \"Optional dependency not satisfied: install igraph to use the selected feature.\"\n        )\n\n    g = convert_graph_formats(g_original, ig.Graph)\n    coms = g.community_walktrap(weights=weights).as_clustering()\n    communities = []\n\n    for c in coms:\n        communities.append([g.vs[x][\"name\"] for x in c])\n\n    return NodeClustering(\n        communities, g_original, \"Walktrap\", method_parameters={\"weights\": weights}\n    )\n",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Project source file, igraph",
      "display": "cdlib/algorithms/crisp_partition.py",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Project full_name, igraph",
      "display": "GiulioRossetti/cdlib",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Project stargazers_count, igraph",
      "display": "430",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Library name, leidenalg",
      "display": "leidenalg",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Monthly downloads, leidenalg",
      "display": "1.8M",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "License, leidenalg",
      "display": "GPL-3.0-or-later",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Package release, leidenalg",
      "display": "0.12.0",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Package release date, leidenalg",
      "display": "May 2026",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Install, leidenalg",
      "display": "pip install leidenalg",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Quickstart, leidenalg",
      "display": "import leidenalg\nimport igraph as ig\n\nG = ig.Graph.Erdos_Renyi(100, 0.1);\npart = leidenalg.find_partition(G, leidenalg.ModularityVertexPartition);\n",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Official description, leidenalg",
      "display": "Detects communities in large networks with the Leiden algorithm.",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Quickstart source file, leidenalg",
      "display": "README.rst",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Repository stars, leidenalg",
      "display": "803",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Directed graph algorithms, leidenalg",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Parallel edges, leidenalg",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Algorithm scope, leidenalg",
      "display": "Community detection specialist",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Implementation, leidenalg",
      "display": "C++ community-detection algorithms with Python interface",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Project function, leidenalg",
      "display": "def CPM_Bipartite(\n    g_original: object,\n    resolution_parameter_01: float,\n    resolution_parameter_0: float = 0,\n    resolution_parameter_1: float = 0,\n    degree_as_node_size: bool = False,\n    seed: int = 0,\n) -> BiNodeClustering:\n    \"\"\"\n    CPM_Bipartite is the extension of CPM to bipartite graphs\n\n\n    **Supported Graph Types**\n\n    ========== ======== ======== =========\n    Undirected Directed Weighted Bipartite\n    ========== ======== ======== =========\n    Yes        No       No       Yes\n    ========== ======== ======== =========\n\n    :param g_original: a networkx/igraph object\n    :param resolution_parameter_01: Resolution parameter for in between two classes.\n    :param resolution_parameter_0: Resolution parameter for class 0.\n    :param resolution_parameter_1: Resolution parameter for class 1.\n    :param degree_as_node_size: If ``True`` use degree as node size instead of 1, to mimic modularity\n    :param seed: the random seed to be used in CPM method to keep results/partitions replicable\n    :return: BiNodeClustering object\n\n    :Example:\n\n    >>> from cdlib import algorithms\n    >>> import networkx as nx\n    >>> G = nx.algorithms.bipartite.generators.random_graph(100, 20, 0.5)\n    >>> coms = algorithms.CPM_Bipartite(G, 0.5)\n\n    :References:\n\n    Barber, M. J. (2007). Modularity and community detection in bipartite networks. Physical Review E, 76(6), 066102. 10.1103/PhysRevE.76.066102\n\n    .. note:: Reference implementation: https://leidenalg.readthedocs.io/en/stable/multiplex.html?highlight=bipartite#bipartite\n    \"\"\"\n    global leidenalg\n    if ig is None or leidenalg is None:\n        try:\n            import leidenalg\n        except ModuleNotFoundError:\n            raise ModuleNotFoundError(\n                \"Optional dependency not satisfied: install igraph and leidenalg to use the \"\n                \"selected feature.\"\n            )\n\n    g = convert_graph_formats(g_original, ig.Graph)\n\n    try:\n        g.vs[\"name\"]\n    except:\n        g.vs[\"name\"] = [v.index for v in g.vs]\n\n    seed = get_seed(seed)\n\n    optimiser = leidenalg.Optimiser()\n    leidenalg.Optimiser.set_rng_seed(self=optimiser, value=seed)\n\n    p_01, p_0, p_1 = leidenalg.CPMVertexPartition.Bipartite(\n        g,\n        resolution_parameter_01=resolution_parameter_01,\n        resolution_parameter_0=resolution_parameter_0,\n        resolution_parameter_1=resolution_parameter_1,\n        degree_as_node_size=degree_as_node_size,\n    )\n    optimiser.optimise_partition_multiplex([p_01, p_0, p_1], layer_weights=[1, -1, -1])\n\n    coms = defaultdict(list)\n    for n in g.vs:\n        coms[p_01.membership[n.index]].append(n.index)\n\n    return BiNodeClustering(\n        list(coms.values()),\n        [],\n        g_original,\n        \"CPM_Bipartite\",\n        method_parameters={\n            \"resolution_parameter_01\": resolution_parameter_01,\n            \"resolution_parameter_0\": resolution_parameter_0,\n            \"resolution_parameter_1\": resolution_parameter_1,\n            \"degree_as_node_size\": degree_as_node_size,\n            \"seed\": seed,\n        },\n    )\n",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Project source file, leidenalg",
      "display": "cdlib/algorithms/bipartite_clustering.py",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Project full_name, leidenalg",
      "display": "GiulioRossetti/cdlib",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Project stargazers_count, leidenalg",
      "display": "430",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Library name, python-louvain",
      "display": "python-louvain",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Monthly downloads, python-louvain",
      "display": "361.8K",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "License, python-louvain",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Package release, python-louvain",
      "display": "0.16",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Package release date, python-louvain",
      "display": "Jan 2022",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Install, python-louvain",
      "display": "pip install python-louvain",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Quickstart, python-louvain",
      "display": "import community as community_louvain\nimport networkx as nx\nG = nx.erdos_renyi_graph(100, 0.01)\npartion = community_louvain.best_partition(G)\n",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Official description, python-louvain",
      "display": "Detects communities with the Louvain algorithm.",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Quickstart source file, python-louvain",
      "display": "api.html",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Repository stars, python-louvain",
      "display": "1.0K",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Directed graph algorithms, python-louvain",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Parallel edges, python-louvain",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Algorithm scope, python-louvain",
      "display": "Community detection specialist",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Implementation, python-louvain",
      "display": "Python implementation using NetworkX and NumPy",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Project function, python-louvain",
      "display": "def fit(self, graph: nx.classes.graph.Graph):\n    \"\"\"\n    Fitting an Edge Motif clustering model.\n\n    Arg types:\n        * **graph** *(NetworkX graph)* - The graph to be clustered.\n    \"\"\"\n    self._set_seed()\n    graph = self._check_graph(graph)\n    self._graph = graph\n    self._calculate_motifs()\n    self._extract_components()\n    self._fill_blocks()\n    self._partition = community.best_partition(self._graph, random_state=self.seed)\n",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Project source file, python-louvain",
      "display": "karateclub/community_detection/non_overlapping/edmot.py",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Project full_name, python-louvain",
      "display": "benedekrozemberczki/karateclub",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Project stargazers_count, python-louvain",
      "display": "2.3K",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Library name, networkit",
      "display": "NetworKit",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Monthly downloads, networkit",
      "display": "191.7K",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "License, networkit",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Package release, networkit",
      "display": "11.3",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Package release date, networkit",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Install, networkit",
      "display": "pip3 install networkit",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Quickstart, networkit",
      "display": "import networkit as nk\n\nG = nk.Graph(5)\n\nG.addEdge(1, 3)\n",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Repository stars, networkit",
      "display": "886",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Directed graph algorithms, networkit",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Parallel edges, networkit",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Algorithm scope, networkit",
      "display": "Graph data structures and general graph algorithms",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Implementation, networkit",
      "display": "C++ algorithms exposed through Cython",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Project function, networkit",
      "display": "def get_pagerank(self, graph: NKGraph, alpha: float) -> np.array:\n    \"\"\"\n    Given a graph return the PageRank vector.\n    \"\"\"\n    pagerank = nk.centrality.PageRank(graph, alpha)\n    pagerank.run()\n    pagerank = np.array(pagerank.scores())\n    pagerank = pagerank / pagerank.sum()\n    return pagerank\n",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Project source file, networkit",
      "display": "littleballoffur/backend.py",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Project full_name, networkit",
      "display": "benedekrozemberczki/littleballoffur",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Project stargazers_count, networkit",
      "display": "714",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Python graph libraries NetworkX igraph rustworkx NetworKit graph-tool shortest paths community detection parallel algorithms",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
