powergrid_synth.transmission.edge_creation

Edge creation for same-voltage subgraphs using the Chung-Lu Chain (CLC) model.

Implements Algorithm 2 (CLC) from Aksoy et al. (2018) (arXiv:1711.11098, Appendix A.2).

Module Contents

class powergrid_synth.transmission.edge_creation.EdgeCreator[source]

Generate edges for a same-voltage subgraph via the CLC model.

The CLC model creates edges in three stages:

  1. A deterministic diameter path connecting vertices across boxes \(0, 1, \dots, \delta\) to guarantee the desired diameter.

  2. A deterministic subdiameter path providing alternate routes and long cycles.

  3. Within-box fast Chung-Lu random graphs, where each box is an independent Chung-Lu realization.

See Algorithm 2 in Aksoy et al. (2018).

generate_edges(d_prime, v, D, S)[source]

Generate the edge list for one same-voltage subgraph.

Implements CLC(\(\mathbf{d}', \mathbf{v}, D, S\)) → \(E\) (Algorithm 2).

Parameters:
  • d_prime (numpy.ndarray) – Inflated degree sequence from Preprocessor.run_setup().

  • v (numpy.ndarray) – Vertex-to-box mapping where v[i] is the box ID for node i.

  • D (set of int) – Diameter path vertex indices (one per box, spanning boxes \(0\) to \(\delta\)).

  • S (set of int) – Subdiameter path vertex indices.

Returns:

Edge list as (u, w) pairs with u < w.

Return type:

list of tuple[int, int]

Notes

The within-box Chung-Lu stage uses the fast Chung-Lu implementation: for each box \(k\), \(m_k\) edges are generated by sampling endpoints proportionally to their desired degree (random.choices). Self-loops are discarded.