GC_MSTgreedy module

class GC_MSTgreedy.MSTgreedy(grid=None, verbose_logging=30)[source]

Bases: object

Class to implement the greedy algorithm for finding the Minimum Spanning Tree (MST).

net

The network object containing distribution network data.

Solve(algorithm='kruskal', randomMST=False, one=False, current_power=False, inverted=False)[source]

Solves the Minimum Spanning Tree problem using a greedy algorithm.

Parameters:
  • randomMST – If True, assigns random weights to edges.

  • algorithm – The algorithm to use for finding the MST (‘kruskal’, ‘prim’, or ‘boruvka’).

  • one – If True, assigns a weight of 50 to all edges.

  • current_power – If True, weights are based on current power values.

Returns:

List of disabled line indices in the network after reconfiguration.

__init__(grid=None, verbose_logging=30)[source]

Initializes the MSTgreedy class with required parameters.

Parameters:
  • net – The network object for optimization.

  • verbose_logging – Logging level for debug messages.