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.5.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.5-cp311-cp311-macosx_14_0_arm64.whl (37.7 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

File details

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

File metadata

  • Download URL: gradco-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 c92427ba986628807fe9819588212f11c33087113bab0dc3629ac0b5fa85f4a9
MD5 6b0b0cd12bd96c4801270ff7b1cce55a
BLAKE2b-256 1b39d8337d58a41d3138833bc8c690298d8d4941a5f68afb5247ea8e3f4c938b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gradco-0.1.5-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a17b082ac6c158399aa6e7970c5e83a1979525128bafaac49d7e8e7b3e74fe51
MD5 3de7ed159279831870f1583c1c047c27
BLAKE2b-256 9d9c053acd73a8bbbbbf17d1cc9cfd1c597ea288ba4dbb354fa364a1c8c9db58

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