Skip to main content

GRaphlet-orbit ADjacency COunter (GRADCO).

Project description

This is our alpha-version of GRADCO, our general purpose counter that can output graphlet degree vectors (GDVs), edge graphlet degree vectors, graphlet adjacency matrices, edge orbit adjacency matrices and node orbit adjacency matrices. GRADCO is part of our submission ‘Graphlets correct for the topological information missed by random walks’ (DOI:10.48550/arXiv.2405.14194) , in which we formally define the topological information that is implicitly captured by random walks in terms of orbit adjacencies (i.e., the co-occurence of nodes on symmetric positions within graphlets). We mathematically prove random walks miss various orbit adjacencies and illustrate that these orbit adjacencies have real-world value in a multiclass label prediction setting. If you use GRADCO, please cite our paper.

We are working on improving the documentation. For now, we provide the example code below to illustrate how to use our counter, GRADCO.

import gradco as gradco
import networkx as nx
from scipy.sparse import csr_array


def main():

    # generate a random graph
    n = 1000
    m = 10
    G = nx.barabasi_albert_graph(n, m, seed=42)
    A = nx.to_scipy_sparse_array(G)

    # create GRADCO counter object
    counter = gradco.Counter(A)

    # count the orbit adjacency matrices
    counter.count()

    # iterate over the orbit adjacencies
    for hop, o1, o2, A in counter.generate_orbit_adjacencies():
        print("O:", hop, o1, o2)

    # iterate the graphlet adjacencies
    for graphlet, A in enumerate(counter.generate_graphlet_adjacencies()):
        print("GA:", graphlet)

    # get the graphlet degree vectors
    GDV = counter.get_GDVs()

    # get the edge graphlet degree vectors
    eGDV = counter.get_edge_GDVs()

    # get the edge orbit adjacency matrices
    for e, A in enumerate(counter.generate_edge_orbit_adjacencies()):
        print("EA:", e)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gradco-0.1.4.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gradco-0.1.4-cp311-cp311-macosx_14_0_arm64.whl (37.8 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

File details

Details for the file gradco-0.1.4.tar.gz.

File metadata

  • Download URL: gradco-0.1.4.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.7

File hashes

Hashes for gradco-0.1.4.tar.gz
Algorithm Hash digest
SHA256 dc5fef61a6b126435e052f79dc007279904f9f4128eb12aca310947815b7adde
MD5 e9bb1711c504feb599deaad3f37bfc1d
BLAKE2b-256 32898220d8cae9392446a4f1e82d6715ab45c777a887f4a5d8cbfe5bd6c4a40c

See more details on using hashes here.

File details

Details for the file gradco-0.1.4-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for gradco-0.1.4-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 cf33f85c7ee440eecbf08f8309bf55ea0757eabbed52195360d5d3a925342658
MD5 0add943cbc1a88eaa91fae28d476f992
BLAKE2b-256 5784c5a1717d8f88b0711786389af8664bf215de4ae767a2f405405a5cd86b91

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page