roveac.key_generator

Key Generators

This module provides the KeyGenerator class, which defines a method for generating a key from a graph for use in dictionary generation and hashing.

Classes

KeyGenerator

Class for generating keys from graphs.

Classes

KeyGenerator()

Class for generating a unique key from a graph, intended for use in dictionary generation and hashing.

class roveac.key_generator.KeyGenerator

Class for generating a unique key from a graph, intended for use in dictionary generation and hashing.

Methods

generate_key(G: nx.Graph, method: str)

Produces a key based on the given graph.

classmethod count_all_subgraphs(G: Graph, nodes=None)

Count all subgraphs of size 3 with 0, 1, 2, or 3 edges for each node in G.

Parameters

Gnx.Graph

The graph in which to count subgraphs.

nodesiterable of nodes or single node, optional

Nodes to include in the count. If a single node is given, returns counts for that node only.

Returns

dict

A dictionary where keys are nodes and values are tuples representing the count of subgraphs with 1 edge, 2 edges, and 3 edges (triangles) for each node.

classmethod generate_key(G: Graph, method: str = 'triangle')

Generate a unique key for the provided graph G.

Parameters

Gnx.Graph

The graph from which to generate the key.

methodstr

Denotes which method to use to construct the dictionary.

Returns

key

A unique identifier generated from the graph.