Skip to main content

cgSpan

cgSpan is an algorithm for mining closed frequent subgraphs. This implementation of cgSpan is built using an existing implementation for gSpan.

gSpan is an algorithm for mining frequent subgraphs.

This program implements cgSpan with Python. The repository on GitHub is https://github.com/NaazS03/cgSpan

The gSpan implementation referenced by this program can be found on GitHub at https://github.com/betterenvi/gSpan.

Undirected Graphs

This program supports undirected graphs.

How to install

This program supports Python 3.

Method 1

Install this project using pip:

pip install cgspan-mining
Method 2

First, clone the project:

git clone https://github.com/NaazS03/cgSpan.git
cd cgSpan

You can optionally install this project as a third-party library so that you can run it under any path.

python setup.py install

How to run

The command is:

python -m cgspan_mining [-s min_support] [-n num_graph] [-l min_num_vertices] [-u max_num_vertices] [-v True/False] [-p True/False] [-w True/False] [-h] database_file_name 
Some examples
  • Read graph data from ./graphdata/graph.data, and mine closed subgraphs given min support is 5000
python -m cgspan_mining -s 5000 ./graphdata/graph.data
  • Read graph data from ./graphdata/graph.data, mine closed subgraphs given min support is 5000, and visualize these frequent subgraphs(matplotlib and networkx are required)
python -m cgspan_mining -s 5000 -p True ./graphdata/graph.data
  • Print help info
python -m cgspan_mining -h

Reference

CloseGraph: Mining Close Frequent Graph Patterns, by X. Yan and J.Han.

gSpan: Graph-Based Substructure Pattern Mining, by X. Yan and J. Han. Proc. 2002 of Int. Conf. on Data Mining (ICDM'02).

Metadata

Release files for cgspan-mining 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cgspan-mining 1.0.1
File Size Uploaded Provenance Actions
cgspan_mining-1.0.1.tar.gz 14.3 kB Without provenance Details for cgspan_mining-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cgspan-mining 1.0.1
File Interpreter ABI Platform Actions
cgspan_mining-1.0.1-py3-none-any.whl Python 3 none any Details for cgspan_mining-1.0.1-py3-none-any.whl

Total release size: 31.3 kB

Release files / cgspan_mining-1.0.1.tar.gz

Download URL cgspan_mining-1.0.1.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bdaceead84c5d076aee2d9ce933f5377517e220dfc89c4ddbb703c078eaba04b
BLAKE2b-256 checksum
How to use checksums
7a75876837ed107636c7a916cc4aa96ebe22e384e43c599e73e7d0882f7494d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.7

Release files / cgspan_mining-1.0.1-py3-none-any.whl

Download URL cgspan_mining-1.0.1-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bdb9d04bc0ff60f82be780bbf51e67c1556bdbb27cf317d3c768948071cd04d
BLAKE2b-256 checksum
How to use checksums
8a961c1b95c29fc1bdd69711542d487004d50b46392a30b140f1cfff9ca53dcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.7

Security for cgspan-mining 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page