Graph module (corneto.graph)#

Base classes#

BaseGraph([default_edge_type])

Abstract base class for graphs and hypergraphs.

Graph([default_edge_type])

Concrete graph implementation supporting directed/undirected edges and hyperedges.

class corneto.graph.EdgeType(value)#

Bases: str, Enum

Edge type (DIRECTED, UNDIRECTED).

DIRECTED#

Represents a directed edge

UNDIRECTED#

Represents an undirected edge

Random networks#

duplication_divergence_network(n[, ...])

Generate a random network using the duplication-divergence model.

preferential_attachment_network(n, m[, ...])

Generate a random network using the Barabasi-Albert preferential attachment model.

Graph data structures and generators.