Skip to content

qoolqit.embedding.graph_embedder

source module qoolqit.embedding.graph_embedder

Classes

source class GraphToGraphEmbedder(algorithm: Callable, config: ConfigType)

Bases : BaseEmbedder[DataGraph, DataGraph, ConfigType]

A family of embedders that map a graph to a graph.

Focused on unit-disk graph embedding, where the goal is to find a set of coordinates for a graph that has no coordinates, such that the final unit-disk edges matches the set of edges in the original graph.

A custom algorithm and configuration can be set at initialization.

Default initializer for all embedders, taking an algorithm and a config.

An algorithm should be a standalone function that takes a piece of data of an InDataType and maps it to an OutDataType. Any extra configuration parameters taken as input by the algorithm function should be defined in the config dataclass, inheriting from EmbeddingConfig.

Parameters

  • algorithm : Callable a callable to the algorithm function.

  • config : ConfigType a config dataclass holding parameter values for the algorithm.

Attributes

  • config : ConfigType Returns the config for the embedding algorithm.

  • algorithm : Callable Returns the callable to the embedding algorithm.

  • info : str Prints info about the embedding algorithm.

Methods

source method GraphToGraphEmbedder.validate_input(data: DataGraph)None

Raises

  • TypeError

source method GraphToGraphEmbedder.validate_output(result: DataGraph)None

Raises

  • TypeError

source class SpringLayoutEmbedder()

Bases : GraphToGraphEmbedder[SpringLayoutConfig]

A graph to graph embedder using the spring layout algorithm.

Attributes

  • config : ConfigType Returns the config for the embedding algorithm.

  • algorithm : Callable Returns the callable to the embedding algorithm.

  • info : str Prints info about the embedding algorithm.