{"id":20618291,"url":"https://github.com/tddschn/networkx-easygraph-comparison","last_synced_at":"2025-03-06T19:43:33.904Z","repository":{"id":53934911,"uuid":"510723230","full_name":"tddschn/networkx-easygraph-comparison","owner":"tddschn","description":"Rough Comparison of the Python Graph Libraries NetworkX and EasyGraph","archived":false,"fork":false,"pushed_at":"2022-10-20T14:21:49.000Z","size":603,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T04:47:54.128Z","etag":null,"topics":["comparison","easygraph","graph-algorithms","networkx","python"],"latest_commit_sha":null,"homepage":"https://github.com/tddschn/awesome-easygraph","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tddschn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-05T12:17:51.000Z","updated_at":"2022-12-23T06:52:12.000Z","dependencies_parsed_at":"2023-01-20T16:01:05.506Z","dependency_job_id":null,"html_url":"https://github.com/tddschn/networkx-easygraph-comparison","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tddschn%2Fnetworkx-easygraph-comparison","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tddschn%2Fnetworkx-easygraph-comparison/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tddschn%2Fnetworkx-easygraph-comparison/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tddschn%2Fnetworkx-easygraph-comparison/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tddschn","download_url":"https://codeload.github.com/tddschn/networkx-easygraph-comparison/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242277652,"owners_count":20101536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comparison","easygraph","graph-algorithms","networkx","python"],"created_at":"2024-11-16T12:07:50.710Z","updated_at":"2025-03-06T19:43:33.874Z","avatar_url":"https://github.com/tddschn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Rough Comparison of the two Python Graph Libraries NetworkX and EasyGraph\n\n[NetworkX](https://networkx.org)\n\n[EasyGraph](https://github.com/easy-graph/Easy-Graph)\n\nEasyGraph mentioned in this article refers to v0.2a38, unless specified otherwise.\n\n- [A Rough Comparison of the two Python Graph Libraries NetworkX and EasyGraph](#a-rough-comparison-of-the-two-python-graph-libraries-networkx-and-easygraph)\n  - [Overview](#overview)\n  - [Classes and Functions](#classes-and-functions)\n  - [Dependencies](#dependencies)\n  - [Graph classes](#graph-classes)\n    - [NetworkX](#networkx)\n    - [EasyGraph](#easygraph)\n  - [Graph Algorithms](#graph-algorithms)\n  - [Graph I/O](#graph-io)\n  - [Useful links](#useful-links)\n  - [Other Graph Libraries](#other-graph-libraries)\n\n## Overview\n\nNetworkX has [a LOT more](#classes-and-functions) [features](#graph-algorithms) EasyGraph, but lacks SHS detection features. It's first commit was in 2005.\n\nIt has lots of contributors and is still being actively developed, and is [used by a lot of people](https://github.com/networkx/networkx/network/dependents) (107,831 Repositories, 4,003 Packages).\n\n[NetworkX GitHub Pulse](https://github.com/networkx/networkx/pulse)\n\nEasyGraph is developed by Fudan University students, and its development and code base is quite messy and not governed by a written rule. The first commit was in 2020.\n\nEasyGraph GitHub Pulse [(last week)](https://github.com/easy-graph/Easy-Graph/pulse), [(last month)](https://github.com/easy-graph/Easy-Graph/pulse/monthly), and the only project that depends on EasyGraph is my [easygraph-test](https://github.com/easy-graph/Easy-Graph/network/dependents) repository.\n\n\nThe [documentation](https://easy-graph.github.io/) sucks, the [tutorial code](https://easy-graph.github.io/tutorial.html) doesn't work as advertised (cuz it's outdated), and the API reference only contains [class and function signatures](https://easy-graph.github.io/reference/structural_hole_spanners.html).  \nIt's likely you'd find the source code to be more useful than the documentation.\n\nEG devs say they have better support for reading from and writing to a wide range of graph formats, but that's not true. NetworkX still wins in that respect.\n\n![](./images/networkx-overview.png)\n\n![](./images/Easy-Graph-overview.png)\n\n## Classes and Functions\n\nSee [Symbol Comparison](./symbol-comparison.md)\n\n## Dependencies\n\n[NetworkX Dependency Graph](https://github.com/networkx/networkx/network/dependencies)\n\n[EasyGraph Dependency Graph](https://github.com/easy-graph/Easy-Graph/network/dependencies)\n\nNetworkX, surprisingly, has no dependencies, only some optional dependencies, specified in its `requirements` directory.\n\nExample: the `[default]` optional dependency group includes libraries like `matplotlib` for drawing.\n\nThe core functionalities of NetworkX (graph representation, graph algorithms) does not depend on any other libraries.\n\n\u003c!-- cSpell:disable --\u003e\nEasyGraph, on the other hand, specified a bunch of utility dependencies (`joblib`, `progressbar`, `tqdm`) heavy dependencies (`numpy`, `pandas`, `matplotlib`, `scikit-learn`, `tensorflow`) as required.\n\nIts core classes don't require these dependencies.\n\n`numpy` is heavily used in many of EasyGraph's code base, for various purposes:\n- Graph representation (`graphml.py`, `ucinet.py`, `gexf.py`)\n- Utility code (`alias.py`, `to_numpy_matrix`, `to_numpy_array`)\n- Almost all files that implement some SHS detection algorithms (`maxBlock.py` and many others)\n\nML libs `sklearn` and `tensorflow` are used only for implementing SHS detection algorithms.\n\nThe utility functions aren't really necessary and could be moved to optional deps.\n\n\n\u003c!-- cSpell:enable --\u003e\n\n## Graph classes\n\n\nBoth libraries have classes for `undirected` and `directed` graphs and multigraphs (parallel edges allowed).\n\n### NetworkX\n\nNetworkX also supports [Ordered Graphs](https://networkx.org/documentation/stable/reference/classes/ordered.html) which give a consistent order for reporting of nodes and edges, but it's being deprecated.\n\nNetworkX graphs' `edges` attribute (or should I say, property) returns data of type `EdgeView`,\n\nthe library also has `DegreeView, EdgeView, NodeView, AdjacencyView` view classes and `FilterAdjacency, FilterMultiInner, FilterMultiAdjacency` filter classes defined.\n\nThe view classes are quiet sophisticated and define dunder methods like `__len__`, `__iter__` and `__contains__`, and provide Pythonic interface for the users.\n\n`classes/filters.py` defines `[ \"no_filter\", \"hide_nodes\", \"hide_edges\", \"hide_multiedges\", \"hide_diedges\", \"hide_multidiedges\", \"show_nodes\", \"show_edges\", \"show_multiedges\", \"show_diedges\", \"show_multidiedges\"]`, which provides toggles for graph instances so that users can choose what kinds of nodes / edges to receive.\n\n`classes/function.py` defines common functions (`neighbors`, `density`, `is_directed`, `to_directed` etc) that operate on the view classes mentioned above.\n\n### EasyGraph\n\nThe undirected graph class `Graph` has a C++ counter part `GraphC`, which is still quite [buggy](https://github.com/tddschn/easygraph-test).\n\nThe `operations.py`, like `function.py` in NetworkX, implements a small number of common graph operations.\n\nThere's no view or filter classes, just the four graph classes. \n\nThe `edges` property returns a list of edges.\n\nDunder methods are only defined directly on the graph classes. (NetworkX does this too)\n\n## Graph Algorithms\n\n\u003cdetails\u003e\n  \u003csummary\u003enetworkx/algorithms\u003c/summary\u003e\n  \n  ```\nnetworkx/algorithms\n├── __init__.py\n├── approximation\n│  ├── __init__.py\n│  ├── clique.py\n│  ├── clustering_coefficient.py\n│  ├── connectivity.py\n│  ├── distance_measures.py\n│  ├── dominating_set.py\n│  ├── kcomponents.py\n│  ├── matching.py\n│  ├── maxcut.py\n│  ├── ramsey.py\n│  ├── steinertree.py\n│  ├── traveling_salesman.py\n│  ├── treewidth.py\n│  └── vertex_cover.py\n├── assortativity\n│  ├── __init__.py\n│  ├── connectivity.py\n│  ├── correlation.py\n│  ├── mixing.py\n│  ├── neighbor_degree.py\n│  └── pairs.py\n├── asteroidal.py\n├── bipartite\n│  ├── __init__.py\n│  ├── basic.py\n│  ├── centrality.py\n│  ├── cluster.py\n│  ├── covering.py\n│  ├── edgelist.py\n│  ├── generators.py\n│  ├── matching.py\n│  ├── matrix.py\n│  ├── projection.py\n│  ├── redundancy.py\n│  └── spectral.py\n├── boundary.py\n├── bridges.py\n├── centrality\n│  ├── __init__.py\n│  ├── betweenness.py\n│  ├── betweenness_subset.py\n│  ├── closeness.py\n│  ├── current_flow_betweenness.py\n│  ├── current_flow_betweenness_subset.py\n│  ├── current_flow_closeness.py\n│  ├── degree_alg.py\n│  ├── dispersion.py\n│  ├── eigenvector.py\n│  ├── flow_matrix.py\n│  ├── group.py\n│  ├── harmonic.py\n│  ├── katz.py\n│  ├── load.py\n│  ├── percolation.py\n│  ├── reaching.py\n│  ├── second_order.py\n│  ├── subgraph_alg.py\n│  ├── trophic.py\n│  └── voterank_alg.py\n├── chains.py\n├── chordal.py\n├── clique.py\n├── cluster.py\n├── coloring\n│  ├── __init__.py\n│  ├── equitable_coloring.py\n│  └── greedy_coloring.py\n├── communicability_alg.py\n├── community\n│  ├── __init__.py\n│  ├── asyn_fluid.py\n│  ├── centrality.py\n│  ├── community_utils.py\n│  ├── kclique.py\n│  ├── kernighan_lin.py\n│  ├── label_propagation.py\n│  ├── louvain.py\n│  ├── lukes.py\n│  ├── modularity_max.py\n│  └── quality.py\n├── components\n│  ├── __init__.py\n│  ├── attracting.py\n│  ├── biconnected.py\n│  ├── connected.py\n│  ├── semiconnected.py\n│  ├── strongly_connected.py\n│  └── weakly_connected.py\n├── connectivity\n│  ├── __init__.py\n│  ├── connectivity.py\n│  ├── cuts.py\n│  ├── disjoint_paths.py\n│  ├── edge_augmentation.py\n│  ├── edge_kcomponents.py\n│  ├── kcomponents.py\n│  ├── kcutsets.py\n│  ├── stoerwagner.py\n│  └── utils.py\n├── core.py\n├── covering.py\n├── cuts.py\n├── cycles.py\n├── d_separation.py\n├── dag.py\n├── distance_measures.py\n├── distance_regular.py\n├── dominance.py\n├── dominating.py\n├── efficiency_measures.py\n├── euler.py\n├── flow\n│  ├── __init__.py\n│  ├── boykovkolmogorov.py\n│  ├── capacityscaling.py\n│  ├── dinitz_alg.py\n│  ├── edmondskarp.py\n│  ├── gomory_hu.py\n│  ├── maxflow.py\n│  ├── mincost.py\n│  ├── networksimplex.py\n│  ├── preflowpush.py\n│  ├── shortestaugmentingpath.py\n│  └── utils.py\n├── graph_hashing.py\n├── graphical.py\n├── hierarchy.py\n├── hybrid.py\n├── isolate.py\n├── isomorphism\n│  ├── __init__.py\n│  ├── ismags.py\n│  ├── isomorph.py\n│  ├── isomorphvf2.py\n│  ├── matchhelpers.py\n│  ├── temporalisomorphvf2.py\n│  ├── tree_isomorphism.py\n│  └── vf2userfunc.py\n├── link_analysis\n│  ├── __init__.py\n│  ├── hits_alg.py\n│  └── pagerank_alg.py\n├── link_prediction.py\n├── lowest_common_ancestors.py\n├── matching.py\n├── minors\n│  ├── __init__.py\n│  └── contraction.py\n├── mis.py\n├── moral.py\n├── node_classification\n│  ├── __init__.py\n│  ├── hmn.py\n│  ├── lgc.py\n│  └── utils.py\n├── non_randomness.py\n├── operators\n│  ├── __init__.py\n│  ├── all.py\n│  ├── binary.py\n│  ├── product.py\n│  └── unary.py\n├── planar_drawing.py\n├── planarity.py\n├── polynomials.py\n├── reciprocity.py\n├── regular.py\n├── richclub.py\n├── shortest_paths\n│  ├── __init__.py\n│  ├── astar.py\n│  ├── dense.py\n│  ├── generic.py\n│  ├── unweighted.py\n│  └── weighted.py\n├── similarity.py\n├── simple_paths.py\n├── smallworld.py\n├── smetric.py\n├── sparsifiers.py\n├── structuralholes.py\n├── summarization.py\n├── swap.py\n├── threshold.py\n├── tournament.py\n├── traversal\n│  ├── __init__.py\n│  ├── beamsearch.py\n│  ├── breadth_first_search.py\n│  ├── depth_first_search.py\n│  ├── edgebfs.py\n│  └── edgedfs.py\n├── tree\n│  ├── __init__.py\n│  ├── branchings.py\n│  ├── coding.py\n│  ├── decomposition.py\n│  ├── mst.py\n│  ├── operations.py\n│  └── recognition.py\n├── triads.py\n├── vitality.py\n├── voronoi.py\n└── wiener.py\n\n  ```\n\u003c!-- Two important rules:\n\nMake sure you have an empty line after the closing \u003c/summary\u003e tag, otherwise the markdown/code blocks won't show correctly.\nMake sure you have an empty line after the closing \u003c/details\u003e tag if you have multiple collapsible sections. --\u003e\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eeasygraph/functions\u003c/summary\u003e\n  \n  ```\nfunctions\n├── __init__.py\n├── centrality\n│  ├── __init__.py\n│  ├── betweenness.py\n│  ├── clossness.py\n│  ├── degree.py\n│  └── flowbetweenness.py\n├── community\n│  ├── __init__.py\n│  ├── LPA.py\n│  ├── modularity.py\n│  ├── modularity_max_detection.py\n│  └── motif.py\n├── components\n│  ├── __init__.py\n│  ├── biconnected.py\n│  ├── connected.py\n│  └── ego_betweenness.py\n├── drawing\n│  ├── __init__.py\n│  ├── drawing.py\n│  ├── plot.py\n│  └── positioning.py\n├── graph_embedding\n│  ├── __init__.py\n│  ├── deepwalk.py\n│  ├── line.py\n│  ├── NOBE.py\n│  ├── node2vec.py\n│  └── sdne.py\n├── graph_generator\n│  ├── __init__.py\n│  ├── classic.py\n│  └── RandomNetwork.py\n├── not_sorted\n│  ├── __init__.py\n│  ├── bridges.py\n│  ├── cluster.py\n│  ├── laplacian.py\n│  ├── mst.py\n│  └── pagerank.py\n├── path\n│  ├── __init__.py\n│  └── path.py\n└── structural_holes\n   ├── __init__.py\n   ├── AP_Greedy.py\n   ├── evaluation.py\n   ├── HAM.py\n   ├── HIS.py\n   ├── ICC.py\n   ├── maxBlock.py\n   ├── MaxD.py\n   ├── metrics.py\n   ├── NOBE.py\n   ├── SHII_metric.py\n   ├── strong_connected_component.py\n   └── weakTie.py\n\n  ```\n\u003c!-- Two important rules:\n\nMake sure you have an empty line after the closing \u003c/summary\u003e tag, otherwise the markdown/code blocks won't show correctly.\nMake sure you have an empty line after the closing \u003c/details\u003e tag if you have multiple collapsible sections. --\u003e\n\u003c/details\u003e\n\n## Graph I/O\n\n![](images/networkx-readwrite.png)\n\n![](images/eg-readwrite.png)\n\n## Useful links\n\n- [EasyGraph](https://github.com/easy-graph/Easy-Graph)\n- [NetworkX](https://networkx.org)\n- [easygraph-bench](https://github.com/tddschn/easygraph-bench)\n    Benchmarking code and results of easygraph (Python / C++) and networkx\n\n## Other Graph Libraries\n\nSee [other-graph-libraries.md](./other-graph-libraries.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftddschn%2Fnetworkx-easygraph-comparison","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftddschn%2Fnetworkx-easygraph-comparison","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftddschn%2Fnetworkx-easygraph-comparison/lists"}